From owner-svn-src-all@freebsd.org Sun Jun 5 01:40:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD6E9B685DA; Sun, 5 Jun 2016 01:40:09 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB0121B9C; Sun, 5 Jun 2016 01:40:09 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u551e8op040209; Sun, 5 Jun 2016 01:40:08 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u551e8MN040208; Sun, 5 Jun 2016 01:40:08 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606050140.u551e8MN040208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Sun, 5 Jun 2016 01:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301415 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 01:40:10 -0000 Author: lidl Date: Sun Jun 5 01:40:08 2016 New Revision: 301415 URL: https://svnweb.freebsd.org/changeset/base/301415 Log: Correct path for blacklistd.conf in OptionalObsoleteFiles.inc Fix typo made when adding the blacklistd.conf file to OptionalObsoleteFiles.inc Submitted by: Herbert J. Skuhra ( herbert at mailbox.org ) Reviewed by: rpaulo Approved by: rpaulo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6715 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jun 4 23:34:51 2016 (r301414) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jun 5 01:40:08 2016 (r301415) @@ -447,9 +447,9 @@ OLD_FILES+=usr/share/man/man3/blacklist_ OLD_FILES+=usr/share/man/man3/blacklist_r.3.gz OLD_FILES+=usr/share/man/man3/blacklist_sa.3.gz OLD_FILES+=usr/share/man/man3/blacklist_sa_r.3.gz +OLD_FILES+=usr/share/man/man5/blacklistd.conf.5.gz OLD_FILES+=usr/share/man/man8/blacklistctl.8.gz OLD_FILES+=usr/share/man/man8/blacklistd.8.gz -OLD_FILES+=usr/share/man/man8/blacklistd.conf.5.gz .endif .if ${MK_BLUETOOTH} == no From owner-svn-src-all@freebsd.org Sun Jun 5 01:42:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78866B6874E; Sun, 5 Jun 2016 01:42:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50BA21F23; Sun, 5 Jun 2016 01:42:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u551gbgX043514; Sun, 5 Jun 2016 01:42:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u551gbfC043513; Sun, 5 Jun 2016 01:42:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050142.u551gbfC043513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 01:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301416 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 01:42:38 -0000 Author: adrian Date: Sun Jun 5 01:42:37 2016 New Revision: 301416 URL: https://svnweb.freebsd.org/changeset/base/301416 Log: [ath_hal] Make the AR9462 2.0 initvals from ath9k compile. The (upcoming) semi-working AR9462 2.1 support uses the 2.0 initvals where appropriate, and those need to at least compile under freebsd. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h Sun Jun 5 01:40:08 2016 (r301415) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h Sun Jun 5 01:42:37 2016 (r301416) @@ -22,13 +22,14 @@ #define ar9462_2p0_mac_postamble ar9331_1p1_mac_postamble -#define ar9462_2p0_common_wo_xlna_rx_gain ar9300Common_wo_xlna_rx_gain_table_2p2 +//#define ar9462_2p0_common_wo_xlna_rx_gain ar9300Common_wo_xlna_rx_gain_table_2p2 +#define ar9462_2p0_common_wo_xlna_rx_gain ar9300Common_wo_xlna_rx_gain_table_osprey_2p2 #define ar9462_2p0_common_5g_xlna_only_rxgain ar9462_2p0_common_mixed_rx_gain #define ar9462_2p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484 -static const u32 ar9462_2p0_modes_fast_clock[][3] = { +static const uint32_t ar9462_2p0_modes_fast_clock[][3] = { /* Addr 5G_HT20 5G_HT40 */ {0x00001030, 0x00000268, 0x000004d0}, {0x00001070, 0x0000018c, 0x00000318}, @@ -41,7 +42,7 @@ static const u32 ar9462_2p0_modes_fast_c {0x0000a254, 0x00000898, 0x00001130}, }; -static const u32 ar9462_2p0_baseband_postamble[][5] = { +static const uint32_t ar9462_2p0_baseband_postamble[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d}, {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae}, @@ -100,7 +101,7 @@ static const u32 ar9462_2p0_baseband_pos {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550}, }; -static const u32 ar9462_2p0_common_rx_gain[][2] = { +static const uint32_t ar9462_2p0_common_rx_gain[][2] = { /* Addr allmodes */ {0x0000a000, 0x00010000}, {0x0000a004, 0x00030002}, @@ -360,21 +361,21 @@ static const u32 ar9462_2p0_common_rx_ga {0x0000b1fc, 0x00000196}, }; -static const u32 ar9462_2p0_pciephy_clkreq_disable_L1[][2] = { +static const uint32_t ar9462_2p0_pciephy_clkreq_disable_L1[][2] = { /* Addr allmodes */ {0x00018c00, 0x18213ede}, {0x00018c04, 0x000801d8}, {0x00018c08, 0x0003780c}, }; -static const u32 ar9462_2p0_radio_postamble_sys2ant[][5] = { +static const uint32_t ar9462_2p0_radio_postamble_sys2ant[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808}, {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008}, {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008}, }; -static const u32 ar9462_2p0_modes_low_ob_db_tx_gain[][5] = { +static const uint32_t ar9462_2p0_modes_low_ob_db_tx_gain[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002}, {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, @@ -443,12 +444,12 @@ static const u32 ar9462_2p0_modes_low_ob {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000}, }; -static const u32 ar9462_2p0_soc_postamble[][5] = { +static const uint32_t ar9462_2p0_soc_postamble[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033}, }; -static const u32 ar9462_2p0_baseband_core[][2] = { +static const uint32_t ar9462_2p0_baseband_core[][2] = { /* Addr allmodes */ {0x00009800, 0xafe68e30}, {0x00009804, 0xfd14e000}, @@ -598,7 +599,7 @@ static const u32 ar9462_2p0_baseband_cor {0x0000b6b4, 0x00000001}, }; -static const u32 ar9462_2p0_radio_postamble[][5] = { +static const uint32_t ar9462_2p0_radio_postamble[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524}, {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70}, @@ -606,7 +607,7 @@ static const u32 ar9462_2p0_radio_postam {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000}, }; -static const u32 ar9462_2p0_modes_mix_ob_db_tx_gain[][5] = { +static const uint32_t ar9462_2p0_modes_mix_ob_db_tx_gain[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002}, {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352}, @@ -669,7 +670,7 @@ static const u32 ar9462_2p0_modes_mix_ob {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, }; -static const u32 ar9462_2p0_modes_high_ob_db_tx_gain[][5] = { +static const uint32_t ar9462_2p0_modes_high_ob_db_tx_gain[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002}, {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352}, @@ -738,7 +739,7 @@ static const u32 ar9462_2p0_modes_high_o {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000}, }; -static const u32 ar9462_2p0_radio_core[][2] = { +static const uint32_t ar9462_2p0_radio_core[][2] = { /* Addr allmodes */ {0x00016000, 0x36db6db6}, {0x00016004, 0x6db6db40}, @@ -796,7 +797,7 @@ static const u32 ar9462_2p0_radio_core[] {0x00016548, 0x000080c0}, }; -static const u32 ar9462_2p0_soc_preamble[][2] = { +static const uint32_t ar9462_2p0_soc_preamble[][2] = { /* Addr allmodes */ {0x000040a4, 0x00a0c1c9}, {0x00007020, 0x00000000}, @@ -804,7 +805,7 @@ static const u32 ar9462_2p0_soc_preamble {0x00007038, 0x000004c2}, }; -static const u32 ar9462_2p0_mac_core[][2] = { +static const uint32_t ar9462_2p0_mac_core[][2] = { /* Addr allmodes */ {0x00000008, 0x00000000}, {0x00000030, 0x000e0085}, @@ -967,7 +968,7 @@ static const u32 ar9462_2p0_mac_core[][2 {0x000083d0, 0x000301ff}, }; -static const u32 ar9462_2p0_common_mixed_rx_gain[][2] = { +static const uint32_t ar9462_2p0_common_mixed_rx_gain[][2] = { /* Addr allmodes */ {0x0000a000, 0x00010000}, {0x0000a004, 0x00030002}, @@ -1227,17 +1228,17 @@ static const u32 ar9462_2p0_common_mixed {0x0000b1fc, 0x00000196}, }; -static const u32 ar9462_2p0_baseband_postamble_5g_xlna[][5] = { +static const uint32_t ar9462_2p0_baseband_postamble_5g_xlna[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282}, }; -static const u32 ar9462_2p0_baseband_core_mix_rxgain[][2] = { +static const uint32_t ar9462_2p0_baseband_core_mix_rxgain[][2] = { /* Addr allmodes */ {0x00009fd0, 0x0a2d6b93}, }; -static const u32 ar9462_2p0_baseband_postamble_mix_rxgain[][5] = { +static const uint32_t ar9462_2p0_baseband_postamble_mix_rxgain[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x00009820, 0x206a022e, 0x206a022e, 0x206a01ae, 0x206a01ae}, {0x00009824, 0x63c640de, 0x5ac640d0, 0x63c640da, 0x63c640da}, From owner-svn-src-all@freebsd.org Sun Jun 5 01:42:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA08B687C2; Sun, 5 Jun 2016 01:42:59 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE45210AA; Sun, 5 Jun 2016 01:42:59 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u551gwYW043571; Sun, 5 Jun 2016 01:42:58 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u551gwsV043569; Sun, 5 Jun 2016 01:42:58 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606050142.u551gwsV043569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Sun, 5 Jun 2016 01:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301417 - head/libexec/rlogind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 01:43:00 -0000 Author: lidl Date: Sun Jun 5 01:42:58 2016 New Revision: 301417 URL: https://svnweb.freebsd.org/changeset/base/301417 Log: Add blacklist support to rlogind Reviewed by: rpaulo Approved by: rpaulo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6593 Modified: head/libexec/rlogind/Makefile head/libexec/rlogind/rlogind.c Modified: head/libexec/rlogind/Makefile ============================================================================== --- head/libexec/rlogind/Makefile Sun Jun 5 01:42:37 2016 (r301416) +++ head/libexec/rlogind/Makefile Sun Jun 5 01:42:58 2016 (r301417) @@ -14,4 +14,10 @@ WARNS?= 2 CFLAGS+= -DINET6 .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include +LIBADD+= blacklist +LDFLAGS+=-L${LIBBLACKLISTDIR} +.endif + .include Modified: head/libexec/rlogind/rlogind.c ============================================================================== --- head/libexec/rlogind/rlogind.c Sun Jun 5 01:42:37 2016 (r301416) +++ head/libexec/rlogind/rlogind.c Sun Jun 5 01:42:58 2016 (r301417) @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); #include #include #include - +#ifdef USE_BLACKLIST +#include +#endif #ifndef TIOCPKT_WINDOW #define TIOCPKT_WINDOW 0x80 @@ -229,6 +231,9 @@ doit(int f, union sockunion *fromp) /* error check ? */ syslog(LOG_NOTICE, "Connection from %s on illegal port", nameinfo); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "illegal port"); +#endif fatal(f, "Permission denied", 0); } #ifdef IP_OPTIONS @@ -252,6 +257,9 @@ doit(int f, union sockunion *fromp) "Connection refused from %s with IP option %s", inet_ntoa(fromp->su_sin.sin_addr), c == IPOPT_LSRR ? "LSRR" : "SSRR"); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "source routing present"); +#endif exit(1); } if (c == IPOPT_EOL) @@ -281,11 +289,17 @@ doit(int f, union sockunion *fromp) if (f > 2) /* f should always be 0, but... */ (void) close(f); setup_term(0); - if (*lusername=='-') { + if (*lusername=='-') { syslog(LOG_ERR, "tried to pass user \"%s\" to login", lusername); +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "invalid user"); +#endif fatal(STDERR_FILENO, "invalid user", 0); } +#ifdef USE_BLACKLIST + blacklist(0, STDIN_FILENO, "success"); +#endif if (authenticated) { execl(_PATH_LOGIN, "login", "-p", "-h", hostname, "-f", lusername, (char *)NULL); @@ -508,8 +522,12 @@ getstr(char *buf, int cnt, char *errmsg) do { if (read(STDIN_FILENO, &c, 1) != 1) exit(1); - if (--cnt < 0) + if (--cnt < 0) { +#ifdef USE_BLACKLIST + blacklist(1, STDIN_FILENO, "buffer overflow"); +#endif fatal(STDOUT_FILENO, errmsg, 0); + } *buf++ = c; } while (c != 0); } From owner-svn-src-all@freebsd.org Sun Jun 5 02:02:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9479FB68C53; Sun, 5 Jun 2016 02:02:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61F4818DA; Sun, 5 Jun 2016 02:02:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5522pnZ051461; Sun, 5 Jun 2016 02:02:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5522pKu051460; Sun, 5 Jun 2016 02:02:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050202.u5522pKu051460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 02:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301418 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 02:02:52 -0000 Author: adrian Date: Sun Jun 5 02:02:51 2016 New Revision: 301418 URL: https://svnweb.freebsd.org/changeset/base/301418 Log: [acpi] graphics drivers want access to acpi lid handle the graphics drivers can benefit from access to the lid handle for querying and getting notifications Submitted by: kmacy Differential Revision: https://reviews.freebsd.org/D6643 Modified: head/sys/dev/acpica/acpi_lid.c Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Sun Jun 5 01:42:58 2016 (r301417) +++ head/sys/dev/acpica/acpi_lid.c Sun Jun 5 02:02:51 2016 (r301418) @@ -52,6 +52,8 @@ struct acpi_lid_softc { int lid_status; /* open or closed */ }; +ACPI_HANDLE acpi_lid_handle; + ACPI_SERIAL_DECL(lid, "ACPI lid"); static int acpi_lid_probe(device_t dev); @@ -105,7 +107,7 @@ acpi_lid_attach(device_t dev) sc = device_get_softc(dev); sc->lid_dev = dev; - sc->lid_handle = acpi_get_handle(dev); + acpi_lid_handle = sc->lid_handle = acpi_get_handle(dev); /* * If a system does not get lid events, it may make sense to change From owner-svn-src-all@freebsd.org Sun Jun 5 02:15:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 118ACB68F1C; Sun, 5 Jun 2016 02:15:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC8431EA4; Sun, 5 Jun 2016 02:15:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u552FUNr055463; Sun, 5 Jun 2016 02:15:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u552FUOa055462; Sun, 5 Jun 2016 02:15:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050215.u552FUOa055462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 02:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301419 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 02:15:31 -0000 Author: adrian Date: Sun Jun 5 02:15:29 2016 New Revision: 301419 URL: https://svnweb.freebsd.org/changeset/base/301419 Log: [ath_hal] convert the MCI code over to work on Jupiter 2.1. (Note: jupiter 1.0 was emulation / test silicon, and was never released in production. So, yes, AR_SREV_JUPITER() would really be fine.) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Sun Jun 5 02:02:51 2016 (r301418) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c Sun Jun 5 02:15:29 2016 (r301419) @@ -107,7 +107,7 @@ void ar9300_mci_osla_setup(struct ath_ha static void ar9300_mci_reset_req_wakeup(struct ath_hal *ah) { /* to be tested in emulation */ - if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) { + if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { OS_REG_RMW_FIELD(ah, AR_MCI_COMMAND2, AR_MCI_COMMAND2_RESET_REQ_WAKEUP, 1); OS_DELAY(1); @@ -364,7 +364,7 @@ static void ar9300_mci_send_2g5g_status( struct ath_hal_9300 *ahp = AH9300(ah); u_int32_t new_flags, to_set, to_clear; - if ((AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) && + if ((AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) && (ahp->ah_mci_coex_2g5g_update == AH_TRUE) && (ahp->ah_mci_bt_state != MCI_BT_SLEEP)) { @@ -409,7 +409,7 @@ void ar9300_mci_2g5g_switch(struct ath_h OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE); - if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) { + if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { OS_REG_CLR_BIT(ah, AR_GLB_CONTROL, AR_BTCOEX_CTRL_BT_OWN_SPDT_CTRL); if (!(ah->ah_config.ath_hal_mci_config & @@ -425,7 +425,7 @@ void ar9300_mci_2g5g_switch(struct ath_h OS_REG_SET_BIT(ah, AR_MCI_TX_CTRL, AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE); - if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) { + if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { OS_REG_SET_BIT(ah, AR_GLB_CONTROL, AR_BTCOEX_CTRL_BT_OWN_SPDT_CTRL); ar9300_mci_osla_setup(ah, AH_FALSE); @@ -1035,7 +1035,7 @@ void ar9300_mci_reset(struct ath_hal *ah } - if (is_2g && (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) && + if (is_2g && (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) && !(ah->ah_config.ath_hal_mci_config & ATH_MCI_CONFIG_DISABLE_OSLA)) { @@ -1045,7 +1045,7 @@ void ar9300_mci_reset(struct ath_hal *ah ar9300_mci_osla_setup(ah, AH_FALSE); } - if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) { + if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { OS_REG_SET_BIT(ah, AR_GLB_CONTROL, AR_BTCOEX_CTRL_SPDT_ENABLE); OS_REG_RMW_FIELD(ah, AR_BTCOEX_CTRL3, @@ -1743,7 +1743,7 @@ ar9300_mci_state(struct ath_hal *ah, u_i ar9300_mci_send_coex_bt_status_query(ah, AH_TRUE, MCI_GPM_COEX_QUERY_BT_DEBUG); OS_DELAY(10); - if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) { + if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { ar9300_mci_send_coex_bt_flags(ah, AH_TRUE, MCI_GPM_COEX_BT_FLAGS_READ, 0); } From owner-svn-src-all@freebsd.org Sun Jun 5 02:16:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0048FB68F88; Sun, 5 Jun 2016 02:16:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C55161027; Sun, 5 Jun 2016 02:16:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u552GGmp055575; Sun, 5 Jun 2016 02:16:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u552GGpF055574; Sun, 5 Jun 2016 02:16:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050216.u552GGpF055574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 02:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301420 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 02:16:18 -0000 Author: adrian Date: Sun Jun 5 02:16:16 2016 New Revision: 301420 URL: https://svnweb.freebsd.org/changeset/base/301420 Log: [ath_hal] teach the reset path(s) about Jupiter 2.1. This was just .. not programming in things, and thus large chunks of the radio wouldn't work. Notably, 5GHz didn't work. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sun Jun 5 02:15:29 2016 (r301419) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sun Jun 5 02:16:16 2016 (r301420) @@ -3000,7 +3000,7 @@ ar9300_process_ini(struct ath_hal *ah, s ar9300_prog_ini(ah, &ahp->ah_ini_mac[i], modes_index); ar9300_prog_ini(ah, &ahp->ah_ini_bb[i], modes_index); ar9300_prog_ini(ah, &ahp->ah_ini_radio[i], modes_index); - if ((i == ATH_INI_POST) && (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah))) { + if ((i == ATH_INI_POST) && (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah))) { ar9300_prog_ini(ah, &ahp->ah_ini_radio_post_sys2ant, modes_index); } @@ -3118,7 +3118,8 @@ ar9300_process_ini(struct ath_hal *ah, s } #if 0 - if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) { + /* XXX TODO! */ + if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { ar9300_prog_ini(ah, &ahp->ah_ini_BTCOEX_MAX_TXPWR, 1); } #endif @@ -4497,7 +4498,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM #if ATH_SUPPORT_MCI if (AH_PRIVATE(ah)->ah_caps.halMciSupport && - (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah))) + (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah))) { ar9300_mci_2g5g_changed(ah, IEEE80211_IS_CHAN_2GHZ(chan)); } From owner-svn-src-all@freebsd.org Sun Jun 5 02:17:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2820CB6A002; Sun, 5 Jun 2016 02:17:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D9D11A5; Sun, 5 Jun 2016 02:17:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u552HqJk055705; Sun, 5 Jun 2016 02:17:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u552HqKM055704; Sun, 5 Jun 2016 02:17:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050217.u552HqKM055704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 02:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301421 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 02:17:53 -0000 Author: adrian Date: Sun Jun 5 02:17:51 2016 New Revision: 301421 URL: https://svnweb.freebsd.org/changeset/base/301421 Log: [ath_hal] Add Jupiter 2.1 (AR9462 mac 640.3) support. Turns out I wasn't even initialising or programming a lot of stuff for the AR9462 2.1 chip. Oops. This mostly gets it working. powersave scan results in some pretty hilarious NFcal hangs and I don't see beacons reliably. There are still some xlna gain tables missing that ath9k has; I'll follow up with some fixes and then see if the QCAFN222 NIC I have tests this path. Tested: * QCAFN222 NIC, STA mode, 2GHz and 5GHz Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun 5 02:16:16 2016 (r301420) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun 5 02:17:51 2016 (r301421) @@ -38,7 +38,9 @@ #include "ar9300/ar9485.ini" #include "ar9300/ar9485_1_1.ini" #include "ar9300/ar9300_jupiter10.ini" +/* TODO: convert the 2.0 code to use the new initvals from ath9k */ #include "ar9300/ar9300_jupiter20.ini" +#include "ar9300/ar9462_2p0_initvals.h" #include "ar9300/ar9462_2p1_initvals.h" #include "ar9300/ar9580.ini" #include "ar9300/ar955x.ini" @@ -1676,10 +1678,11 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC ar9300_jupiter_1p0_baseband_core_txfir_coeff_japan_2484), 2); } - else if (AR_SREV_JUPITER_20(ah)) { + else if (AR_SREV_JUPITER_20_OR_LATER(ah)) { /* Jupiter: new INI format (pre, core, post arrays per subsystem) */ /* FreeBSD: just override the registers for jupiter 2.1 */ + /* XXX TODO: refactor this stuff out; reinit all the 2.1 registers */ /* mac */ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_PRE], NULL, 0, 0); @@ -2923,6 +2926,7 @@ ar9300_fill_capability_info(struct ath_h p_cap->halMciSupport = AH_FALSE; } + /* XXX TODO: jupiter 2.1? */ if (AR_SREV_JUPITER_20(ah)) { p_cap->halRadioRetentionSupport = AH_TRUE; } else { @@ -3533,13 +3537,19 @@ void ar9300_rx_gain_table_apply(struct a ar9300_common_mixed_rx_gain_table_jupiter_1p0, ARRAY_LENGTH(ar9300_common_mixed_rx_gain_table_jupiter_1p0), 2); break; - } + } else if (AR_SREV_JUPITER_20(ah)) { INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, ar9300Common_mixed_rx_gain_table_jupiter_2p0, ARRAY_LENGTH(ar9300Common_mixed_rx_gain_table_jupiter_2p0), 2); break; } + else if (AR_SREV_JUPITER_21(ah)) { + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, + ar9462_2p1_common_mixed_rx_gain, + ARRAY_LENGTH(ar9462_2p1_common_mixed_rx_gain), 2); + break; + } case 0: default: if (AR_SREV_HORNET_12(ah)) { @@ -3583,6 +3593,10 @@ void ar9300_rx_gain_table_apply(struct a INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, ar9300Common_rx_gain_table_jupiter_2p0, ARRAY_LENGTH(ar9300Common_rx_gain_table_jupiter_2p0), 2); + } else if (AR_SREV_JUPITER_21(ah)) { + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, + ar9462_2p1_common_rx_gain, + ARRAY_LENGTH(ar9462_2p1_common_rx_gain), 2); } else if (AR_SREV_AR9580(ah)) { INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, ar9300_common_rx_gain_table_ar9580_1p0, @@ -3638,6 +3652,11 @@ void ar9300_rx_gain_table_apply(struct a ar9300Common_wo_xlna_rx_gain_table_jupiter_2p0, ARRAY_LENGTH(ar9300Common_wo_xlna_rx_gain_table_jupiter_2p0), 2); + } else if (AR_SREV_JUPITER_21(ah)) { + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, + ar9462_2p1_common_wo_xlna_rx_gain, + ARRAY_LENGTH(ar9462_2p1_common_wo_xlna_rx_gain), + 2); } else if (AR_SREV_APHRODITE(ah)) { INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, ar956XCommon_wo_xlna_rx_gain_table_aphrodite_1p0, @@ -3718,11 +3737,16 @@ void ar9300_tx_gain_table_apply(struct a ar9300_modes_low_ob_db_tx_gain_table_jupiter_1p0, ARRAY_LENGTH(ar9300_modes_low_ob_db_tx_gain_table_jupiter_1p0), 5); - } else if (AR_SREV_JUPITER_20(ah)) { + } else if (AR_SREV_JUPITER_20(ah)) { INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain, ar9300Modes_low_ob_db_tx_gain_table_jupiter_2p0, ARRAY_LENGTH(ar9300Modes_low_ob_db_tx_gain_table_jupiter_2p0), 5); + } else if (AR_SREV_JUPITER_21(ah)) { + INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain, + ar9462_2p1_modes_low_ob_db_tx_gain, + ARRAY_LENGTH(ar9462_2p1_modes_low_ob_db_tx_gain), + 5); } else if (AR_SREV_HONEYBEE(ah)) { INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain, qca953xModes_xpa_tx_gain_table_honeybee_1p0, @@ -3780,6 +3804,11 @@ void ar9300_tx_gain_table_apply(struct a ar9300Modes_high_ob_db_tx_gain_table_jupiter_2p0, ARRAY_LENGTH( ar9300Modes_high_ob_db_tx_gain_table_jupiter_2p0), 5); + } else if (AR_SREV_JUPITER_21(ah)) { + INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain, + ar9462_2p1_modes_high_ob_db_tx_gain, + ARRAY_LENGTH( + ar9462_2p1_modes_high_ob_db_tx_gain), 5); } else if (AR_SREV_APHRODITE(ah)) { INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain, ar956XModes_high_ob_db_tx_gain_table_aphrodite_1p0, From owner-svn-src-all@freebsd.org Sun Jun 5 05:49:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E35B692AB; Sun, 5 Jun 2016 05:49:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC39D105E; Sun, 5 Jun 2016 05:49:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u555nZae033604; Sun, 5 Jun 2016 05:49:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u555nYW8033594; Sun, 5 Jun 2016 05:49:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050549.u555nYW8033594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 05:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301422 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 05:49:36 -0000 Author: dchagin Date: Sun Jun 5 05:49:33 2016 New Revision: 301422 URL: https://svnweb.freebsd.org/changeset/base/301422 Log: MFC r300359, r300360: Correct an argument param of linux_sched_* system calls as a struct l_sched_param does not defined due to it's nature. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_systrace_args.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux/linux_proto.h Sun Jun 5 05:49:33 2016 (r301422) @@ -524,16 +524,16 @@ struct linux_getpriority_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sun Jun 5 05:49:33 2016 (r301422) @@ -1178,7 +1178,7 @@ systrace_args(int sysnum, void *params, case 142: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1186,7 +1186,7 @@ systrace_args(int sysnum, void *params, case 143: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1195,7 +1195,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -4209,7 +4209,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4222,7 +4222,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4238,7 +4238,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux/syscalls.master Sun Jun 5 05:49:33 2016 (r301422) @@ -283,12 +283,12 @@ 141 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ int prio); } 142 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 143 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 144 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 145 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 146 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max( \ Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sun Jun 5 05:49:33 2016 (r301422) @@ -480,16 +480,16 @@ struct linux_sysctl_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sun Jun 5 05:49:33 2016 (r301422) @@ -1047,7 +1047,7 @@ systrace_args(int sysnum, void *params, case 154: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1055,7 +1055,7 @@ systrace_args(int sysnum, void *params, case 155: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1064,7 +1064,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -3938,7 +3938,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -3951,7 +3951,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -3967,7 +3967,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/amd64/linux32/syscalls.master Sun Jun 5 05:49:33 2016 (r301422) @@ -268,12 +268,12 @@ 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } 154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 158 AUE_NULL NOPROTO { int sched_yield(void); } Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/i386/linux/linux_proto.h Sun Jun 5 05:49:33 2016 (r301422) @@ -478,16 +478,16 @@ struct linux_sysctl_args { }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct linux_sched_getscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sun Jun 5 05:49:33 2016 (r301422) @@ -1085,7 +1085,7 @@ systrace_args(int sysnum, void *params, case 154: { struct linux_sched_setparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1093,7 +1093,7 @@ systrace_args(int sysnum, void *params, case 155: { struct linux_sched_getparam_args *p = params; iarg[0] = p->pid; /* l_pid_t */ - uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[1] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1102,7 +1102,7 @@ systrace_args(int sysnum, void *params, struct linux_sched_setscheduler_args *p = params; iarg[0] = p->pid; /* l_pid_t */ iarg[1] = p->policy; /* l_int */ - uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */ + uarg[2] = (intptr_t) p->param; /* struct sched_param * */ *n_args = 3; break; } @@ -4072,7 +4072,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4085,7 +4085,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_pid_t"; break; case 1: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; @@ -4101,7 +4101,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 2: - p = "struct l_sched_param *"; + p = "struct sched_param *"; break; default: break; Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sun Jun 5 02:17:51 2016 (r301421) +++ stable/10/sys/i386/linux/syscalls.master Sun Jun 5 05:49:33 2016 (r301422) @@ -270,12 +270,12 @@ 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } 154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct l_sched_param *param); } + struct sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ - struct l_sched_param *param); } + struct sched_param *param); } 157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ l_pid_t pid); } 158 AUE_NULL NOPROTO { int sched_yield(void); } From owner-svn-src-all@freebsd.org Sun Jun 5 05:55:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22933B6942F; Sun, 5 Jun 2016 05:55:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4B221456; Sun, 5 Jun 2016 05:55:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u555tRDm037071; Sun, 5 Jun 2016 05:55:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u555tR6V037068; Sun, 5 Jun 2016 05:55:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050555.u555tR6V037068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 05:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301423 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 05:55:29 -0000 Author: adrian Date: Sun Jun 5 05:55:27 2016 New Revision: 301423 URL: https://svnweb.freebsd.org/changeset/base/301423 Log: [ath_hal] add AR9462 (jupiter) RX gain / XLNA programming. This seems to make 5G work better. It doesn't fix powersave handling though, that still sees the PHY get stuck during initial calibration and everything goes pear shaped. I'll look into that later. Tested: * QCAFN222 NIC, STA mode, 5GHz Obtained from: Linux ath9k Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sun Jun 5 05:49:33 2016 (r301422) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sun Jun 5 05:55:27 2016 (r301423) @@ -635,6 +635,10 @@ struct ath_hal_9300 { struct ar9300_ini_array ah_ini_japan2484; struct ar9300_ini_array ah_ini_radio_post_sys2ant; struct ar9300_ini_array ah_ini_BTCOEX_MAX_TXPWR; + struct ar9300_ini_array ah_ini_modes_rxgain_xlna; + struct ar9300_ini_array ah_ini_modes_rxgain_bb_core; + struct ar9300_ini_array ah_ini_modes_rxgain_bb_postamble; + /* * New INI format starting with Osprey 2.0 INI. * Pre, core, post arrays for each sub-system (mac, bb, radio, soc) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun 5 05:49:33 2016 (r301422) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun 5 05:55:27 2016 (r301423) @@ -3542,14 +3542,50 @@ void ar9300_rx_gain_table_apply(struct a INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, ar9300Common_mixed_rx_gain_table_jupiter_2p0, ARRAY_LENGTH(ar9300Common_mixed_rx_gain_table_jupiter_2p0), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_core, + ar9462_2p0_baseband_core_mix_rxgain, + ARRAY_LENGTH(ar9462_2p0_baseband_core_mix_rxgain), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_postamble, + ar9462_2p0_baseband_postamble_mix_rxgain, + ARRAY_LENGTH(ar9462_2p0_baseband_postamble_mix_rxgain), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna, + ar9462_2p0_baseband_postamble_5g_xlna, + ARRAY_LENGTH(ar9462_2p0_baseband_postamble_5g_xlna), 2); break; } else if (AR_SREV_JUPITER_21(ah)) { INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, ar9462_2p1_common_mixed_rx_gain, ARRAY_LENGTH(ar9462_2p1_common_mixed_rx_gain), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_core, + ar9462_2p1_baseband_core_mix_rxgain, + ARRAY_LENGTH(ar9462_2p1_baseband_core_mix_rxgain), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_postamble, + ar9462_2p1_baseband_postamble_mix_rxgain, + ARRAY_LENGTH(ar9462_2p1_baseband_postamble_mix_rxgain), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna, + ar9462_2p1_baseband_postamble_5g_xlna, + ARRAY_LENGTH(ar9462_2p1_baseband_postamble_5g_xlna), 2); + break; } + case 3: + if (AR_SREV_JUPITER_21(ah)) { + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, + ar9462_2p1_common_5g_xlna_only_rxgain, + ARRAY_LENGTH(ar9462_2p1_common_5g_xlna_only_rxgain), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna, + ar9462_2p1_baseband_postamble_5g_xlna, + ARRAY_LENGTH(ar9462_2p1_baseband_postamble_5g_xlna), 2); + } else if (AR_SREV_JUPITER_20(ah)) { + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, + ar9462_2p0_common_5g_xlna_only_rxgain, + ARRAY_LENGTH(ar9462_2p0_common_5g_xlna_only_rxgain), 2); + INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna, + ar9462_2p0_baseband_postamble_5g_xlna, + ARRAY_LENGTH(ar9462_2p0_baseband_postamble_5g_xlna), 2); + } + break; case 0: default: if (AR_SREV_HORNET_12(ah)) { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sun Jun 5 05:49:33 2016 (r301422) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sun Jun 5 05:55:27 2016 (r301423) @@ -3053,6 +3053,26 @@ ar9300_process_ini(struct ath_hal *ah, s REG_WRITE_ARRAY(&ahp->ah_ini_modes_rxgain, 1, reg_writes); HALDEBUG(ah, HAL_DEBUG_RESET, "ar9300_process_ini: Rx Gain programming\n"); + if (AR_SREV_JUPITER_20_OR_LATER(ah)) { + /* + * CUS217 mix LNA mode. + */ + if (ar9300_rx_gain_index_get(ah) == 2) { + REG_WRITE_ARRAY(&ahp->ah_ini_modes_rxgain_bb_core, 1, reg_writes); + REG_WRITE_ARRAY(&ahp->ah_ini_modes_rxgain_bb_postamble, + modes_index, reg_writes); + } + + /* + * 5G-XLNA + */ + if ((ar9300_rx_gain_index_get(ah) == 2) || + (ar9300_rx_gain_index_get(ah) == 3)) { + REG_WRITE_ARRAY(&ahp->ah_ini_modes_rxgain_xlna, modes_index, + reg_writes); + } + } + if (AR_SREV_SCORPION(ah)) { /* Write rxgain bounds Array */ REG_WRITE_ARRAY(&ahp->ah_ini_modes_rxgain_bounds, modes_index, reg_writes); From owner-svn-src-all@freebsd.org Sun Jun 5 06:02:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C97F1B695DC; Sun, 5 Jun 2016 06:02:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A90D19B9; Sun, 5 Jun 2016 06:02:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5562bpc040823; Sun, 5 Jun 2016 06:02:37 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5562bhg040822; Sun, 5 Jun 2016 06:02:37 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050602.u5562bhg040822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 06:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301424 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 06:02:38 -0000 Author: dchagin Date: Sun Jun 5 06:02:37 2016 New Revision: 301424 URL: https://svnweb.freebsd.org/changeset/base/301424 Log: MFC r300411: Minor style(9) cleanup, no functional changes. Modified: stable/10/sys/compat/linux/linux_file.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sun Jun 5 05:55:27 2016 (r301423) +++ stable/10/sys/compat/linux/linux_file.c Sun Jun 5 06:02:37 2016 (r301424) @@ -69,108 +69,106 @@ __FBSDID("$FreeBSD$"); int linux_creat(struct thread *td, struct linux_creat_args *args) { - char *path; - int error; - - LCONVPATHEXIST(td, args->path, &path); + char *path; + int error; + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(creat)) printf(ARGS(creat, "%s, %d"), path, args->mode); #endif - error = kern_open(td, path, UIO_SYSSPACE, O_WRONLY | O_CREAT | O_TRUNC, - args->mode); - LFREEPATH(path); - return (error); + error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, + O_WRONLY | O_CREAT | O_TRUNC, args->mode); + LFREEPATH(path); + return (error); } static int linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) { - cap_rights_t rights; - struct proc *p = td->td_proc; - struct file *fp; - int fd; - int bsd_flags, error; - - bsd_flags = 0; - switch (l_flags & LINUX_O_ACCMODE) { - case LINUX_O_WRONLY: - bsd_flags |= O_WRONLY; - break; - case LINUX_O_RDWR: - bsd_flags |= O_RDWR; - break; - default: - bsd_flags |= O_RDONLY; - } - if (l_flags & LINUX_O_NDELAY) - bsd_flags |= O_NONBLOCK; - if (l_flags & LINUX_O_APPEND) - bsd_flags |= O_APPEND; - if (l_flags & LINUX_O_SYNC) - bsd_flags |= O_FSYNC; - if (l_flags & LINUX_O_NONBLOCK) - bsd_flags |= O_NONBLOCK; - if (l_flags & LINUX_FASYNC) - bsd_flags |= O_ASYNC; - if (l_flags & LINUX_O_CREAT) - bsd_flags |= O_CREAT; - if (l_flags & LINUX_O_TRUNC) - bsd_flags |= O_TRUNC; - if (l_flags & LINUX_O_EXCL) - bsd_flags |= O_EXCL; - if (l_flags & LINUX_O_NOCTTY) - bsd_flags |= O_NOCTTY; - if (l_flags & LINUX_O_DIRECT) - bsd_flags |= O_DIRECT; - if (l_flags & LINUX_O_NOFOLLOW) - bsd_flags |= O_NOFOLLOW; - if (l_flags & LINUX_O_DIRECTORY) - bsd_flags |= O_DIRECTORY; - /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ - - error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); - if (error != 0) - goto done; - - if (bsd_flags & O_NOCTTY) - goto done; - - /* - * XXX In between kern_open() and fget(), another process - * having the same filedesc could use that fd without - * checking below. - */ - fd = td->td_retval[0]; - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { - if (fp->f_type != DTYPE_VNODE) { - fdrop(fp, td); - goto done; - } - sx_slock(&proctree_lock); - PROC_LOCK(p); - if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { - PROC_UNLOCK(p); - sx_sunlock(&proctree_lock); - /* XXXPJD: Verify if TIOCSCTTY is allowed. */ - (void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, - td->td_ucred, td); - } else { - PROC_UNLOCK(p); - sx_sunlock(&proctree_lock); - } - fdrop(fp, td); - } + cap_rights_t rights; + struct proc *p = td->td_proc; + struct file *fp; + int fd; + int bsd_flags, error; + + bsd_flags = 0; + switch (l_flags & LINUX_O_ACCMODE) { + case LINUX_O_WRONLY: + bsd_flags |= O_WRONLY; + break; + case LINUX_O_RDWR: + bsd_flags |= O_RDWR; + break; + default: + bsd_flags |= O_RDONLY; + } + if (l_flags & LINUX_O_NDELAY) + bsd_flags |= O_NONBLOCK; + if (l_flags & LINUX_O_APPEND) + bsd_flags |= O_APPEND; + if (l_flags & LINUX_O_SYNC) + bsd_flags |= O_FSYNC; + if (l_flags & LINUX_O_NONBLOCK) + bsd_flags |= O_NONBLOCK; + if (l_flags & LINUX_FASYNC) + bsd_flags |= O_ASYNC; + if (l_flags & LINUX_O_CREAT) + bsd_flags |= O_CREAT; + if (l_flags & LINUX_O_TRUNC) + bsd_flags |= O_TRUNC; + if (l_flags & LINUX_O_EXCL) + bsd_flags |= O_EXCL; + if (l_flags & LINUX_O_NOCTTY) + bsd_flags |= O_NOCTTY; + if (l_flags & LINUX_O_DIRECT) + bsd_flags |= O_DIRECT; + if (l_flags & LINUX_O_NOFOLLOW) + bsd_flags |= O_NOFOLLOW; + if (l_flags & LINUX_O_DIRECTORY) + bsd_flags |= O_DIRECTORY; + /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ + + error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); + if (error != 0) + goto done; + if (bsd_flags & O_NOCTTY) + goto done; + + /* + * XXX In between kern_open() and fget(), another process + * having the same filedesc could use that fd without + * checking below. + */ + fd = td->td_retval[0]; + if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { + if (fp->f_type != DTYPE_VNODE) { + fdrop(fp, td); + goto done; + } + sx_slock(&proctree_lock); + PROC_LOCK(p); + if (SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + PROC_UNLOCK(p); + sx_sunlock(&proctree_lock); + /* XXXPJD: Verify if TIOCSCTTY is allowed. */ + (void) fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, + td->td_ucred, td); + } else { + PROC_UNLOCK(p); + sx_sunlock(&proctree_lock); + } + fdrop(fp, td); + } done: #ifdef DEBUG - if (ldebug(open)) - printf(LMSG("open returns error %d"), error); + if (ldebug(open)) + printf(LMSG("open returns error %d"), error); #endif - LFREEPATH(path); - return (error); + LFREEPATH(path); + return (error); } int @@ -195,44 +193,41 @@ linux_openat(struct thread *td, struct l int linux_open(struct thread *td, struct linux_open_args *args) { - char *path; - - if (args->flags & LINUX_O_CREAT) - LCONVPATHCREAT(td, args->path, &path); - else - LCONVPATHEXIST(td, args->path, &path); + char *path; + if (args->flags & LINUX_O_CREAT) + LCONVPATHCREAT(td, args->path, &path); + else + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(open)) printf(ARGS(open, "%s, 0x%x, 0x%x"), path, args->flags, args->mode); #endif - return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode)); } int linux_lseek(struct thread *td, struct linux_lseek_args *args) { - - struct lseek_args /* { - int fd; - int pad; - off_t offset; - int whence; - } */ tmp_args; - int error; + struct lseek_args /* { + int fd; + int pad; + off_t offset; + int whence; + } */ tmp_args; + int error; #ifdef DEBUG if (ldebug(lseek)) printf(ARGS(lseek, "%d, %ld, %d"), args->fdes, (long)args->off, args->whence); #endif - tmp_args.fd = args->fdes; - tmp_args.offset = (off_t)args->off; - tmp_args.whence = args->whence; - error = sys_lseek(td, &tmp_args); - return error; + tmp_args.fd = args->fdes; + tmp_args.offset = (off_t)args->off; + tmp_args.whence = args->whence; + error = sys_lseek(td, &tmp_args); + return (error); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) @@ -255,13 +250,13 @@ linux_llseek(struct thread *td, struct l bsd_args.whence = args->whence; if ((error = sys_lseek(td, &bsd_args))) - return error; + return (error); if ((error = copyout(td->td_retval, args->res, sizeof (off_t)))) - return error; + return (error); td->td_retval[0] = 0; - return 0; + return (0); } int @@ -272,7 +267,7 @@ linux_readdir(struct thread *td, struct lda.fd = args->fd; lda.dent = args->dent; lda.count = 1; - return linux_getdents(td, &lda); + return (linux_getdents(td, &lda)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -945,7 +940,7 @@ linux_ftruncate(struct thread *td, struc int pad; off_t length; } */ nuap; - + nuap.fd = args->fd; nuap.length = args->length; return (sys_ftruncate(td, &nuap)); @@ -1016,7 +1011,7 @@ linux_fdatasync(td, uap) struct fsync_args bsd; bsd.fd = uap->fd; - return sys_fsync(td, &bsd); + return (sys_fsync(td, &bsd)); } int @@ -1033,9 +1028,7 @@ linux_pread(td, uap) bsd.buf = uap->buf; bsd.nbyte = uap->nbyte; bsd.offset = uap->offset; - error = sys_pread(td, &bsd); - if (error == 0) { /* This seems to violate POSIX but linux does it */ error = fgetvp(td, uap->fd, @@ -1048,7 +1041,6 @@ linux_pread(td, uap) } vrele(vp); } - return (error); } @@ -1063,7 +1055,7 @@ linux_pwrite(td, uap) bsd.buf = uap->buf; bsd.nbyte = uap->nbyte; bsd.offset = uap->offset; - return sys_pwrite(td, &bsd); + return (sys_pwrite(td, &bsd)); } int From owner-svn-src-all@freebsd.org Sun Jun 5 06:04:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A2FB69695; Sun, 5 Jun 2016 06:04:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6868E1B34; Sun, 5 Jun 2016 06:04:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5564P5E040971; Sun, 5 Jun 2016 06:04:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5564P7B040970; Sun, 5 Jun 2016 06:04:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050604.u5564P7B040970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 06:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301425 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 06:04:26 -0000 Author: dchagin Date: Sun Jun 5 06:04:25 2016 New Revision: 301425 URL: https://svnweb.freebsd.org/changeset/base/301425 Log: MFC r300412: Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup while here. Modified: stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:02:37 2016 (r301424) +++ stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:04:25 2016 (r301425) @@ -1,7 +1,9 @@ /* $NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $ */ /*- - * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. + * Copyright (c) 2009-2016 Dmitry Chagin + * Copyright (c) 2005 Emmanuel Dreyfus + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -605,7 +607,7 @@ futex_atomic_op(struct thread *td, int e LIN_SDT_PROBE4(futex, futex_atomic_op, decoded_op, op, cmp, oparg, cmparg); - + /* XXX: Linux verifies access here and returns EFAULT */ LIN_SDT_PROBE0(futex, futex_atomic_op, missing_access_check); @@ -997,7 +999,6 @@ linux_sys_futex(struct thread *td, struc return (ENOSYS); case LINUX_FUTEX_REQUEUE: - /* * Glibc does not use this operation since version 2.3.3, * as it is racy and replaced by FUTEX_CMP_REQUEUE operation. From owner-svn-src-all@freebsd.org Sun Jun 5 06:06:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB238B6972C; Sun, 5 Jun 2016 06:06:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 942D81CC4; Sun, 5 Jun 2016 06:06:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5566tM7041142; Sun, 5 Jun 2016 06:06:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5566tYK041141; Sun, 5 Jun 2016 06:06:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050606.u5566tYK041141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 06:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301426 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 06:06:56 -0000 Author: dchagin Date: Sun Jun 5 06:06:55 2016 New Revision: 301426 URL: https://svnweb.freebsd.org/changeset/base/301426 Log: MFC r300413: Due to lack the priority propagation feature replace sx by mutex. WIth this commit NPTL tests are ends in 1 minute faster. MFC r300414: For future use move futex timeout code to the separate function and switch to the high resolution sbintime_t. Modified: stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:04:25 2016 (r301425) +++ stable/10/sys/compat/linux/linux_futex.c Sun Jun 5 06:06:55 2016 (r301426) @@ -55,9 +55,10 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include -#include #include +#include + #ifdef COMPAT_LINUX32 #include #include @@ -109,7 +110,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_get, LIN_SDT_PROBE_DEFINE0(futex, futex_get, error); LIN_SDT_PROBE_DEFINE1(futex, futex_get, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, entry, "struct futex *", - "struct waiting_proc **", "int"); + "struct waiting_proc **", "struct timespec *"); LIN_SDT_PROBE_DEFINE5(futex, futex_sleep, requeue_error, "int", "uint32_t *", "struct waiting_proc *", "uint32_t *", "uint32_t"); LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, sleep_error, "int", "uint32_t *", @@ -128,7 +129,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_reque "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_wait, entry, "struct futex *", - "struct waiting_proc **", "int", "uint32_t"); + "struct waiting_proc **", "struct timespec *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_atomic_op, entry, "struct thread *", @@ -142,7 +143,6 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_atomi LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, entry, "struct thread *", "struct linux_sys_futex_args *"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); -LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, itimerfix_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", @@ -197,7 +197,7 @@ struct waiting_proc { }; struct futex { - struct sx f_lck; + struct mtx f_lck; uint32_t *f_uaddr; /* user-supplied value, for debug */ struct umtx_key f_key; uint32_t f_refcount; @@ -208,20 +208,22 @@ struct futex { struct futex_list futex_list; -#define FUTEX_LOCK(f) sx_xlock(&(f)->f_lck) -#define FUTEX_UNLOCK(f) sx_xunlock(&(f)->f_lck) +#define FUTEX_LOCK(f) mtx_lock(&(f)->f_lck) +#define FUTEX_LOCKED(f) mtx_owned(&(f)->f_lck) +#define FUTEX_UNLOCK(f) mtx_unlock(&(f)->f_lck) #define FUTEX_INIT(f) do { \ - sx_init_flags(&(f)->f_lck, "ftlk", \ - SX_DUPOK); \ + mtx_init(&(f)->f_lck, "ftlk", NULL, \ + MTX_DUPOK); \ LIN_SDT_PROBE1(futex, futex, create, \ &(f)->f_lck); \ } while (0) #define FUTEX_DESTROY(f) do { \ LIN_SDT_PROBE1(futex, futex, destroy, \ &(f)->f_lck); \ - sx_destroy(&(f)->f_lck); \ + mtx_destroy(&(f)->f_lck); \ } while (0) -#define FUTEX_ASSERT_LOCKED(f) sx_assert(&(f)->f_lck, SA_XLOCKED) +#define FUTEX_ASSERT_LOCKED(f) mtx_assert(&(f)->f_lck, MA_OWNED) +#define FUTEX_ASSERT_UNLOCKED(f) mtx_assert(&(f)->f_lck, MA_NOTOWNED) struct mtx futex_mtx; /* protects the futex list */ #define FUTEXES_LOCK do { \ @@ -240,6 +242,7 @@ struct mtx futex_mtx; /* protects the #define FUTEX_DONTCREATE 0x2 /* don't create futex if not exists */ #define FUTEX_DONTEXISTS 0x4 /* return EINVAL if futex exists */ #define FUTEX_SHARED 0x8 /* shared futex */ +#define FUTEX_DONTLOCK 0x10 /* don't lock futex */ /* wp_flags */ #define FUTEX_WP_REQUEUED 0x1 /* wp requeued - wp moved from wp_list @@ -254,11 +257,15 @@ static void futex_put(struct futex *, st static int futex_get0(uint32_t *, struct futex **f, uint32_t); static int futex_get(uint32_t *, struct waiting_proc **, struct futex **, uint32_t); -static int futex_sleep(struct futex *, struct waiting_proc *, int); +static int futex_sleep(struct futex *, struct waiting_proc *, struct timespec *); static int futex_wake(struct futex *, int, uint32_t); static int futex_requeue(struct futex *, int, struct futex *, int); -static int futex_wait(struct futex *, struct waiting_proc *, int, +static int futex_copyin_timeout(int, struct l_timespec *, int, + struct timespec *); +static int futex_wait(struct futex *, struct waiting_proc *, struct timespec *, uint32_t); +static void futex_lock(struct futex *); +static void futex_unlock(struct futex *); static int futex_atomic_op(struct thread *, int, uint32_t *); static int handle_futex_death(struct linux_emuldata *, uint32_t *, unsigned int); @@ -273,12 +280,39 @@ int futex_andl(int oparg, uint32_t *uadd int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); +static int +futex_copyin_timeout(int op, struct l_timespec *luts, int clockrt, + struct timespec *ts) +{ + struct l_timespec lts; + struct timespec kts; + int error; + + error = copyin(luts, <s, sizeof(lts)); + if (error) + return (error); + + error = linux_to_native_timespec(ts, <s); + if (error) + return (error); + if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000) + return (EINVAL); + + if (clockrt) { + nanotime(&kts); + timespecsub(ts, &kts); + } else if (op == LINUX_FUTEX_WAIT_BITSET) { + nanouptime(&kts); + timespecsub(ts, &kts); + } + return (error); +} + static void futex_put(struct futex *f, struct waiting_proc *wp) { LIN_SDT_PROBE2(futex, futex_put, entry, f, wp); - FUTEX_ASSERT_LOCKED(f); if (wp != NULL) { if ((wp->wp_flags & FUTEX_WP_REMOVED) == 0) TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list); @@ -289,7 +323,8 @@ futex_put(struct futex *f, struct waitin if (--f->f_refcount == 0) { LIST_REMOVE(f, f_list); FUTEXES_UNLOCK; - FUTEX_UNLOCK(f); + if (FUTEX_LOCKED(f)) + futex_unlock(f); LIN_SDT_PROBE3(futex, futex_put, destroy, f->f_uaddr, f->f_refcount, f->f_key.shared); @@ -308,7 +343,8 @@ futex_put(struct futex *f, struct waitin LINUX_CTR3(sys_futex, "futex_put uaddr %p ref %d shared %d", f->f_uaddr, f->f_refcount, f->f_key.shared); FUTEXES_UNLOCK; - FUTEX_UNLOCK(f); + if (FUTEX_LOCKED(f)) + futex_unlock(f); LIN_SDT_PROBE0(futex, futex_put, return); } @@ -336,7 +372,8 @@ retry: LIST_FOREACH(f, &futex_list, f_list) { if (umtx_key_match(&f->f_key, &key)) { if (tmpf != NULL) { - FUTEX_UNLOCK(tmpf); + if (FUTEX_LOCKED(tmpf)) + futex_unlock(tmpf); FUTEX_DESTROY(tmpf); free(tmpf, M_FUTEX); } @@ -357,7 +394,8 @@ retry: FUTEXES_UNLOCK; umtx_key_release(&key); - FUTEX_LOCK(f); + if ((flags & FUTEX_DONTLOCK) == 0) + futex_lock(f); *newf = f; LIN_SDT_PROBE3(futex, futex_get0, shared, uaddr, f->f_refcount, f->f_key.shared); @@ -393,7 +431,8 @@ retry: * Lock the new futex before an insert into the futex_list * to prevent futex usage by other. */ - FUTEX_LOCK(tmpf); + if ((flags & FUTEX_DONTLOCK) == 0) + futex_lock(tmpf); goto retry; } @@ -441,16 +480,56 @@ futex_get(uint32_t *uaddr, struct waitin return (error); } +static inline void +futex_lock(struct futex *f) +{ + + LINUX_CTR3(sys_futex, "futex_lock uaddr %p ref %d shared %d", + f->f_uaddr, f->f_refcount, f->f_key.shared); + FUTEX_ASSERT_UNLOCKED(f); + FUTEX_LOCK(f); +} + +static inline void +futex_unlock(struct futex *f) +{ + + LINUX_CTR3(sys_futex, "futex_unlock uaddr %p ref %d shared %d", + f->f_uaddr, f->f_refcount, f->f_key.shared); + FUTEX_ASSERT_LOCKED(f); + FUTEX_UNLOCK(f); +} + static int -futex_sleep(struct futex *f, struct waiting_proc *wp, int timeout) +futex_sleep(struct futex *f, struct waiting_proc *wp, struct timespec *ts) { + struct timespec uts; + sbintime_t sbt, prec, tmp; + time_t over; int error; FUTEX_ASSERT_LOCKED(f); - LIN_SDT_PROBE3(futex, futex_sleep, entry, f, wp, timeout); - LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %d ref %d", - f->f_uaddr, wp, timeout, f->f_refcount); - error = sx_sleep(wp, &f->f_lck, PCATCH, "futex", timeout); + if (ts != NULL) { + uts = *ts; + if (uts.tv_sec > INT32_MAX / 2) { + over = uts.tv_sec - INT32_MAX / 2; + uts.tv_sec -= over; + } + tmp = tstosbt(uts); + if (TIMESEL(&sbt, tmp)) + sbt += tc_tick_sbt; + sbt += tmp; + prec = tmp; + prec >>= tc_precexp; + } else { + sbt = 0; + prec = 0; + } + LIN_SDT_PROBE3(futex, futex_sleep, entry, f, wp, sbt); + LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %ld ref %d", + f->f_uaddr, wp, sbt, f->f_refcount); + + error = msleep_sbt(wp, &f->f_lck, PCATCH, "futex", sbt, prec, C_ABSOLUTE); if (wp->wp_flags & FUTEX_WP_REQUEUED) { KASSERT(f != wp->wp_futex, ("futex != wp_futex")); @@ -466,7 +545,7 @@ futex_sleep(struct futex *f, struct wait wp->wp_futex->f_refcount); futex_put(f, NULL); f = wp->wp_futex; - FUTEX_LOCK(f); + futex_lock(f); } else { if (error) { LIN_SDT_PROBE3(futex, futex_sleep, sleep_error, error, @@ -568,12 +647,12 @@ futex_requeue(struct futex *f, int n, st } static int -futex_wait(struct futex *f, struct waiting_proc *wp, int timeout_hz, +futex_wait(struct futex *f, struct waiting_proc *wp, struct timespec *ts, uint32_t bitset) { int error; - LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, timeout_hz, bitset); + LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, ts, bitset); if (bitset == 0) { LIN_SDT_PROBE1(futex, futex_wait, return, EINVAL); @@ -581,7 +660,7 @@ futex_wait(struct futex *f, struct waiti } f->f_bitset = bitset; - error = futex_sleep(f, wp, timeout_hz); + error = futex_sleep(f, wp, ts); if (error) LIN_SDT_PROBE1(futex, futex_wait, sleep_error, error); if (error == EWOULDBLOCK) @@ -673,11 +752,8 @@ linux_sys_futex(struct thread *td, struc struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; - struct l_timespec ltimeout; - struct timespec timeout; - struct timeval utv, ctv; - int timeout_hz; - int error; + struct timespec uts, *ts; + int error, save; uint32_t flags, val; LIN_SDT_PROBE2(futex, linux_sys_futex, entry, td, args); @@ -719,37 +795,19 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->val3); if (args->timeout != NULL) { - error = copyin(args->timeout, <imeout, sizeof(ltimeout)); + error = futex_copyin_timeout(args->op, args->timeout, + clockrt, &uts); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } - error = linux_to_native_timespec(&timeout, <imeout); - if (error) - return (error); - TIMESPEC_TO_TIMEVAL(&utv, &timeout); - error = itimerfix(&utv); - if (error) { - LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error, - error); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); - return (error); - } - if (clockrt) { - microtime(&ctv); - timevalsub(&utv, &ctv); - } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { - microuptime(&ctv); - timevalsub(&utv, &ctv); - } - if (utv.tv_sec < 0) - timevalclear(&utv); - timeout_hz = tvtohz(&utv); + ts = &uts; } else - timeout_hz = 0; + ts = NULL; +retry0: error = futex_get(args->uaddr, &wp, &f, flags | FUTEX_CREATE_WP); if (error) { @@ -757,14 +815,16 @@ linux_sys_futex(struct thread *td, struc return (error); } - error = copyin(args->uaddr, &val, sizeof(val)); + error = copyin_nofault(args->uaddr, &val, sizeof(val)); if (error) { + futex_put(f, wp); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry0; LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LINUX_CTR1(sys_futex, "WAIT copyin failed %d", error); - futex_put(f, wp); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } @@ -782,7 +842,7 @@ linux_sys_futex(struct thread *td, struc return (EWOULDBLOCK); } - error = futex_wait(f, wp, timeout_hz, args->val3); + error = futex_wait(f, wp, ts, args->val3); break; case LINUX_FUTEX_WAKE: @@ -832,7 +892,8 @@ linux_sys_futex(struct thread *td, struc return (EINVAL); } - error = futex_get(args->uaddr, NULL, &f, flags); +retry1: + error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); @@ -846,22 +907,26 @@ linux_sys_futex(struct thread *td, struc * returned by FUTEX_CMP_REQUEUE. */ error = futex_get(args->uaddr2, NULL, &f2, - flags | FUTEX_DONTEXISTS); + flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } - error = copyin(args->uaddr, &val, sizeof(val)); + futex_lock(f); + futex_lock(f2); + error = copyin_nofault(args->uaddr, &val, sizeof(val)); if (error) { + futex_put(f2, NULL); + futex_put(f, NULL); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry1; LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, error); LINUX_CTR1(sys_futex, "CMP_REQUEUE copyin failed %d", error); - futex_put(f2, NULL); - futex_put(f, NULL); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } @@ -891,50 +956,45 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->uaddr2, args->val3, args->timeout); - error = futex_get(args->uaddr, NULL, &f, flags); +retry2: + error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) { LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } if (args->uaddr != args->uaddr2) - error = futex_get(args->uaddr2, NULL, &f2, flags); + error = futex_get(args->uaddr2, NULL, &f2, + flags | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); return (error); } + futex_lock(f); + futex_lock(f2); /* * This function returns positive number as results and * negative as errors */ + save = vm_fault_disable_pagefaults(); op_ret = futex_atomic_op(td, args->val3, args->uaddr2); + vm_fault_enable_pagefaults(save); LINUX_CTR2(sys_futex, "WAKE_OP atomic_op uaddr %p ret 0x%x", args->uaddr, op_ret); if (op_ret < 0) { - /* XXX: We don't handle the EFAULT yet. */ - if (op_ret != -EFAULT) { - if (f2 != NULL) - futex_put(f2, NULL); - futex_put(f, NULL); - - LIN_SDT_PROBE1(futex, linux_sys_futex, return, - -op_ret); - return (-op_ret); - } else { - LIN_SDT_PROBE0(futex, linux_sys_futex, - unhandled_efault); - } if (f2 != NULL) futex_put(f2, NULL); futex_put(f, NULL); - - LIN_SDT_PROBE1(futex, linux_sys_futex, return, EFAULT); - return (EFAULT); + error = copyin(args->uaddr2, &val, sizeof(val)); + if (error == 0) + goto retry2; + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + return (error); } ret = futex_wake(f, args->val, args->val3); From owner-svn-src-all@freebsd.org Sun Jun 5 06:37:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0562BB69E5B; Sun, 5 Jun 2016 06:37:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD1BF1B37; Sun, 5 Jun 2016 06:37:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u556btM3052164; Sun, 5 Jun 2016 06:37:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u556bsSj052161; Sun, 5 Jun 2016 06:37:54 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606050637.u556bsSj052161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sun, 5 Jun 2016 06:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301427 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 06:37:56 -0000 Author: arybchik Date: Sun Jun 5 06:37:54 2016 New Revision: 301427 URL: https://svnweb.freebsd.org/changeset/base/301427 Log: sfxge(4): allow firmware to auto-configure event queues on Medford On Medford, licenses are required to enable RX and event cut through and to disable RX batching. To avoid the need for the driver to make decisions based on the licensing state, the MC_CMD_INIT_EVQ has been extended to allow us to leave the decision to the firmware. If the adapter is licensed for low-latency use, the firmware will choose the optimal settings for latency, otherwise it will use the best settings for throughput. For Huntington we still need to choose the settings ourselves. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6717 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sun Jun 5 06:06:55 2016 (r301426) +++ head/sys/dev/sfxge/common/ef10_ev.c Sun Jun 5 06:37:54 2016 (r301427) @@ -139,7 +139,8 @@ efx_mcdi_init_evq( __in efsys_mem_t *esmp, __in size_t nevs, __in uint32_t irq, - __in uint32_t us) + __in uint32_t us, + __in boolean_t low_latency) { efx_mcdi_req_t req; uint8_t payload[ @@ -149,7 +150,7 @@ efx_mcdi_init_evq( uint64_t addr; int npages; int i; - int supports_rx_batching; + int ev_cut_through; efx_rc_t rc; npages = EFX_EVQ_NBUFS(nevs); @@ -170,21 +171,19 @@ efx_mcdi_init_evq( MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_IRQ_NUM, irq); /* - * On Huntington RX and TX event batching can only be requested - * together (even if the datapath firmware doesn't actually support RX - * batching). - * Cut through is incompatible with RX batching and so enabling cut - * through disables RX batching (but it does not affect TX batching). + * On Huntington RX and TX event batching can only be requested together + * (even if the datapath firmware doesn't actually support RX + * batching). If event cut through is enabled no RX batching will occur. * - * So always enable RX and TX event batching, and enable cut through - * if RX event batching isn't supported (i.e. on low latency firmware). + * So always enable RX and TX event batching, and enable event cut + * through if we want low latency operation. */ - supports_rx_batching = enp->en_nic_cfg.enc_rx_batching_enabled ? 1 : 0; + ev_cut_through = low_latency ? 1 : 0; MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS, INIT_EVQ_IN_FLAG_INTERRUPTING, 1, INIT_EVQ_IN_FLAG_RPTR_DOS, 0, INIT_EVQ_IN_FLAG_INT_ARMD, 0, - INIT_EVQ_IN_FLAG_CUT_THRU, !supports_rx_batching, + INIT_EVQ_IN_FLAG_CUT_THRU, ev_cut_through, INIT_EVQ_IN_FLAG_RX_MERGE, 1, INIT_EVQ_IN_FLAG_TX_MERGE, 1); @@ -250,6 +249,114 @@ fail1: return (rc); } + +static __checkReturn efx_rc_t +efx_mcdi_init_evq_v2( + __in efx_nic_t *enp, + __in unsigned int instance, + __in efsys_mem_t *esmp, + __in size_t nevs, + __in uint32_t irq, + __in uint32_t us) +{ + efx_mcdi_req_t req; + uint8_t payload[ + MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), + MC_CMD_INIT_EVQ_V2_OUT_LEN)]; + efx_qword_t *dma_addr; + uint64_t addr; + int npages; + int i; + efx_rc_t rc; + + npages = EFX_EVQ_NBUFS(nevs); + if (MC_CMD_INIT_EVQ_V2_IN_LEN(npages) > MC_CMD_INIT_EVQ_V2_IN_LENMAX) { + rc = EINVAL; + goto fail1; + } + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_INIT_EVQ; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_INIT_EVQ_V2_IN_LEN(npages); + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_INIT_EVQ_V2_OUT_LEN; + + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_SIZE, nevs); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq); + + MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS, + INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1, + INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0, + INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0, + INIT_EVQ_V2_IN_FLAG_TYPE, MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO); + + /* If the value is zero then disable the timer */ + if (us == 0) { + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE, + MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_DIS); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_LOAD, 0); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_RELOAD, 0); + } else { + unsigned int ticks; + + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail2; + + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE, + MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_LOAD, ticks); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_RELOAD, ticks); + } + + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_COUNT_MODE, + MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_DIS); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_COUNT_THRSHLD, 0); + + dma_addr = MCDI_IN2(req, efx_qword_t, INIT_EVQ_V2_IN_DMA_ADDR); + addr = EFSYS_MEM_ADDR(esmp); + + for (i = 0; i < npages; i++) { + EFX_POPULATE_QWORD_2(*dma_addr, + EFX_DWORD_1, (uint32_t)(addr >> 32), + EFX_DWORD_0, (uint32_t)(addr & 0xffffffff)); + + dma_addr++; + addr += EFX_BUF_SIZE; + } + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail3; + } + + if (req.emr_out_length_used < MC_CMD_INIT_EVQ_V2_OUT_LEN) { + rc = EMSGSIZE; + goto fail4; + } + + /* NOTE: ignore the returned IRQ param as firmware does not set it. */ + + EFSYS_PROBE1(mcdi_evq_flags, uint32_t, + MCDI_OUT_DWORD(req, INIT_EVQ_V2_OUT_FLAGS)); + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + static __checkReturn efx_rc_t efx_mcdi_fini_evq( __in efx_nic_t *enp, @@ -348,11 +455,41 @@ ef10_ev_qcreate( * Interrupts may be raised for events immediately after the queue is * created. See bug58606. */ - if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us)) != 0) - goto fail4; + + if (encp->enc_init_evq_v2_supported) { + /* + * On Medford the low latency license is required to enable RX + * and event cut through and to disable RX batching. We let the + * firmware decide the settings to use. If the adapter has a low + * latency license, it will choose the best settings for low + * latency, otherwise it choose the best settings for + * throughput. + */ + rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us); + if (rc != 0) + goto fail4; + } else { + /* + * On Huntington we need to specify the settings to use. We + * favour latency if the adapter is running low-latency firmware + * and throughput otherwise, and assume not support RX batching + * implies the adapter is running low-latency firmware. (This + * is how it's been done since Huntington GA. It doesn't make + * much sense with hindsight as the 'low-latency' firmware + * variant is also best for throughput, and does now support RX + * batching). + */ + boolean_t low_latency = encp->enc_rx_batching_enabled ? 0 : 1; + rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, + low_latency); + if (rc != 0) + goto fail5; + } return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Sun Jun 5 06:06:55 2016 (r301426) +++ head/sys/dev/sfxge/common/ef10_nic.c Sun Jun 5 06:37:54 2016 (r301427) @@ -1025,6 +1025,13 @@ ef10_get_datapath_caps( encp->enc_enhanced_set_mac_supported = CAP_FLAG(flags, SET_MAC_ENHANCED) ? B_TRUE : B_FALSE; + /* + * Check if firmware supports version 2 of MC_CMD_INIT_EVQ, which allows + * us to let the firmware choose the settings to use on an EVQ. + */ + encp->enc_init_evq_v2_supported = + CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; + #undef CAP_FLAG #undef CAP_FLAG2 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sun Jun 5 06:06:55 2016 (r301426) +++ head/sys/dev/sfxge/common/efx.h Sun Jun 5 06:37:54 2016 (r301427) @@ -1148,6 +1148,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_rx_disable_scatter_supported; boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; + boolean_t enc_init_evq_v2_supported; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; From owner-svn-src-all@freebsd.org Sun Jun 5 07:34:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67814B687C4; Sun, 5 Jun 2016 07:34:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 351801DBC; Sun, 5 Jun 2016 07:34:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557YB51074039; Sun, 5 Jun 2016 07:34:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557YAXl074033; Sun, 5 Jun 2016 07:34:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050734.u557YAXl074033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301428 - in stable/10/sys: amd64/amd64 i386/i386 powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:34:12 -0000 Author: dchagin Date: Sun Jun 5 07:34:10 2016 New Revision: 301428 URL: https://svnweb.freebsd.org/changeset/base/301428 Log: MFC r300415: Add macro to convert errno and use it when appropriate. Modified: stable/10/sys/amd64/amd64/vm_machdep.c stable/10/sys/i386/i386/vm_machdep.c stable/10/sys/powerpc/powerpc/exec_machdep.c stable/10/sys/sparc64/sparc64/vm_machdep.c stable/10/sys/sys/sysent.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/vm_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/amd64/amd64/vm_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -414,13 +414,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_rax = error; + td->td_frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_rflags |= PSL_C; break; } Modified: stable/10/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/10/sys/i386/i386/vm_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/i386/i386/vm_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -486,13 +486,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_eax = error; + td->td_frame->tf_eax = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_eflags |= PSL_C; break; } Modified: stable/10/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/exec_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/powerpc/powerpc/exec_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -901,11 +901,7 @@ cpu_set_syscall_retval(struct thread *td tf->srr0 -= 4; break; default: - if (p->p_sysent->sv_errsize) { - error = (error < p->p_sysent->sv_errsize) ? - p->p_sysent->sv_errtbl[error] : -1; - } - tf->fixreg[FIRSTARG] = error; + tf->fixreg[FIRSTARG] = SV_ABI_ERRNO(p, error); tf->cr |= 0x10000000; /* Set summary overflow */ break; } Modified: stable/10/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/vm_machdep.c Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/sparc64/sparc64/vm_machdep.c Sun Jun 5 07:34:10 2016 (r301428) @@ -196,13 +196,7 @@ cpu_set_syscall_retval(struct thread *td break; default: - if (td->td_proc->p_sysent->sv_errsize) { - if (error >= td->td_proc->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = td->td_proc->p_sysent->sv_errtbl[error]; - } - td->td_frame->tf_out[0] = error; + td->td_frame->tf_out[0] = SV_ABI_ERRNO(td->td_proc, error); td->td_frame->tf_tstate |= TSTATE_XCC_C; break; } Modified: stable/10/sys/sys/sysent.h ============================================================================== --- stable/10/sys/sys/sysent.h Sun Jun 5 06:37:54 2016 (r301427) +++ stable/10/sys/sys/sysent.h Sun Jun 5 07:34:10 2016 (r301428) @@ -141,6 +141,8 @@ struct sysentvec { #define SV_SHP 0x010000 #define SV_ABI_MASK 0xff +#define SV_ABI_ERRNO(p, e) ((p)->p_sysent->sv_errsize <= 0 ? e : \ + ((e) >= (p)->p_sysent->sv_errsize ? -1 : (p)->p_sysent->sv_errtbl[e])) #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) #define SV_PROC_ABI(p) ((p)->p_sysent->sv_flags & SV_ABI_MASK) #define SV_CURPROC_FLAG(x) SV_PROC_FLAG(curproc, x) From owner-svn-src-all@freebsd.org Sun Jun 5 07:38:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CCEBB68865; Sun, 5 Jun 2016 07:38:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08F161F35; Sun, 5 Jun 2016 07:38:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557cvwg074252; Sun, 5 Jun 2016 07:38:57 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557cvQQ074251; Sun, 5 Jun 2016 07:38:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050738.u557cvQQ074251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301429 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:38:58 -0000 Author: dchagin Date: Sun Jun 5 07:38:56 2016 New Revision: 301429 URL: https://svnweb.freebsd.org/changeset/base/301429 Log: MFC r300416: Add a missing errno translation for SO_ERROR optname. PR: 135458 Reported by: Stefan Schmidt Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:34:10 2016 (r301428) +++ stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:38:56 2016 (r301429) @@ -1594,10 +1594,10 @@ linux_getsockopt(struct thread *td, stru } */ bsd_args; l_timeval linux_tv; struct timeval tv; - socklen_t tv_len, xulen; + socklen_t tv_len, xulen, len; struct xucred xu; struct l_ucred lxu; - int error, name; + int error, name, newval; bsd_args.s = args->s; bsd_args.level = linux_to_bsd_sockopt_level(args->level); @@ -1636,6 +1636,15 @@ linux_getsockopt(struct thread *td, stru return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu))); /* NOTREACHED */ break; + case SO_ERROR: + len = sizeof(newval); + error = kern_getsockopt(td, args->s, bsd_args.level, + name, &newval, UIO_SYSSPACE, &len); + if (error) + return (error); + newval = -SV_ABI_ERRNO(td->td_proc, newval); + return (copyout(&newval, PTRIN(args->optval), len)); + /* NOTREACHED */ default: break; } From owner-svn-src-all@freebsd.org Sun Jun 5 07:40:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10E7AB68943; Sun, 5 Jun 2016 07:40:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D647710C8; Sun, 5 Jun 2016 07:40:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557eDoQ074400; Sun, 5 Jun 2016 07:40:13 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557eDmP074399; Sun, 5 Jun 2016 07:40:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050740.u557eDmP074399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301430 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:40:14 -0000 Author: dchagin Date: Sun Jun 5 07:40:12 2016 New Revision: 301430 URL: https://svnweb.freebsd.org/changeset/base/301430 Log: MFC r300569: Don't leak fp in case where fo_ioctl() returns an error. Reported by: C Turt Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sun Jun 5 07:38:56 2016 (r301429) +++ stable/10/sys/compat/linux/linux_ioctl.c Sun Jun 5 07:40:12 2016 (r301430) @@ -978,7 +978,7 @@ linux_ioctl_termio(struct thread *td, st error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, td->td_ucred, td); if (error) - return (error); + break; switch (bsd_line) { case TTYDISC: linux_line = LINUX_N_TTY; From owner-svn-src-all@freebsd.org Sun Jun 5 07:43:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D4E2B68C6D; Sun, 5 Jun 2016 07:43:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3963B167D; Sun, 5 Jun 2016 07:43:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557hKrF077732; Sun, 5 Jun 2016 07:43:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557hKXU077731; Sun, 5 Jun 2016 07:43:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050743.u557hKXU077731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301431 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:43:21 -0000 Author: dchagin Date: Sun Jun 5 07:43:20 2016 New Revision: 301431 URL: https://svnweb.freebsd.org/changeset/base/301431 Log: MFC r300431: Convert proto family in both directions. The linux and native values for local and inet are identical, but for inet6 values differ. PR: 155040 Reported by: Simon Walton Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:40:12 2016 (r301430) +++ stable/10/sys/compat/linux/linux_socket.c Sun Jun 5 07:43:20 2016 (r301431) @@ -462,12 +462,16 @@ bsd_to_linux_sockaddr(struct sockaddr *a { struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); - int error; + int error, bdom; if ((error = copyin(arg, &sa, sa_len))) return (error); - *(u_short *)&sa = sa.sa_family; + bdom = bsd_to_linux_domain(sa.sa_family); + if (bdom == -1) + return (EAFNOSUPPORT); + + *(u_short *)&sa = bdom; return (copyout(&sa, arg, sa_len)); } @@ -476,12 +480,16 @@ linux_to_bsd_sockaddr(struct sockaddr *a { struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); - int error; + int error, bdom; if ((error = copyin(arg, &sa, sa_len))) return (error); - sa.sa_family = *(sa_family_t *)&sa; + bdom = linux_to_bsd_domain(*(sa_family_t *)&sa); + if (bdom == -1) + return (EAFNOSUPPORT); + + sa.sa_family = bdom; sa.sa_len = len; return (copyout(&sa, arg, sa_len)); } From owner-svn-src-all@freebsd.org Sun Jun 5 07:45:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D20BB68CF0; Sun, 5 Jun 2016 07:45:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F218F1802; Sun, 5 Jun 2016 07:45:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557ju61077915; Sun, 5 Jun 2016 07:45:56 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557juhf077914; Sun, 5 Jun 2016 07:45:56 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606050745.u557juhf077914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 07:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301432 - stable/9/sys/compat/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:45:57 -0000 Author: dchagin Date: Sun Jun 5 07:45:55 2016 New Revision: 301432 URL: https://svnweb.freebsd.org/changeset/base/301432 Log: MFC r300569: Don't leak fp in case where fo_ioctl() returns an error. Reported by: C Turt Modified: stable/9/sys/compat/linux/linux_ioctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/9/sys/compat/linux/linux_ioctl.c Sun Jun 5 07:43:20 2016 (r301431) +++ stable/9/sys/compat/linux/linux_ioctl.c Sun Jun 5 07:45:55 2016 (r301432) @@ -974,7 +974,7 @@ linux_ioctl_termio(struct thread *td, st error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, td->td_ucred, td); if (error) - return (error); + break; switch (bsd_line) { case TTYDISC: linux_line = LINUX_N_TTY; From owner-svn-src-all@freebsd.org Sun Jun 5 07:51:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 819A0B68DEA; Sun, 5 Jun 2016 07:51:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53D6B1AA7; Sun, 5 Jun 2016 07:51:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557paWk078740; Sun, 5 Jun 2016 07:51:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557paHq078739; Sun, 5 Jun 2016 07:51:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050751.u557paHq078739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 07:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301433 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:51:37 -0000 Author: adrian Date: Sun Jun 5 07:51:36 2016 New Revision: 301433 URL: https://svnweb.freebsd.org/changeset/base/301433 Log: [bwn] complain usefully if a PHY-N PHY is detected with no support is compiled in. Log something other than "error 6" if the attach fails because the GPL PHY-N code isn't included. Modified: head/sys/dev/bwn/if_bwn_phy_n.c Modified: head/sys/dev/bwn/if_bwn_phy_n.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_n.c Sun Jun 5 07:45:55 2016 (r301432) +++ head/sys/dev/bwn/if_bwn_phy_n.c Sun Jun 5 07:51:36 2016 (r301433) @@ -101,6 +101,9 @@ bwn_phy_n_attach(struct bwn_mac *mac) #ifdef BWN_GPL_PHY return bwn_nphy_op_allocate(mac); #else + device_printf(mac->mac_sc->sc_dev, + "%s: BWN_GPL_PHY not in kernel config; " + "no PHY-N support\n", __func__); return (ENXIO); #endif } From owner-svn-src-all@freebsd.org Sun Jun 5 07:55:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA5F4B68F3E; Sun, 5 Jun 2016 07:55:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A25151DA8; Sun, 5 Jun 2016 07:55:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557tLtV081535; Sun, 5 Jun 2016 07:55:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557tL6s081534; Sun, 5 Jun 2016 07:55:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050755.u557tL6s081534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 07:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301434 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:55:23 -0000 Author: adrian Date: Sun Jun 5 07:55:21 2016 New Revision: 301434 URL: https://svnweb.freebsd.org/changeset/base/301434 Log: [bwn] Enable PHY-LP 5GHz support for the one NIC I have tested it on so far. After perusing the PHY-LP code (don't ask why; honest) I discovered that it /has/ 5GHz support - but it's not ever used. I found one NIC - a BCM4312 w/ pci id 0x4315 - which advertised dual-band PHY-LP support. Turns out it works. Whilst here, move up the support bit logging code so I can use it to debug this. Tested: * BCM4312 (pci id 0x4315); 5GHz STA operation Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sun Jun 5 07:51:36 2016 (r301433) +++ head/sys/dev/bwn/if_bwn.c Sun Jun 5 07:55:21 2016 (r301434) @@ -1163,6 +1163,16 @@ bwn_attach_core(struct bwn_mac *mac) have_bg = 1; have_a = 1; } +#if 0 + device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," + " deviceid=0x%04x, siba_deviceid=0x%04x\n", + __func__, + high, + have_a, + have_bg, + siba_get_pci_device(sc->sc_dev), + siba_get_chipid(sc->sc_dev)); +#endif } else { device_printf(sc->sc_dev, "%s: not siba; bailing\n", __func__); error = ENXIO; @@ -1183,18 +1193,12 @@ bwn_attach_core(struct bwn_mac *mac) if (error) goto fail; -#if 0 - device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," - " deviceid=0x%04x, siba_deviceid=0x%04x\n", - __func__, - high, - have_a, - have_bg, - siba_get_pci_device(sc->sc_dev), - siba_get_chipid(sc->sc_dev)); -#endif - + /* + * This is the whitelist of devices which we "believe" + * the SPROM PHY config from. The rest are "guessed". + */ if (siba_get_pci_device(sc->sc_dev) != 0x4312 && + siba_get_pci_device(sc->sc_dev) != 0x4315 && siba_get_pci_device(sc->sc_dev) != 0x4319 && siba_get_pci_device(sc->sc_dev) != 0x4324 && siba_get_pci_device(sc->sc_dev) != 0x4328 && From owner-svn-src-all@freebsd.org Sun Jun 5 07:56:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD1DBB68FB3; Sun, 5 Jun 2016 07:56:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0431F19; Sun, 5 Jun 2016 07:56:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u557uSpP081615; Sun, 5 Jun 2016 07:56:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u557uSHa081614; Sun, 5 Jun 2016 07:56:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606050756.u557uSHa081614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 Jun 2016 07:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301435 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:56:29 -0000 Author: adrian Date: Sun Jun 5 07:56:28 2016 New Revision: 301435 URL: https://svnweb.freebsd.org/changeset/base/301435 Log: [bwn] Add missing firmware release calls. This trips me up whenever I'm fooling around with partially supported NICs that fail to fully attach or initialise - the firmware gets loaded and references, but something fails - and the firmware references aren't cleaned up. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sun Jun 5 07:55:21 2016 (r301434) +++ head/sys/dev/bwn/if_bwn.c Sun Jun 5 07:56:28 2016 (r301435) @@ -750,6 +750,7 @@ bwn_detach(device_t dev) if (mac->mac_msi != 0) pci_release_msi(dev); mbufq_drain(&sc->sc_snd); + bwn_release_firmware(mac); BWN_LOCK_DESTROY(sc); return (0); } @@ -1328,6 +1329,7 @@ bwn_attach_core(struct bwn_mac *mac) siba_dev_down(sc->sc_dev, 0); fail: siba_powerdown(sc->sc_dev); + bwn_release_firmware(mac); return (error); } @@ -3930,6 +3932,7 @@ bwn_fw_gets(struct bwn_mac *mac, enum bw } } else if (rev < 11) { device_printf(sc->sc_dev, "no PCM for rev %d\n", rev); + bwn_release_firmware(mac); return (EOPNOTSUPP); } From owner-svn-src-all@freebsd.org Sun Jun 5 07:59:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EFF7B6A052; Sun, 5 Jun 2016 07:59:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0A410F2; Sun, 5 Jun 2016 07:59:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x241.google.com with SMTP id l9so15766983ioe.1; Sun, 05 Jun 2016 00:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=sx02eMG9VOcNCr01f7fXLardfvUY00yrJlhMPLBP+h4=; b=F+E9FbrpCjTKDLTAqXPafB45yrfS5rea6z8qSJdYvgvtuyGUCYWzyACukpdpt3ydM+ DgPBcuG/jQ8SuAfdCWQ0lMlITuvbapcFTfakSdA9ylcesxobXp2PKfpd/aga579PLCn7 zeq7EEDk3khQk7nWmb64M5DEzwNIF6lC575A5ZB2Yf6y0SI2o5yn38/chM1kbWW0+y8d G3N6LeeZSCU89mVL3FDoQjCNFpZZiE2sNsJ8Z0BBfA6gcwfMK2MI+f18rQTfopE8exr0 SiehnKDN/NKFeP2ZRQ0jYA5+P5tnxTAOXlk3ee8UCnStC4shh4QTaE16Etgj3VgAOxDF HaZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=sx02eMG9VOcNCr01f7fXLardfvUY00yrJlhMPLBP+h4=; b=Qe8QudLP9Rt5phxDlHYy+blmmVf19fgcSVlqbfH2pV8Mga6/25QEs+W3KOZHNJKJT1 Nvd2m0APCplNQmA2/DUN/jteo4UiOZmWj1o4zcqbrSs+XeXqMCuTrvAyW+BdMwh5IOKi P2i6LZC6rP+Je2KSP4h5fhSnUXusWijWijGbcLgBYtmgkyQI65jAOs/Ge7734C+PtwjM 75Qa1sbzQ9scoNmojd9HQhRcinylHL2V6om/f/QtP87+5ANn+qp7XIcXhiNxrzEfEFzu PvaIoBDi2iV9oJgxttclcaePmjxKQrt5Ugvj0Blf26J0/zBrcgp7XK+dN+YeO2GhA3qc vYlw== X-Gm-Message-State: ALyK8tJQF/Ogivw/TC5G72dwppB+l5h5ZEM/6KdCRP7lxXrQEfDPTUQDoLiZshdHRlpdwhrKzbHaZYYwQfAFOg== X-Received: by 10.107.144.67 with SMTP id s64mr13825640iod.165.1465113564586; Sun, 05 Jun 2016 00:59:24 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Sun, 5 Jun 2016 00:59:23 -0700 (PDT) In-Reply-To: <201606050755.u557tL6s081534@repo.freebsd.org> References: <201606050755.u557tL6s081534@repo.freebsd.org> From: Adrian Chadd Date: Sun, 5 Jun 2016 00:59:23 -0700 X-Google-Sender-Auth: RsQHV1FZNumbMB5GBNN0JCHkfvc Message-ID: Subject: Re: svn commit: r301434 - head/sys/dev/bwn 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 07:59:25 -0000 note: this works on RX only; TX seems to fail right now and I'm not yet sure why. I'll dig into it. Thanks, -adrian On 5 June 2016 at 00:55, Adrian Chadd wrote: > Author: adrian > Date: Sun Jun 5 07:55:21 2016 > New Revision: 301434 > URL: https://svnweb.freebsd.org/changeset/base/301434 > > Log: > [bwn] Enable PHY-LP 5GHz support for the one NIC I have tested it on so far. > > After perusing the PHY-LP code (don't ask why; honest) I discovered that > it /has/ 5GHz support - but it's not ever used. I found one NIC - a > BCM4312 w/ pci id 0x4315 - which advertised dual-band PHY-LP support. > > Turns out it works. > > Whilst here, move up the support bit logging code so I can use it > to debug this. > > Tested: > > * BCM4312 (pci id 0x4315); 5GHz STA operation > > Modified: > head/sys/dev/bwn/if_bwn.c > > Modified: head/sys/dev/bwn/if_bwn.c > ============================================================================== > --- head/sys/dev/bwn/if_bwn.c Sun Jun 5 07:51:36 2016 (r301433) > +++ head/sys/dev/bwn/if_bwn.c Sun Jun 5 07:55:21 2016 (r301434) > @@ -1163,6 +1163,16 @@ bwn_attach_core(struct bwn_mac *mac) > have_bg = 1; > have_a = 1; > } > +#if 0 > + device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," > + " deviceid=0x%04x, siba_deviceid=0x%04x\n", > + __func__, > + high, > + have_a, > + have_bg, > + siba_get_pci_device(sc->sc_dev), > + siba_get_chipid(sc->sc_dev)); > +#endif > } else { > device_printf(sc->sc_dev, "%s: not siba; bailing\n", __func__); > error = ENXIO; > @@ -1183,18 +1193,12 @@ bwn_attach_core(struct bwn_mac *mac) > if (error) > goto fail; > > -#if 0 > - device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," > - " deviceid=0x%04x, siba_deviceid=0x%04x\n", > - __func__, > - high, > - have_a, > - have_bg, > - siba_get_pci_device(sc->sc_dev), > - siba_get_chipid(sc->sc_dev)); > -#endif > - > + /* > + * This is the whitelist of devices which we "believe" > + * the SPROM PHY config from. The rest are "guessed". > + */ > if (siba_get_pci_device(sc->sc_dev) != 0x4312 && > + siba_get_pci_device(sc->sc_dev) != 0x4315 && > siba_get_pci_device(sc->sc_dev) != 0x4319 && > siba_get_pci_device(sc->sc_dev) != 0x4324 && > siba_get_pci_device(sc->sc_dev) != 0x4328 && > From owner-svn-src-all@freebsd.org Sun Jun 5 08:15:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E06BB6A54A; Sun, 5 Jun 2016 08:15:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F12019F9; Sun, 5 Jun 2016 08:15:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u558Fhak079150 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 5 Jun 2016 11:15:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u558Fhak079150 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u558FhdG079149; Sun, 5 Jun 2016 11:15:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 5 Jun 2016 11:15:43 +0300 From: Konstantin Belousov To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301414 - head/sys/dev/filemon Message-ID: <20160605081543.GE38613@kib.kiev.ua> References: <201606042334.u54NYpFt096529@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606042334.u54NYpFt096529@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 08:15:50 -0000 On Sat, Jun 04, 2016 at 11:34:51PM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Sat Jun 4 23:34:51 2016 > New Revision: 301414 > URL: https://svnweb.freebsd.org/changeset/base/301414 > > Log: > Fix build after r301404. > > X-MFC-With: r301404 > MFC after: 1 week > > Modified: > head/sys/dev/filemon/filemon_wrapper.c > > Modified: head/sys/dev/filemon/filemon_wrapper.c > ============================================================================== > --- head/sys/dev/filemon/filemon_wrapper.c Sat Jun 4 21:34:06 2016 (r301413) > +++ head/sys/dev/filemon/filemon_wrapper.c Sat Jun 4 23:34:51 2016 (r301414) > @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); > > #include "opt_compat.h" > > +#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) What are those COMPAT_IA32 and COMPAT_ARCH32 defines ? I cannot find any use or definitions for them except in filemon. Are the symbols remnants of some porting ? > +extern struct sysent freebsd32_sysent[]; > +#endif > + > static eventhandler_tag filemon_exec_tag; > static eventhandler_tag filemon_exit_tag; > static eventhandler_tag filemon_fork_tag; From owner-svn-src-all@freebsd.org Sun Jun 5 08:42:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF07BB6AAC8; Sun, 5 Jun 2016 08:42:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 917D31659; Sun, 5 Jun 2016 08:42:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u558gXAP099487; Sun, 5 Jun 2016 08:42:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u558gXu2099486; Sun, 5 Jun 2016 08:42:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606050842.u558gXu2099486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Jun 2016 08:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301436 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 08:42:34 -0000 Author: kib Date: Sun Jun 5 08:42:33 2016 New Revision: 301436 URL: https://svnweb.freebsd.org/changeset/base/301436 Log: MFC r300959: Do not leak the vm object lock when swap reservation failed, in vm_object_coalesce(). Modified: stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Sun Jun 5 07:56:28 2016 (r301435) +++ stable/10/sys/vm/vm_object.c Sun Jun 5 08:42:33 2016 (r301436) @@ -2132,6 +2132,7 @@ vm_object_coalesce(vm_object_t prev_obje */ if (!reserved && !swap_reserve_by_cred(ptoa(next_size), prev_object->cred)) { + VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } prev_object->charge += ptoa(next_size); From owner-svn-src-all@freebsd.org Sun Jun 5 08:48:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F322BB6AC67; Sun, 5 Jun 2016 08:48:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3FC619F3; Sun, 5 Jun 2016 08:48:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u558mcWW099979; Sun, 5 Jun 2016 08:48:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u558mc9g099970; Sun, 5 Jun 2016 08:48:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606050848.u558mc9g099970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 5 Jun 2016 08:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301437 - in head: sys/cam/ctl sys/dev/iscsi usr.bin/iscsictl usr.sbin/ctladm usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 08:48:40 -0000 Author: trasz Date: Sun Jun 5 08:48:37 2016 New Revision: 301437 URL: https://svnweb.freebsd.org/changeset/base/301437 Log: Report negotiated MaxBurstLength and FirstBurstLength in "iscsictl -v" and "ctladm islist -v" outputs. MFC after: 1 month Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi_ioctl.h head/usr.bin/iscsictl/iscsictl.c head/usr.sbin/ctladm/ctladm.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/kernel.c head/usr.sbin/ctld/login.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Jun 5 08:42:33 2016 (r301436) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Jun 5 08:48:37 2016 (r301437) @@ -1514,6 +1514,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cs->cs_statsn = cihp->statsn; cs->cs_max_data_segment_length = cihp->max_recv_data_segment_length; cs->cs_max_burst_length = cihp->max_burst_length; + cs->cs_first_burst_length = cihp->first_burst_length; cs->cs_immediate_data = !!cihp->immediate_data; if (cihp->header_digest == CTL_ISCSI_DIGEST_CRC32C) cs->cs_conn->ic_header_crc32c = true; @@ -1652,6 +1653,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) "%s" "%s" "%zd" + "%zd" + "%zd" "%d" "%d" "%s" @@ -1663,6 +1666,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) cs->cs_conn->ic_header_crc32c ? "CRC32C" : "None", cs->cs_conn->ic_data_crc32c ? "CRC32C" : "None", cs->cs_max_data_segment_length, + cs->cs_max_burst_length, + cs->cs_first_burst_length, cs->cs_immediate_data, cs->cs_conn->ic_iser, cs->cs_conn->ic_offload); Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Sun Jun 5 08:42:33 2016 (r301436) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Sun Jun 5 08:48:37 2016 (r301437) @@ -86,6 +86,7 @@ struct cfiscsi_session { bool cs_tasks_aborted; size_t cs_max_data_segment_length; size_t cs_max_burst_length; + size_t cs_first_burst_length; bool cs_immediate_data; char cs_initiator_name[CTL_ISCSI_NAME_LEN]; char cs_initiator_addr[CTL_ISCSI_ADDR_LEN]; Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sun Jun 5 08:42:33 2016 (r301436) +++ head/sys/dev/iscsi/iscsi.c Sun Jun 5 08:48:37 2016 (r301437) @@ -1934,6 +1934,8 @@ iscsi_ioctl_session_list(struct iscsi_so iss.iss_data_digest = ISCSI_DIGEST_NONE; iss.iss_max_data_segment_length = is->is_max_data_segment_length; + iss.iss_max_burst_length = is->is_max_burst_length; + iss.iss_first_burst_length = is->is_first_burst_length; iss.iss_immediate_data = is->is_immediate_data; iss.iss_connected = is->is_connected; Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Sun Jun 5 08:42:33 2016 (r301436) +++ head/sys/dev/iscsi/iscsi_ioctl.h Sun Jun 5 08:48:37 2016 (r301437) @@ -93,7 +93,8 @@ struct iscsi_session_state { int iss_connected; char iss_reason[ISCSI_REASON_LEN]; char iss_offload[ISCSI_OFFLOAD_LEN]; - int iss_spare[2]; + int iss_max_burst_length; + int iss_first_burst_length; }; /* Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Sun Jun 5 08:42:33 2016 (r301436) +++ head/usr.bin/iscsictl/iscsictl.c Sun Jun 5 08:48:37 2016 (r301437) @@ -567,6 +567,10 @@ kernel_list(int iscsi_fd, const struct t "CRC32C" : "None"); xo_emit("{L:/%-18s}{V:dataSegmentLen/%d}\n", "DataSegmentLen:", state->iss_max_data_segment_length); + xo_emit("{L:/%-18s}{V:maxBurstLen/%d}\n", + "MaxBurstLen:", state->iss_max_burst_length); + xo_emit("{L:/%-18s}{V:firstBurstLen/%d}\n", + "FirstBurstLen:", state->iss_first_burst_length); xo_emit("{L:/%-18s}{V:immediateData/%s}\n", "ImmediateData:", state->iss_immediate_data ? "Yes" : "No"); xo_emit("{L:/%-18s}{V:iSER/%s}\n", Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Sun Jun 5 08:42:33 2016 (r301436) +++ head/usr.sbin/ctladm/ctladm.c Sun Jun 5 08:48:37 2016 (r301437) @@ -2795,6 +2795,8 @@ struct cctl_islist_conn { char *header_digest; char *data_digest; char *max_data_segment_length;; + char *max_burst_length;; + char *first_burst_length;; char *offload;; int immediate_data; int iser; @@ -2909,6 +2911,12 @@ cctl_islist_end_element(void *user_data, } else if (strcmp(name, "max_data_segment_length") == 0) { cur_conn->max_data_segment_length = str; str = NULL; + } else if (strcmp(name, "max_burst_length") == 0) { + cur_conn->max_burst_length = str; + str = NULL; + } else if (strcmp(name, "first_burst_length") == 0) { + cur_conn->first_burst_length = str; + str = NULL; } else if (strcmp(name, "offload") == 0) { cur_conn->offload = str; str = NULL; @@ -3031,6 +3039,8 @@ retry: printf("Header digest: %s\n", conn->header_digest); printf("Data digest: %s\n", conn->data_digest); printf("DataSegmentLen: %s\n", conn->max_data_segment_length); + printf("MaxBurstLen: %s\n", conn->max_burst_length); + printf("FirstBurstLen: %s\n", conn->first_burst_length); printf("ImmediateData: %s\n", conn->immediate_data ? "Yes" : "No"); printf("iSER (RDMA): %s\n", conn->iser ? "Yes" : "No"); printf("Offload driver: %s\n", conn->offload); Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Sun Jun 5 08:42:33 2016 (r301436) +++ head/usr.sbin/ctld/ctld.h Sun Jun 5 08:48:37 2016 (r301437) @@ -244,6 +244,7 @@ struct connection { size_t conn_data_segment_limit; size_t conn_max_data_segment_length; size_t conn_max_burst_length; + size_t conn_first_burst_length; int conn_immediate_data; int conn_header_digest; int conn_data_digest; Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Sun Jun 5 08:42:33 2016 (r301436) +++ head/usr.sbin/ctld/kernel.c Sun Jun 5 08:48:37 2016 (r301437) @@ -900,6 +900,7 @@ kernel_handoff(struct connection *conn) req.data.handoff.max_recv_data_segment_length = conn->conn_max_data_segment_length; req.data.handoff.max_burst_length = conn->conn_max_burst_length; + req.data.handoff.first_burst_length = conn->conn_first_burst_length; req.data.handoff.immediate_data = conn->conn_immediate_data; if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Sun Jun 5 08:42:33 2016 (r301436) +++ head/usr.sbin/ctld/login.c Sun Jun 5 08:48:37 2016 (r301437) @@ -582,10 +582,7 @@ login_negotiate_key(struct pdu *request, tmp, conn->conn_data_segment_limit); tmp = conn->conn_data_segment_limit; } - /* - * We don't pass the value to the kernel; it only enforces - * hardcoded limit anyway. - */ + conn->conn_first_burst_length = tmp; keys_add_int(response_keys, name, tmp); } else if (strcmp(name, "DefaultTime2Wait") == 0) { keys_add(response_keys, name, value); From owner-svn-src-all@freebsd.org Sun Jun 5 08:51:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F9DEB6AEBE; Sun, 5 Jun 2016 08:51:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4991CB0; Sun, 5 Jun 2016 08:51:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u558puHY003638; Sun, 5 Jun 2016 08:51:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u558puNF003637; Sun, 5 Jun 2016 08:51:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606050851.u558puNF003637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 5 Jun 2016 08:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301438 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 08:51:57 -0000 Author: trasz Date: Sun Jun 5 08:51:56 2016 New Revision: 301438 URL: https://svnweb.freebsd.org/changeset/base/301438 Log: Remove duplicated semicolons. MFC after: 1 month Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Sun Jun 5 08:48:37 2016 (r301437) +++ head/usr.sbin/ctladm/ctladm.c Sun Jun 5 08:51:56 2016 (r301438) @@ -2794,10 +2794,10 @@ struct cctl_islist_conn { char *target_alias; char *header_digest; char *data_digest; - char *max_data_segment_length;; - char *max_burst_length;; - char *first_burst_length;; - char *offload;; + char *max_data_segment_length; + char *max_burst_length; + char *first_burst_length; + char *offload; int immediate_data; int iser; STAILQ_ENTRY(cctl_islist_conn) links; From owner-svn-src-all@freebsd.org Sun Jun 5 09:38:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8012CB6A89B; Sun, 5 Jun 2016 09:38:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F04B1FF9; Sun, 5 Jun 2016 09:38:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u559cmSP018707; Sun, 5 Jun 2016 09:38:48 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u559cmrr018706; Sun, 5 Jun 2016 09:38:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201606050938.u559cmrr018706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 5 Jun 2016 09:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301439 - head/contrib/libucl/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 09:38:49 -0000 Author: bapt Date: Sun Jun 5 09:38:48 2016 New Revision: 301439 URL: https://svnweb.freebsd.org/changeset/base/301439 Log: Ensure old gcc does not accidently get the attributes it does not know about Modified: head/contrib/libucl/src/mum.h Modified: head/contrib/libucl/src/mum.h ============================================================================== --- head/contrib/libucl/src/mum.h Sun Jun 5 08:51:56 2016 (r301438) +++ head/contrib/libucl/src/mum.h Sun Jun 5 09:38:48 2016 (r301439) @@ -73,7 +73,7 @@ typedef unsigned __int64 uint64_t; #define _MUM_FRESH_GCC #endif -#if defined(__GNUC__) && !defined(__llvm__) +#if defined(__GNUC__) && !defined(__llvm__) && defined(_MUM_FRESH_GCC) #define _MUM_ATTRIBUTE_UNUSED __attribute__((unused)) #define _MUM_OPTIMIZE(opts) __attribute__((__optimize__ (opts))) #define _MUM_TARGET(opts) __attribute__((__target__ (opts))) From owner-svn-src-all@freebsd.org Sun Jun 5 10:33:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A7F4B6961F; Sun, 5 Jun 2016 10:33:54 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19EF51A9F; Sun, 5 Jun 2016 10:33:54 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55AXrlL040541; Sun, 5 Jun 2016 10:33:53 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55AXroJ040540; Sun, 5 Jun 2016 10:33:53 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201606051033.u55AXroJ040540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 5 Jun 2016 10:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301440 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 10:33:54 -0000 Author: melifaro Date: Sun Jun 5 10:33:53 2016 New Revision: 301440 URL: https://svnweb.freebsd.org/changeset/base/301440 Log: Fix 4-byte overflow in ipv6_writemask. This bug could cause some IPv6 table prefix delete requests to fail. Obtained from: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jun 5 09:38:48 2016 (r301439) +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c Sun Jun 5 10:33:53 2016 (r301440) @@ -590,7 +590,8 @@ ipv6_writemask(struct in6_addr *addr6, u for (cp = (uint32_t *)addr6; mask >= 32; mask -= 32) *cp++ = 0xFFFFFFFF; - *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); + if (mask > 0) + *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); } #endif From owner-svn-src-all@freebsd.org Sun Jun 5 10:48:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A52DBB6993F; Sun, 5 Jun 2016 10:48:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 759181070; Sun, 5 Jun 2016 10:48:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55AmR4u044258; Sun, 5 Jun 2016 10:48:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55AmRxx044257; Sun, 5 Jun 2016 10:48:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201606051048.u55AmRxx044257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 5 Jun 2016 10:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301441 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 10:48:28 -0000 Author: dchagin Date: Sun Jun 5 10:48:27 2016 New Revision: 301441 URL: https://svnweb.freebsd.org/changeset/base/301441 Log: MFC r300429: Remove a now unused global declaration of some sysentvec struct. Modified: stable/10/sys/sys/sysent.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/sysent.h ============================================================================== --- stable/10/sys/sys/sysent.h Sun Jun 5 10:33:53 2016 (r301440) +++ stable/10/sys/sys/sysent.h Sun Jun 5 10:48:27 2016 (r301441) @@ -154,8 +154,6 @@ struct sysentvec { #ifdef _KERNEL extern struct sysentvec aout_sysvec; -extern struct sysentvec elf_freebsd_sysvec; -extern struct sysentvec null_sysvec; extern struct sysent sysent[]; extern const char *syscallnames[]; From owner-svn-src-all@freebsd.org Sun Jun 5 11:56:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24743B6BB07; Sun, 5 Jun 2016 11:56:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A19125E; Sun, 5 Jun 2016 11:56:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55Bu41x069304; Sun, 5 Jun 2016 11:56:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55Bu4KQ069303; Sun, 5 Jun 2016 11:56:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201606051156.u55Bu4KQ069303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 5 Jun 2016 11:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301442 - head/contrib/libucl/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 11:56:05 -0000 Author: bapt Date: Sun Jun 5 11:56:03 2016 New Revision: 301442 URL: https://svnweb.freebsd.org/changeset/base/301442 Log: Fix build with external gcc Completly disable some extra optimisation for very recent gcc. They would require some updated in the runtime which we do not have yet Modified: head/contrib/libucl/src/mum.h Modified: head/contrib/libucl/src/mum.h ============================================================================== --- head/contrib/libucl/src/mum.h Sun Jun 5 10:48:27 2016 (r301441) +++ head/contrib/libucl/src/mum.h Sun Jun 5 11:56:03 2016 (r301442) @@ -69,9 +69,11 @@ typedef unsigned __int64 uint64_t; #endif #endif +#if 0 #if defined(__GNUC__) && ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) || (__GNUC__ > 4)) #define _MUM_FRESH_GCC #endif +#endif #if defined(__GNUC__) && !defined(__llvm__) && defined(_MUM_FRESH_GCC) #define _MUM_ATTRIBUTE_UNUSED __attribute__((unused)) From owner-svn-src-all@freebsd.org Sun Jun 5 13:39:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65FF4B6A9BD; Sun, 5 Jun 2016 13:39:32 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 285821197; Sun, 5 Jun 2016 13:39:32 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55DdVM4006042; Sun, 5 Jun 2016 13:39:31 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55DdVA6006041; Sun, 5 Jun 2016 13:39:31 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051339.u55DdVA6006041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 13:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301443 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 13:39:32 -0000 Author: ache Date: Sun Jun 5 13:39:31 2016 New Revision: 301443 URL: https://svnweb.freebsd.org/changeset/base/301443 Log: MFC: r300953 1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading harder. 2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case (non default) from negative seeds. 3) Don't check for valid "type" range in setstate(), it is always valid as calculated. Instead add a check that rear pointer not exceeed end pointer. MFC: r300965 Micro optimize: C standard guarantees that right shift for unsigned value fills left bits with zero, and we have exact 32bit unsigned value (uint32_t), so there is no reason to add "& 0x7fffffff" here. Modified: stable/10/lib/libc/stdlib/random.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/random.c ============================================================================== --- stable/10/lib/libc/stdlib/random.c Sun Jun 5 11:56:03 2016 (r301442) +++ stable/10/lib/libc/stdlib/random.c Sun Jun 5 13:39:31 2016 (r301443) @@ -137,11 +137,7 @@ __FBSDID("$FreeBSD$"); */ #define MAX_TYPES 5 /* max number of types above */ -#ifdef USE_WEAK_SEEDING -#define NSHUFF 0 -#else /* !USE_WEAK_SEEDING */ #define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ -#endif /* !USE_WEAK_SEEDING */ static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; @@ -162,23 +158,12 @@ static const int seps [MAX_TYPES] = { SE static uint32_t randtbl[DEG_3 + 1] = { TYPE_3, -#ifdef USE_WEAK_SEEDING -/* Historic implementation compatibility */ -/* The random sequences do not vary much with the seed */ - 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5, - 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, - 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, - 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, - 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b, - 0x27fb47b9, -#else /* !USE_WEAK_SEEDING */ - 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05, - 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454, - 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471, - 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1, - 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41, - 0xf3bec5da -#endif /* !USE_WEAK_SEEDING */ + 0x2cf41758, 0x27bb3711, 0x4916d4d1, 0x7b02f59f, 0x9b8e28eb, 0xc0e80269, + 0x696f5c16, 0x878f1ff5, 0x52d9c07f, 0x916a06cd, 0xb50b3a20, 0x2776970a, + 0xee4eb2a6, 0xe94640ec, 0xb1d65612, 0x9d1ed968, 0x1043f6b7, 0xa3432a76, + 0x17eacbb9, 0x3c09e2eb, 0x4f8c2b3, 0x708a1f57, 0xee341814, 0x95d0e4d2, + 0xb06f216c, 0x8bd2e72e, 0x8f7c38d7, 0xcfc6a8fc, 0x2a59495, 0xa20d2a69, + 0xe29d12d1 }; /* @@ -215,16 +200,8 @@ static int rand_sep = SEP_3; static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; static inline uint32_t -good_rand(int32_t x) +good_rand(uint32_t ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return (1103515245 * x + 12345); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * wihout overflowing 31 bits: @@ -233,18 +210,17 @@ good_rand(int32_t x) * Park and Miller, Communications of the ACM, vol. 31, no. 10, * October 1988, p. 1195. */ - int32_t hi, lo; + int32_t hi, lo, x; - /* Can't be initialized with 0, so use another value. */ - if (x == 0) - x = 123459876; + /* Transform to [1, 0x7ffffffe] range. */ + x = (ctx % 0x7ffffffe) + 1; hi = x / 127773; lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - return (x); -#endif /* !USE_WEAK_SEEDING */ + /* Transform to [0, 0x7ffffffd] range. */ + return (x - 1); } /* @@ -404,16 +380,8 @@ setstate(char *arg_state) uint32_t rear = new_state[0] / MAX_TYPES; char *ostate = (char *)(&state[-1]); - switch(type) { - case TYPE_0: - case TYPE_1: - case TYPE_2: - case TYPE_3: - case TYPE_4: - break; - default: + if (type != TYPE_0 && rear >= degrees[type]) return (NULL); - } if (rand_type == TYPE_0) state[-1] = rand_type; else @@ -455,14 +423,14 @@ random(void) if (rand_type == TYPE_0) { i = state[0]; - state[0] = i = (good_rand(i)) & 0x7fffffff; + state[0] = i = good_rand(i); } else { /* * Use local variables rather than static variables for speed. */ f = fptr; r = rptr; *f += *r; - i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ + i = *f >> 1; /* chucking least random bit */ if (++f >= end_ptr) { f = state; ++r; From owner-svn-src-all@freebsd.org Sun Jun 5 14:04:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32D0FB6A019; Sun, 5 Jun 2016 14:04:56 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015771E63; Sun, 5 Jun 2016 14:04:55 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55E4t3V017518; Sun, 5 Jun 2016 14:04:55 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55E4t74017517; Sun, 5 Jun 2016 14:04:55 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051404.u55E4t74017517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 14:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301444 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 14:04:56 -0000 Author: ache Date: Sun Jun 5 14:04:54 2016 New Revision: 301444 URL: https://svnweb.freebsd.org/changeset/base/301444 Log: Prepare for merge of r300956. One year old r288030 which fix prototypes can't be merged without conflicts and require merging of other versions too and I don't want to go deep in that unmerged commits chain. Modified: stable/10/lib/libc/stdlib/rand.c Modified: stable/10/lib/libc/stdlib/rand.c ============================================================================== --- stable/10/lib/libc/stdlib/rand.c Sun Jun 5 13:39:31 2016 (r301443) +++ stable/10/lib/libc/stdlib/rand.c Sun Jun 5 14:04:54 2016 (r301444) @@ -111,14 +111,13 @@ static u_long next = #endif int -rand() +rand(void) { return (do_rand(&next)); } void -srand(seed) -u_int seed; +srand(u_int seed) { next = seed; #ifndef USE_WEAK_SEEDING @@ -136,7 +135,7 @@ u_int seed; * data from the kernel. */ void -sranddev() +sranddev(void) { int mib[2]; size_t len; From owner-svn-src-all@freebsd.org Sun Jun 5 14:31:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED1E0B6A576; Sun, 5 Jun 2016 14:31:37 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFAE0197F; Sun, 5 Jun 2016 14:31:37 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55EVaor026448; Sun, 5 Jun 2016 14:31:36 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55EVavr026447; Sun, 5 Jun 2016 14:31:36 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051431.u55EVavr026447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 14:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301445 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 14:31:38 -0000 Author: ache Date: Sun Jun 5 14:31:36 2016 New Revision: 301445 URL: https://svnweb.freebsd.org/changeset/base/301445 Log: MFC: r300956 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard. 2) Instead of doing range transformation in each and every function here, do it single time directly in do_rand(). One "mod" operation overhead is not a big deal, but the code looks nicer and possible future functions additions or PRNG change do not miss range transformations neither have unneeded ones. 3) Use POSIX argument types for visible functions (cosmetic). Modified: stable/10/lib/libc/stdlib/rand.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/rand.c ============================================================================== --- stable/10/lib/libc/stdlib/rand.c Sun Jun 5 14:04:54 2016 (r301444) +++ stable/10/lib/libc/stdlib/rand.c Sun Jun 5 14:31:36 2016 (r301445) @@ -49,14 +49,6 @@ __FBSDID("$FreeBSD$"); static int do_rand(unsigned long *ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * without overflowing 31 bits: @@ -67,48 +59,34 @@ do_rand(unsigned long *ctx) */ long hi, lo, x; - /* Must be in [1, 0x7ffffffe] range at this point. */ - hi = *ctx / 127773; - lo = *ctx % 127773; + /* Transform to [1, 0x7ffffffe] range. */ + x = (*ctx % 0x7ffffffe) + 1; + hi = x / 127773; + lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fffffff; - *ctx = x; /* Transform to [0, 0x7ffffffd] range. */ - return (x - 1); -#endif /* !USE_WEAK_SEEDING */ + x--; + *ctx = x; + return (x); } int -rand_r(unsigned int *ctx) +rand_r(unsigned *ctx) { u_long val; int r; -#ifdef USE_WEAK_SEEDING val = *ctx; -#else - /* Transform to [1, 0x7ffffffe] range. */ - val = (*ctx % 0x7ffffffe) + 1; -#endif r = do_rand(&val); - -#ifdef USE_WEAK_SEEDING - *ctx = (unsigned int)val; -#else - *ctx = (unsigned int)(val - 1); -#endif + *ctx = (unsigned)val; return (r); } -static u_long next = -#ifdef USE_WEAK_SEEDING - 1; -#else - 2; -#endif +static u_long next = 1; int rand(void) @@ -117,13 +95,9 @@ rand(void) } void -srand(u_int seed) +srand(unsigned seed) { next = seed; -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffffffe] range. */ - next = (next % 0x7ffffffe) + 1; -#endif } @@ -145,10 +119,6 @@ sranddev(void) mib[0] = CTL_KERN; mib[1] = KERN_ARND; sysctl(mib, 2, (void *)&next, &len, NULL, 0); -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffffffe] range. */ - next = (next % 0x7ffffffe) + 1; -#endif } From owner-svn-src-all@freebsd.org Sun Jun 5 14:42:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28A59B6A84E; Sun, 5 Jun 2016 14:42:03 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0145.outbound.protection.outlook.com [65.55.169.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEF461FB2; Sun, 5 Jun 2016 14:42:01 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=EeZ8+AOrvA9korcQwPrON5efID6IP42Rd2mYp3dfdqA=; b=J2kJ0aolMOze5jlq+F94sOVGbM0HxhkVl+q58LU4m0bfQUotDECP+Jfd8+ZIGLbvpnw9XEjMq7au+WTDQs4c0ts4U8CA+F8IWmgM5mwGyfuDf7y/PKOjKVlH84OVRQMJoQjmFhFQlbslAvV8Wu9PQbuKrj7FxYI6QryXJWG1hkk= Received: from BY1PR0501CA0035.namprd05.prod.outlook.com (10.162.139.45) by SN2PR05MB2493.namprd05.prod.outlook.com (10.166.213.14) with Microsoft SMTP Server (TLS) id 15.1.506.9; Sun, 5 Jun 2016 14:41:54 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:147) by BY1PR0501CA0035.outlook.office365.com (2a01:111:e400:4821::45) with Microsoft SMTP Server (TLS) id 15.1.497.12 via Frontend Transport; Sun, 5 Jun 2016 14:41:54 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.19) by BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Sun, 5 Jun 2016 14:41:53 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sun, 5 Jun 2016 07:41:51 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u55EfpJ46279; Sun, 5 Jun 2016 07:41:51 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 5C3BE385508; Sun, 5 Jun 2016 07:41:51 -0700 (PDT) To: Konstantin Belousov CC: Bryan Drewery , , , , Subject: Re: svn commit: r301414 - head/sys/dev/filemon In-Reply-To: <20160605081543.GE38613@kib.kiev.ua> References: <201606042334.u54NYpFt096529@repo.freebsd.org> <20160605081543.GE38613@kib.kiev.ua> Comments: In-reply-to: Konstantin Belousov message dated "Sun, 05 Jun 2016 11:15:43 +0300." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <74459.1465137711.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Sun, 5 Jun 2016 07:41:51 -0700 Message-ID: <74460.1465137711@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(189002)(199003)(24454002)(9170700003)(2810700001)(19580395003)(4326007)(19580405001)(5003600100002)(50986999)(97756001)(92566002)(11100500001)(76176999)(105596002)(106466001)(2906002)(47776003)(189998001)(46406003)(50226002)(107886002)(110136002)(77096005)(9686002)(1411001)(50466002)(2950100001)(5008740100001)(586003)(8676002)(6806005)(87936001)(8746002)(23726003)(8936002)(76506005)(4001430100002)(53416004)(86362001)(81166006)(117636001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR05MB2493; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD017; 1:jQ6J+fyUGZ7z2Ye8aFjpvNS2q6dwovI//TwwCw3u3aysVYJrEGBPd3kNQ7SlAe/TI79CCWSt83FN3WFv3S5nmpb1Yck+iH7owZ0+YAXO82nqd+vtFc7esHJN1ZKB8hDqNk88rpnOdNXwE1z9Znbj1XbxQ1vqYufVoj8IMxvopfQP12u7xKpfVwUEBYLYCTNA87/MlleCDzaeBm0LJ82cjHVGUzFoh7PVkF9vdDOiBycp+BWo4PYmdSPFK4yIFySInX02sv5JXrRa2GF9GK0m38VDVwnRa4g04GgYDz4f5TnEp2cHo8Bg7202GCbBXlgRMjfpM6O/4dx+OhZ57T7a3yPxHg27vaLr40/iNDoPNSu39mPyrF1SP15CbuH8LxvefGyuJrvCAmytjjg2WEA3UCTCewNUu8+dBTZ0o0+tVojbMgTIqznew6K9gU5otuDHIcA0yVRic2IA1ZVZOo1hyd7HEhDmUfpBEAKwIbSuHi+Xe2qYA4LkLlY0FGiU8LkOzWDvSFF+pizJ8eaASiBt4Q== X-MS-Office365-Filtering-Correlation-Id: a1d60d67-2c97-471c-2579-08d38d4f8965 X-Microsoft-Exchange-Diagnostics: 1; SN2PR05MB2493; 2:hjgKdfaWaoPHbjHBTBEQRgaFA5POnAStvVpQ2MSI/zWzKbgl5RXzBJOh0MOQf0b11y6OkUNy7KBaowfbJs/7hF7TG7Mu5rQbxxZyLf6INTORe1JgCYR53bK1PljVf82xCpAbrO9PksXLjYBMTm8pjMYXPOPa25fJUDT5dDY6yRebYdRcg20KYHvn566h7BN6; 3:vPID68SAzOpbt6NoxIA9unDLW1+qKVOpERDkw7N/AbJVIJNQ1jKaLB5GwZtkQVWrRrrc9kDPZCeFmEvIul3k9mU3JiAQ+WIWUye2cTj1V3F7cWLOOGbc/pSWDvynuTIQB757ajMES+pS1EbbHiNSQPj+OThY36lrdhD8ksU8fh8vRTx7OlyktaoTdGVggZrSrcHG7oiB+TJmbwhZxgO2b69tEZ3yPQTr9FJetOKDkr8= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR05MB2493; X-Microsoft-Exchange-Diagnostics: 1; SN2PR05MB2493; 25:5pTAyyUNLoRk4kJyCcbePx0R28ehasQ+4g6Gws2UHktZaIdv9VYUT1OVWQLqkL5cXuG3xAzOhLF4fCkh8V2oBYgcH3LahkC3MKIH50l8XxoW8yBuxEl+xSiKmJqY0SnlI57d7iE4u6+HN8AVQ6RGrfXm3Slnz7p4XHms+BMUVjxRGIBi4PRoz1ONTBpXOvL+hOKeegUbPqQlp/aZhKWwyLamZCCoDVFNngSt+7XWW6yVRu4qIFmlirlOf9kPAJ9h0SQXkiDdOkjC+c0n+OwI+S1UkVCEa1Es7LBHmb6eAfZ9X9QSRu8iDLVUtDngtLoVhm1zHT1+aIOijtHeXoQW2SsHR44p+1pM0wfU+KQ5UHIfOqStTqrY3LJpdaHXgd8HuN5XXvRSzOhq/vJs41PFlvYdq825uK4KRSw9nC4Z/SLjvZcaDhGAT4HCMgUmyoADZIc6RnbNikf6WlOijBGQzGiFHwzmQdSOY8s8qstcUekSpnWIUKJg/1TALra1VIVySJxLDrjqwTZV3+kP/wdzJND0EjFdj0EuCcGN68CvSZWl+HpLWCjYb6P4CmvTKDZn9ShbFSmN2rgcLCMeTsAuheNPrL7t9FXJnKhGbdqpW6/5GNSlzinXNEyJXIZb/U2Ljn1ZfPKWBdHvkLiw44Kytgm0FIS7RgXkVrOt65QvFeexZIuaOIYWB6/LCyujqmfrqJ7B7kFWfS4G3fhvoNqGdJqzCRWmZa5OcY9Tovti+x4= X-Microsoft-Exchange-Diagnostics: 1; SN2PR05MB2493; 20:UR28vTlpPI8S0lqNz6Dtg7pen9eDbcxl7BbZ++/ShZg+OW27jjn6kr/ZMsHKl/jnyDlKGcJHBjiGq8eP1AQf21rTh5+fyefgGnCN7GJ69ecj6Cb0Y8YY3pcnZOWwGvkaEyCNf2Lv88k4gqPum6+ZErVoDFxu8h0S51OBoRmUp4YQ1lEY8BKdQIz7oZwlTJAtwZSpjSvS83JJaXUAOAOjtzTbuRsI5qKpRG7TVzWylLnx2wgOqr3U5/7mMjpKtm3YOv36ec4YR7rryU40yOqamkYSmyEq9fwui7kvxHbCpjCVD19byBt2nmyecDTE/LIHCqrSlMQOqD5B+VW+/HWe+LWgnpoOcEzyHyfPnafr4cBEC91I2pG0mO7iRqlJtRUa/Zby2rv4izang/1uyE8NfIV4nxPAyB3sY2ZsRuKoxSbBqK9NeMaWLvpB2Ecs1TaTuwbq1eX/RrNAY+VPnAJjUyaiAFU1dW+gZ+/YEr/lXtCaRYO16aDESTIyMyTT9TgB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13023025)(13018025)(13017025)(13015025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:SN2PR05MB2493; BCL:0; PCL:0; RULEID:; SRVR:SN2PR05MB2493; X-Microsoft-Exchange-Diagnostics: 1; SN2PR05MB2493; 4:xAKwsyxnkV2pPyeFFvsM6M/xC98KN2REv+cQChZD8XF8UOWDu2q2FLIAQcuOIefX4kJHjiIlptLm5UGpoiFeEOvkQ0utwDgjDjpiAeimFFDTqgL/O0JwS5i4+pWHc2igRNyiFa+L9ufsapkb8rmXhn4zhPFX6VcMDwEjT2kTjPY6trs43rZIuzppaW/OzGq433LGKbwC04MmUwfHClMOQUFuMBMYTCE/B1o9FLPS4fFii9Ngs9Oqk120Z831D0K5jRPtP49v81svzkgTfMejNl1qcv9TeF3/zVo0hKpEPlKE6p00re0/BQuK5gFeyT0NrMEiBre7weKqg18sQ5NT3nGWv2NFzBrGR+kYHNUuOgjbj9B/jQpxGsxg1/yT9QYNn9wWrYouK1A8iMTZ2Oz+OFTX+KCfM2BkxurQeM3ECTZdBUG+NF7R6BfMJCIJU+BnSbTyj8kXBFxWSWzzHRnq4hfDiVWNJVOfN7pABLR5nOI= X-Forefront-PRVS: 09645BAC66 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR05MB2493; 23:+9l5Cn9jL498RPCLnvnCU4s+7ZBVZK0/lpHPahQRr?= =?us-ascii?Q?iTyNkMqPe6YG8JKlnUU9Ao39ZfgYUmKGownVSFwQ8zs4LTlMhYgB5a4swF7x?= =?us-ascii?Q?6vC446nIEumgrfX4+jeyJSX6lkmS7ZuSFw8if5U1hSo1XVTiJtQoPNQeLzwc?= =?us-ascii?Q?CqUqumH3VKPGX7XaDFFh30Jjk3oG3E5XAXbXzyTmTV7WIiq0SZSQsnSNeQmE?= =?us-ascii?Q?onsnVplYY/BPbIdZn+HtLn5D/RLCCyA3WgU8ce9d6rmsp9/9hE9gRI5HvqtJ?= =?us-ascii?Q?L041tIdIkAoQMU1qIBeFDN0LSsI3rOSD6Cu6QaD5cUm2vGeu6YC+DDmX7sQk?= =?us-ascii?Q?uOLQexpIa43yuWSCsuvRNLHdHHRZZCpJcgGEmi1gyb03v4caEy6AZpXIZeb+?= =?us-ascii?Q?YDD/CXn4kk4LOPqaSBkccUHZc6jl47P+xnK3B+e7aYGbXj+pKnUaUFvA69XN?= =?us-ascii?Q?OL1WCZdQ7Y7Hkjuu1otAyEh+RbSK3v6j23imJ3VW5hLOMZ5HIfU3ajlagyGM?= =?us-ascii?Q?Cz3Fe4CU1WXl9J6MaM2nFewe9lP29iOOvuavfwIroqooiiCU3LR2nApnsJH5?= =?us-ascii?Q?CVW1sv6dEmddX/hdoLC1Y1dPws4aQ7aGfCWLcvOszpp11RuRA3WJejbZiQTf?= =?us-ascii?Q?DY8WHOJ28awogsQqx2/u7DIbedqJD5BGKNgg1sPQ5ruXerDI7ZmlOYIK20tb?= =?us-ascii?Q?U81SoSOxVca7iMfoiR9OcZc7my0dv/HehbW6xnbTpcH7MFz20R7qrGAdo2BW?= =?us-ascii?Q?33+JGHJa9izI0UiFwsStpFYLorZDjuMsHjJuw0XTCAfkQ2KtUuzHybq9h0Qd?= =?us-ascii?Q?mRHcsOSUN1Dz0XPH3xwvoXN/8n0Xc3szTF5WiLGEFxuyGCtgJ8HOLsIPXCF/?= =?us-ascii?Q?7BGtTRpLXQ+KFT9RCRVstlhcwiuPLm+XIgrT5wA8vp+2F/I8+jD8vb27mx54?= =?us-ascii?Q?RffZ7MtVNpkzD8v06iLirMC3DiHj3anQirnU0eKouAwTuLxlCtKtz0b101KX?= =?us-ascii?Q?UA/OBEZhd2z2Dga9EKY9fNwB1mj49muBr5dvwGRTeKUMOHalhQbulf/4zJKv?= =?us-ascii?Q?KJOilg5HBCiGvGh+vyuIjhZUjKCGUwwkrCcrf1CmZDxVCREBqTG7XJ8u4W2u?= =?us-ascii?Q?/D8BAxmVAwDYrzb8ROH3ErR9mTsrjggcugmsscHf+QRIyuG+zsCqg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR05MB2493; 5:Azo6xPZX91wqGfyKVKT1QQhN46ddXJhQfyJd1eJVCK5OqR1zHGSoUkxQHQDrYOKCYCzdM6sE534emGVXFW8UyEtfdernYbx+XXr/2wTKBZ2qbAP3pGrjRIZ4amjDEEcBqdOgMoBsnk9KuEG6SZXUbw==; 24:aT2fycOyL2Ss2kGnGx8bLCjR5dW5wOMCDx5WjsS86XvbkekKWEi87Arug881NNPpByYCKnlKtU4e8aIweBn2F0idAJGRBD4pO6p8xX4SOqg=; 7:wE09ubNpGEKbD0WNEuhLBSIJwVzAuXx7FYH7Id857eBFv9LCoMQlB+fR45GM/bNXncYgBHZByxc7dR5H8rvoc+dOc4+m8sAk2VzibWfdV/y5ruo+qIyZLtbSShPe30iLwx+Om8xH9gh9/KWlY2fLEk6AeeqP3zHexUJUvXFH2h5/zCR3mK8yqptFfq3XrqFQasAtsEcQOTXTL6Xht/J+viCENpJD4eGQGSPCeVAhG0g= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2016 14:41:53.2668 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR05MB2493 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 14:42:03 -0000 Konstantin Belousov wrote: > > Modified: head/sys/dev/filemon/filemon_wrapper.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 > > = > > +#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMP= AT_ARCH32) > What are those COMPAT_IA32 and COMPAT_ARCH32 defines ? > I cannot find any use or definitions for them except in filemon. > = > Are the symbols remnants of some porting ? I think it was originally written for 7.x but AFAIK it was never built for anything but FreeBSD. It is possible that the original author was thinking of making it portable to other platforms, but separate implementations were done for NetBSD and Linux. From owner-svn-src-all@freebsd.org Sun Jun 5 15:03:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1381B6AD87; Sun, 5 Jun 2016 15:03:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6407D1AA0; Sun, 5 Jun 2016 15:03:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55F3tao039780; Sun, 5 Jun 2016 15:03:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55F3tP8039779; Sun, 5 Jun 2016 15:03:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606051503.u55F3tP8039779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 5 Jun 2016 15:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301446 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 15:03:56 -0000 Author: pfg Date: Sun Jun 5 15:03:55 2016 New Revision: 301446 URL: https://svnweb.freebsd.org/changeset/base/301446 Log: MFC r301206: usb/uhso: Don't bail out on first USB error. CID: 1305680 Submitted by: hselasky MFC after: 3 days Modified: stable/10/sys/dev/usb/net/uhso.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/uhso.c ============================================================================== --- stable/10/sys/dev/usb/net/uhso.c Sun Jun 5 14:31:36 2016 (r301445) +++ stable/10/sys/dev/usb/net/uhso.c Sun Jun 5 15:03:55 2016 (r301446) @@ -1223,6 +1223,7 @@ uhso_mux_write_callback(struct usb_xfer ht->ht_muxport); /* FALLTHROUGH */ case USB_ST_SETUP: +tr_setup: pc = usbd_xfer_get_frame(xfer, 1); if (ucom_get_data(&sc->sc_ucom[ht->ht_muxport], pc, 0, 32, &actlen)) { @@ -1253,7 +1254,8 @@ uhso_mux_write_callback(struct usb_xfer UHSO_DPRINTF(0, "error: %s\n", usbd_errstr(error)); if (error == USB_ERR_CANCELLED) break; - break; + usbd_xfer_set_stall(xfer); + goto tr_setup; } } From owner-svn-src-all@freebsd.org Sun Jun 5 15:05:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF965B6AE33; Sun, 5 Jun 2016 15:05:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A04171C49; Sun, 5 Jun 2016 15:05:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55F5rFb039902; Sun, 5 Jun 2016 15:05:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55F5rUI039901; Sun, 5 Jun 2016 15:05:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606051505.u55F5rUI039901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 5 Jun 2016 15:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301447 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 15:05:54 -0000 Author: pfg Date: Sun Jun 5 15:05:53 2016 New Revision: 301447 URL: https://svnweb.freebsd.org/changeset/base/301447 Log: MFC r301206: usb/uhso: Don't bail out on first USB error. CID: 1305680 Submitted by: hselasky MFC after: 3 days Modified: stable/9/sys/dev/usb/net/uhso.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/uhso.c ============================================================================== --- stable/9/sys/dev/usb/net/uhso.c Sun Jun 5 15:03:55 2016 (r301446) +++ stable/9/sys/dev/usb/net/uhso.c Sun Jun 5 15:05:53 2016 (r301447) @@ -1223,6 +1223,7 @@ uhso_mux_write_callback(struct usb_xfer ht->ht_muxport); /* FALLTHROUGH */ case USB_ST_SETUP: +tr_setup: pc = usbd_xfer_get_frame(xfer, 1); if (ucom_get_data(&sc->sc_ucom[ht->ht_muxport], pc, 0, 32, &actlen)) { @@ -1253,7 +1254,8 @@ uhso_mux_write_callback(struct usb_xfer UHSO_DPRINTF(0, "error: %s\n", usbd_errstr(error)); if (error == USB_ERR_CANCELLED) break; - break; + usbd_xfer_set_stall(xfer); + goto tr_setup; } } From owner-svn-src-all@freebsd.org Sun Jun 5 15:46:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE7AB6A640; Sun, 5 Jun 2016 15:46:15 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B6691CD9; Sun, 5 Jun 2016 15:46:15 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55FkE3E054901; Sun, 5 Jun 2016 15:46:14 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55FkEbp054900; Sun, 5 Jun 2016 15:46:14 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051546.u55FkEbp054900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 15:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301448 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 15:46:15 -0000 Author: ache Date: Sun Jun 5 15:46:14 2016 New Revision: 301448 URL: https://svnweb.freebsd.org/changeset/base/301448 Log: Reflect error indication according to POSIX and what those functions currently do. Modified: head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Sun Jun 5 15:05:53 2016 (r301447) +++ head/lib/libc/stdlib/random.3 Sun Jun 5 15:46:14 2016 (r301448) @@ -174,8 +174,8 @@ If .Fn initstate is called with less than 8 bytes of state information, or if .Fn setstate -detects that the state information has been garbled, error -messages are printed on the standard error output. +detects that the state information has been garbled, +NULL is returned. .Sh SEE ALSO .Xr arc4random 3 , .Xr lrand48 3 , From owner-svn-src-all@freebsd.org Sun Jun 5 15:57:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECC3B6AB0A; Sun, 5 Jun 2016 15:57:21 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECC5513D6; Sun, 5 Jun 2016 15:57:20 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55FvKc0058746; Sun, 5 Jun 2016 15:57:20 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55FvI0I058729; Sun, 5 Jun 2016 15:57:18 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606051557.u55FvI0I058729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 5 Jun 2016 15:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301449 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 15:57:21 -0000 Author: sjg Date: Sun Jun 5 15:57:18 2016 New Revision: 301449 URL: https://svnweb.freebsd.org/changeset/base/301449 Log: Import bmake-20160604 Interesting items from ChangeLog: o cached_realpath(): avoid hitting filesystem more than necessary. o meta.c: refactor need_meta decision, add knobs for missing meta file and filemon data wrt out-of-datedness. o meta.c: missing filemon data is only relevant if we read a meta file. Also do not return oodate for a missing metafile if gn->path points to .CURDIR Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/boot-strap vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make-bootstrap.sh.in vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/dpadd.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/meta.autodep.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/nonints.h vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/ChangeLog Sun Jun 5 15:57:18 2016 (r301449) @@ -1,3 +1,26 @@ +2016-06-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160604 + Merge with NetBSD make, pick up + o meta.c: missing filemon data is only relevant if we read a + meta file. + Also do not return oodate for a missing metafile if gn->path + points to .CURDIR + +2016-06-02 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160602 + Merge with NetBSD make, pick up + o cached_realpath(): avoid hitting filesystem more than necessary. + o meta.c: refactor need_meta decision, add knobs for + missing meta file and filemon data wrt out-of-datedness. + +2016-05-28 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160528 + + * boot-strap, make-bootstrap.sh.in: Makefile now uses _MAKE_VERSION + 2016-05-12 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160512 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/Makefile Sun Jun 5 15:57:18 2016 (r301449) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.63 2016/05/12 20:34:46 sjg Exp $ +# $Id: Makefile,v 1.66 2016/06/04 22:21:15 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160512 +_MAKE_VERSION= 20160604 PROG= bmake Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/bmake.1 Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ +.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd May 10, 2016 +.Dd June 2, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -846,7 +846,7 @@ Can affect the mode that .Nm runs in. It can contain a number of keywords: -.Bl -hang -width ignore-cmd +.Bl -hang -width missing-filemon=bf. .It Pa compat Like .Fl B , @@ -870,6 +870,17 @@ will not create .meta files in This can be overridden by setting .Va bf to a value which represents True. +.It Pa missing-meta= Ar bf +If +.Va bf +is True, then a missing .meta file makes the target out-of-date. +.It Pa missing-filemon= Ar bf +If +.Va bf +is True, then missing filemon data makes the target out-of-date. +.It Pa nofilemon +Do not use +.Xr filemon 4 . .It Pa env For debugging, it can be useful to include the environment in the .meta file. Modified: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Sun Jun 5 15:57:18 2016 (r301449) @@ -531,37 +531,51 @@ VVAARRIIAABBLLEE AASSSSIIGG mode that bbmmaakkee runs in. It can contain a number of key- words: - _c_o_m_p_a_t Like --BB, puts bbmmaakkee into "compat" mode. + _c_o_m_p_a_t Like --BB, puts bbmmaakkee into "compat" + mode. - _m_e_t_a Puts bbmmaakkee into "meta" mode, where meta files - are created for each target to capture the - command run, the output generated and if - filemon(4) is available, the system calls - which are of interest to bbmmaakkee. The captured - output can be very useful when diagnosing - errors. - - _c_u_r_d_i_r_O_k_= _b_f Normally bbmmaakkee will not create .meta files - in `_._C_U_R_D_I_R'. This can be overridden by set- - ting _b_f to a value which represents True. - - _e_n_v For debugging, it can be useful to include - the environment in the .meta file. - - _v_e_r_b_o_s_e If in "meta" mode, print a clue about the - target being built. This is useful if the - build is otherwise running silently. The - message printed the value of: - _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X. - - _i_g_n_o_r_e_-_c_m_d Some makefiles have commands which are simply - not stable. This keyword causes them to be - ignored for determining whether a target is - out of date in "meta" mode. See also - ..NNOOMMEETTAA__CCMMPP. + _m_e_t_a Puts bbmmaakkee into "meta" mode, where + meta files are created for each tar- + get to capture the command run, the + output generated and if filemon(4) + is available, the system calls which + are of interest to bbmmaakkee. The cap- + tured output can be very useful when + diagnosing errors. + + _c_u_r_d_i_r_O_k_= _b_f Normally bbmmaakkee will not create .meta + files in `_._C_U_R_D_I_R'. This can be + overridden by setting _b_f to a value + which represents True. + + _m_i_s_s_i_n_g_-_m_e_t_a_= _b_f If _b_f is True, then a missing .meta + file makes the target out-of-date. + + _m_i_s_s_i_n_g_-_f_i_l_e_m_o_n_= _b_f If _b_f is True, then missing filemon + data makes the target out-of-date. + + _n_o_f_i_l_e_m_o_n Do not use filemon(4). + + _e_n_v For debugging, it can be useful to + include the environment in the .meta + file. + + _v_e_r_b_o_s_e If in "meta" mode, print a clue + about the target being built. This + is useful if the build is otherwise + running silently. The message + printed the value of: + _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X. + + _i_g_n_o_r_e_-_c_m_d Some makefiles have commands which + are simply not stable. This keyword + causes them to be ignored for deter- + mining whether a target is out of + date in "meta" mode. See also + ..NNOOMMEETTAA__CCMMPP. - _s_i_l_e_n_t_= _b_f If _b_f is True, when a .meta file is created, - mark the target ..SSIILLEENNTT. + _s_i_l_e_n_t_= _b_f If _b_f is True, when a .meta file is + created, mark the target ..SSIILLEENNTT. _._M_A_K_E_._M_E_T_A_._B_A_I_L_I_W_I_C_K In "meta" mode, provides a list of prefixes which match @@ -1475,4 +1489,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 May 10, 2016 NetBSD 5.1 +NetBSD 5.1 June 2, 2016 NetBSD 5.1 Modified: vendor/NetBSD/bmake/dist/boot-strap ============================================================================== --- vendor/NetBSD/bmake/dist/boot-strap Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/boot-strap Sun Jun 5 15:57:18 2016 (r301449) @@ -111,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.48 2015/10/25 05:20:48 sjg Exp $ +# $Id: boot-strap,v 1.49 2016/05/29 00:09:14 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -451,7 +451,7 @@ op_all() { op_install else op_test - MAKE_VERSION=`sed -n '/^MAKE_VERSION/ { s,.*= *,,;p; }' $srcdir/Makefile` + MAKE_VERSION=`sed -n '/^_MAKE_VERSION/ { s,.*= *,,;p; }' $srcdir/Makefile` echo You can install by running: echo echo $0 $cmd_args op=install Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/main.c Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $ */ +/* $NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1014,7 +1014,7 @@ main(int argc, char **argv) /* * A relative path, canonicalize it. */ - p1 = realpath(argv[0], mdpath); + p1 = cached_realpath(argv[0], mdpath); if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) { p1 = argv[0]; /* realpath failed */ } @@ -1884,6 +1884,40 @@ usage(void) } +/* + * realpath(3) can get expensive, cache results... + */ +char * +cached_realpath(const char *pathname, char *resolved) +{ + static GNode *cache; + char *rp, *cp; + + if (!pathname || !pathname[0]) + return NULL; + + if (!cache) { + cache = Targ_NewGN("Realpath"); +#ifndef DEBUG_REALPATH_CACHE + cache->flags = INTERNAL; +#endif + } + + rp = Var_Value(pathname, cache, &cp); + if (rp) { + /* a hit */ + if (resolved) + strlcpy(resolved, rp, MAXPATHLEN); + else + resolved = bmake_strdup(rp); + } else { + if ((rp = realpath(pathname, resolved))) { + Var_Set(pathname, rp, cache, 0); + } + } + return rp ? resolved : NULL; +} + int PrintAddr(void *a, void *b) { Modified: vendor/NetBSD/bmake/dist/make-bootstrap.sh.in ============================================================================== --- vendor/NetBSD/bmake/dist/make-bootstrap.sh.in Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/make-bootstrap.sh.in Sun Jun 5 15:57:18 2016 (r301449) @@ -13,7 +13,7 @@ esac CC="@CC@" CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS} -DBMAKE_PATH_MAX=@bmake_path_max@" -MAKE_VERSION=`sed -n '/^MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile` +MAKE_VERSION=`sed -n '/^_MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile` MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \ -D@force_machine@MACHINE=\"@machine@\" -DMACHINE_ARCH=\"@machine_arch@\" \ Modified: vendor/NetBSD/bmake/dist/make.1 ============================================================================== --- vendor/NetBSD/bmake/dist/make.1 Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/make.1 Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ +.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd May 10, 2016 +.Dd June 2, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -846,7 +846,7 @@ Can affect the mode that .Nm runs in. It can contain a number of keywords: -.Bl -hang -width ignore-cmd +.Bl -hang -width missing-filemon=bf. .It Pa compat Like .Fl B , @@ -870,6 +870,17 @@ will not create .meta files in This can be overridden by setting .Va bf to a value which represents True. +.It Pa missing-meta= Ar bf +If +.Va bf +is True, then a missing .meta file makes the target out-of-date. +.It Pa missing-filemon= Ar bf +If +.Va bf +is True, then missing filemon data makes the target out-of-date. +.It Pa nofilemon +Do not use +.Xr filemon 4 . .It Pa env For debugging, it can be useful to include the environment in the .meta file. Modified: vendor/NetBSD/bmake/dist/make.h ============================================================================== --- vendor/NetBSD/bmake/dist/make.h Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/make.h Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.98 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: make.h,v 1.99 2016/06/03 01:21:59 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -199,6 +199,7 @@ typedef struct GNode { #define DONE_ALLSRC 0x40 /* We do it once only */ #define CYCLE 0x1000 /* Used by MakePrintStatus */ #define DONECYCLE 0x2000 /* Used by MakePrintStatus */ +#define INTERNAL 0x4000 /* Internal use only */ enum enum_made { UNMADE, DEFERRED, REQUESTED, BEINGMADE, MADE, UPTODATE, ERROR, ABORTED Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/meta.c Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.57 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.60 2016/06/04 22:17:14 sjg Exp $ */ /* * Implement 'meta' mode. @@ -73,6 +73,8 @@ static char *metaIgnorePathsStr; /* stri Boolean useMeta = FALSE; static Boolean useFilemon = FALSE; static Boolean writeMeta = FALSE; +static Boolean metaMissing = FALSE; /* oodate if missing */ +static Boolean filemonMissing = FALSE; /* oodate if missing */ static Boolean metaEnv = FALSE; /* don't save env unless asked */ static Boolean metaVerbose = FALSE; static Boolean metaIgnoreCMDs = FALSE; /* ignore CMDs in .meta files */ @@ -237,24 +239,13 @@ eat_dots(char *buf, size_t bufsz, int do static char * meta_name(struct GNode *gn, char *mname, size_t mnamelen, const char *dname, - const char *tname) + const char *tname, + const char *cwd) { char buf[MAXPATHLEN]; - char cwd[MAXPATHLEN]; char *rp; char *cp; char *tp; - char *p[4]; /* >= number of possible uses */ - int i; - - i = 0; - if (!dname) - dname = Var_Value(".OBJDIR", gn, &p[i++]); - if (!tname) - tname = Var_Value(TARGET, gn, &p[i++]); - - if (realpath(dname, cwd)) - dname = cwd; /* * Weed out relative paths from the target file name. @@ -264,7 +255,7 @@ meta_name(struct GNode *gn, char *mname, * basename as given to us. */ if ((cp = strrchr(tname, '/'))) { - if (realpath(tname, buf)) { + if (cached_realpath(tname, buf)) { if ((rp = strrchr(buf, '/'))) { rp++; cp++; @@ -309,9 +300,6 @@ meta_name(struct GNode *gn, char *mname, } } free(tp); - for (i--; i >= 0; i--) { - free(p[i]); - } return (mname); } @@ -391,29 +379,26 @@ printCMD(void *cmdp, void *mfpp) */ #define SKIP_META_TYPE(_type) do { \ if ((gn->type & __CONCAT(OP_, _type))) { \ - if (DEBUG(META)) { \ + if (verbose) { \ fprintf(debug_file, "Skipping meta for %s: .%s\n", \ gn->name, __STRING(_type)); \ } \ - return (NULL); \ + return FALSE; \ } \ } while (0) -static FILE * -meta_create(BuildMon *pbm, GNode *gn) + +/* + * Do we need/want a .meta file ? + */ +static Boolean +meta_needed(GNode *gn, const char *dname, const char *tname, + char *objdir, int verbose) { - meta_file_t mf; - char buf[MAXPATHLEN]; - char objdir[MAXPATHLEN]; - char **ptr; - const char *dname; - const char *tname; - char *fname; - const char *cp; - char *p[4]; /* >= possible uses */ - int i; struct stat fs; + if (verbose) + verbose = DEBUG(META); /* This may be a phony node which we don't want meta data for... */ /* Skip .meta for .BEGIN, .END, .ERROR etc as well. */ @@ -426,48 +411,70 @@ meta_create(BuildMon *pbm, GNode *gn) SKIP_META_TYPE(MAKE); } - mf.fp = NULL; - - i = 0; - - dname = Var_Value(".OBJDIR", gn, &p[i++]); - tname = Var_Value(TARGET, gn, &p[i++]); - - /* The object directory may not exist. Check it.. */ - if (stat(dname, &fs) != 0) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n", - gn->name); - goto out; - } /* Check if there are no commands to execute. */ if (Lst_IsEmpty(gn->commands)) { - if (DEBUG(META)) + if (verbose) fprintf(debug_file, "Skipping meta for %s: no commands\n", gn->name); - goto out; + return FALSE; + } + if ((gn->type & (OP_META|OP_SUBMAKE)) == OP_SUBMAKE) { + /* OP_SUBMAKE is a bit too aggressive */ + if (Lst_ForEach(gn->commands, is_submake, gn)) { + if (DEBUG(META)) + fprintf(debug_file, "Skipping meta for %s: .SUBMAKE\n", + gn->name); + return FALSE; + } + } + + /* The object directory may not exist. Check it.. */ + if (stat(dname, &fs) != 0) { + if (verbose) + fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n", + gn->name); + return FALSE; } /* make sure these are canonical */ - if (realpath(dname, objdir)) + if (cached_realpath(dname, objdir)) dname = objdir; /* If we aren't in the object directory, don't create a meta file. */ if (!metaCurdirOk && strcmp(curdir, dname) == 0) { - if (DEBUG(META)) + if (verbose) fprintf(debug_file, "Skipping meta for %s: .OBJDIR == .CURDIR\n", gn->name); - goto out; - } - if (!(gn->type & OP_META)) { - /* We do not generate .meta files for sub-makes */ - if (Lst_ForEach(gn->commands, is_submake, gn)) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: .MAKE\n", - gn->name); - goto out; - } + return FALSE; } + return TRUE; +} + + +static FILE * +meta_create(BuildMon *pbm, GNode *gn) +{ + meta_file_t mf; + char buf[MAXPATHLEN]; + char objdir[MAXPATHLEN]; + char **ptr; + const char *dname; + const char *tname; + char *fname; + const char *cp; + char *p[4]; /* >= possible uses */ + int i; + + mf.fp = NULL; + i = 0; + + dname = Var_Value(".OBJDIR", gn, &p[i++]); + tname = Var_Value(TARGET, gn, &p[i++]); + + /* if this succeeds objdir is realpath of dname */ + if (!meta_needed(gn, dname, tname, objdir, TRUE)) + goto out; + dname = objdir; if (metaVerbose) { char *mp; @@ -492,7 +499,7 @@ meta_create(BuildMon *pbm, GNode *gn) goto out; fname = meta_name(gn, pbm->meta_fname, sizeof(pbm->meta_fname), - dname, tname); + dname, tname, objdir); #ifdef DEBUG_META_MODE if (DEBUG(META)) @@ -561,6 +568,10 @@ meta_init(void) } +#define get_mode_bf(bf, token) \ + if ((cp = strstr(make_mode, token))) \ + bf = boolValue(&cp[sizeof(token) - 1]) + /* * Initialization we need after reading makefiles. */ @@ -583,17 +594,13 @@ meta_mode_init(const char *make_mode) writeMeta = FALSE; if (strstr(make_mode, "nofilemon")) useFilemon = FALSE; - if ((cp = strstr(make_mode, "curdirok="))) { - metaCurdirOk = boolValue(&cp[9]); - } - if ((cp = strstr(make_mode, "silent="))) { - metaSilent = boolValue(&cp[7]); - } if (strstr(make_mode, "ignore-cmd")) metaIgnoreCMDs = TRUE; - /* for backwards compatability */ - Var_Set(".MAKE.META_CREATED", "${.MAKE.META.CREATED}", VAR_GLOBAL, 0); - Var_Set(".MAKE.META_FILES", "${.MAKE.META.FILES}", VAR_GLOBAL, 0); + if (useFilemon) + get_mode_bf(filemonMissing, "missing-filemon="); + get_mode_bf(metaCurdirOk, "curdirok="); + get_mode_bf(metaMissing, "missing-meta="); + get_mode_bf(metaSilent, "silent="); } if (metaVerbose && !Var_Exists(MAKE_META_PREFIX, VAR_GLOBAL)) { /* @@ -921,6 +928,8 @@ meta_oodate(GNode *gn, Boolean oodate) char fname1[MAXPATHLEN]; char fname2[MAXPATHLEN]; char fname3[MAXPATHLEN]; + const char *dname; + const char *tname; char *p; char *cp; char *link_src; @@ -930,10 +939,23 @@ meta_oodate(GNode *gn, Boolean oodate) FILE *fp; Boolean needOODATE = FALSE; Lst missingFiles; - + char *pa[4]; /* >= possible uses */ + int i; + int have_filemon = FALSE; + if (oodate) return oodate; /* we're done */ + i = 0; + + dname = Var_Value(".OBJDIR", gn, &pa[i++]); + tname = Var_Value(TARGET, gn, &pa[i++]); + + /* if this succeeds fname3 is realpath of dname */ + if (!meta_needed(gn, dname, tname, fname3, FALSE)) + goto oodate_out; + dname = fname3; + missingFiles = Lst_Init(FALSE); /* @@ -944,7 +966,7 @@ meta_oodate(GNode *gn, Boolean oodate) */ Make_DoAllVar(gn); - meta_name(gn, fname, sizeof(fname), NULL, NULL); + meta_name(gn, fname, sizeof(fname), dname, tname, dname); #ifdef DEBUG_META_MODE if (DEBUG(META)) @@ -957,7 +979,6 @@ meta_oodate(GNode *gn, Boolean oodate) int lineno = 0; int lastpid = 0; int pid; - int f = 0; int x; LstNode ln; struct stat fs; @@ -996,13 +1017,13 @@ meta_oodate(GNode *gn, Boolean oodate) link_src = NULL; move_target = NULL; /* Find the start of the build monitor section. */ - if (!f) { + if (!have_filemon) { if (strncmp(buf, "-- filemon", 10) == 0) { - f = 1; + have_filemon = TRUE; continue; } if (strncmp(buf, "# buildmon", 10) == 0) { - f = 1; + have_filemon = TRUE; continue; } } @@ -1014,7 +1035,7 @@ meta_oodate(GNode *gn, Boolean oodate) fprintf(debug_file, "%s: %d: %s\n", fname, lineno, buf); #endif strsep(&p, " "); - if (f) { + if (have_filemon) { /* * We are in the 'filemon' output section. * Each record from filemon follows the general form: @@ -1239,7 +1260,7 @@ meta_oodate(GNode *gn, Boolean oodate) * they are _expected_ to change. */ if (*p == '/') { - realpath(p, fname1); /* clean it up */ + cached_realpath(p, fname1); /* clean it up */ if (Lst_ForEach(metaIgnorePaths, prefix_match, fname1)) { #ifdef DEBUG_META_MODE if (DEBUG(META)) @@ -1324,7 +1345,7 @@ meta_oodate(GNode *gn, Boolean oodate) oodate = TRUE; } else if (S_ISDIR(fs.st_mode)) { /* Update the latest directory. */ - realpath(p, latestdir); + cached_realpath(p, latestdir); } } else if (errno == ENOENT && *p == '/' && strncmp(p, cwd, cwdlen) != 0) { @@ -1434,12 +1455,27 @@ meta_oodate(GNode *gn, Boolean oodate) fname, (char *)Lst_Datum(Lst_First(missingFiles))); oodate = TRUE; } - } else { - if ((gn->type & OP_META)) { + if (!oodate && !have_filemon && filemonMissing) { if (DEBUG(META)) - fprintf(debug_file, "%s: required but missing\n", fname); + fprintf(debug_file, "%s: missing filemon data\n", fname); oodate = TRUE; } + } else { + if (writeMeta && metaMissing) { + cp = NULL; + + /* if target is in .CURDIR we do not need a meta file */ + if (gn->path && (cp = strrchr(gn->path, '/')) && cp > gn->path) { + if (strncmp(curdir, gn->path, (cp - gn->path)) != 0) { + cp = NULL; /* not in .CURDIR */ + } + } + if (!cp) { + if (DEBUG(META)) + fprintf(debug_file, "%s: required but missing\n", fname); + oodate = TRUE; + } + } } Lst_Destroy(missingFiles, (FreeProc *)free); @@ -1454,6 +1490,11 @@ meta_oodate(GNode *gn, Boolean oodate) Var_Set(OODATE, Var_Value(ALLSRC, gn, &cp), gn, 0); free(cp); } + + oodate_out: + for (i--; i >= 0; i--) { + free(pa[i]); + } return oodate; } Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Sun Jun 5 15:57:18 2016 (r301449) @@ -1,3 +1,16 @@ +2016-06-02 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160602 + * meta.autodep.mk: when passing META_FILES to gendirdeps.mk + do not apply :T to META_XTRAS + patch from Bryan Drewery at FreeBSD.org. + +2016-05-30 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160530 + * meta.stage.mk: we assume ${CLEANFILES} gets .NOPATH + make it so. + 2016-05-12 Simon J. Gerraty * install-mk (MK_VERSION): 20160512 Modified: vendor/NetBSD/bmake/dist/mk/dpadd.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dpadd.mk Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/mk/dpadd.mk Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -# $Id: dpadd.mk,v 1.21 2016/05/18 20:54:55 sjg Exp $ +# $Id: dpadd.mk,v 1.22 2016/05/31 23:30:59 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -100,7 +100,7 @@ __dpadd_libs := ${DPADD:M*/lib*} # Order -L's to search ours first. # Avoids picking up old versions already installed. -__dpadd_libdirs := ${__dpadd_libs}:R:H:S/^/-L/g:O:u:N-L} +__dpadd_libdirs := ${__dpadd_libs:R:H:S/^/-L/g:O:u:N-L} LDADD += ${__dpadd_libdirs:M-L${OBJTOP}/*} LDADD += ${__dpadd_libdirs:N-L${OBJTOP}/*:N-L${HOST_LIBDIR:U/usr/lib}} .if defined(HOST_LIBDIR) && ${HOST_LIBDIR} != "/usr/lib" Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/mk/install-mk Sun Jun 5 15:57:18 2016 (r301449) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.126 2016/05/18 20:54:55 sjg Exp $ +# $Id: install-mk,v 1.128 2016/06/03 17:22:32 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20160512 +MK_VERSION=20160602 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/meta.autodep.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.44 2016/04/07 17:00:38 sjg Exp $ +# $Id: meta.autodep.mk,v 1.45 2016/06/03 17:22:32 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -266,7 +266,7 @@ ${_DEPENDFILE}: ${_depend} ${.PARSEDIR}/ DPADD='${FORCE_DPADD:O:u}' ${_gendirdeps_mutex} \ MAKESYSPATH=${_makesyspath} \ ${.MAKE} -f gendirdeps.mk RELDIR=${RELDIR} _DEPENDFILE=${_DEPENDFILE} \ - META_FILES='${META_XTRAS:T:O:u} ${META_FILES:T:O:u:${META_FILE_FILTER:ts:}}') + META_FILES='${META_XTRAS:O:u} ${META_FILES:T:O:u:${META_FILE_FILTER:ts:}}') @test -s $@ && touch $@; : .endif Modified: vendor/NetBSD/bmake/dist/mk/meta.stage.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.stage.mk Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/mk/meta.stage.mk Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.44 2016/03/16 18:21:23 sjg Exp $ +# $Id: meta.stage.mk,v 1.45 2016/05/26 03:59:09 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -270,6 +270,8 @@ beforeinstall: .dirdep .NOPATH: ${STAGE_FILES} .if !empty(STAGE_TARGETS) +.NOPATH: ${CLEANFILES} + MK_STALE_STAGED?= no .if ${MK_STALE_STAGED} == "yes" all: stale_staged Modified: vendor/NetBSD/bmake/dist/nonints.h ============================================================================== --- vendor/NetBSD/bmake/dist/nonints.h Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/nonints.h Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.72 2016/02/18 20:25:08 sjg Exp $ */ +/* $NetBSD: nonints.h,v 1.73 2016/06/03 01:21:59 sjg Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -122,6 +122,7 @@ void execError(const char *, const char char *getTmpdir(void); Boolean s2Boolean(const char *, Boolean); Boolean getBoolean(const char *, Boolean); +char *cached_realpath(const char *, char *); /* parse.c */ void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); Modified: vendor/NetBSD/bmake/dist/var.c ============================================================================== --- vendor/NetBSD/bmake/dist/var.c Sun Jun 5 15:46:14 2016 (r301448) +++ vendor/NetBSD/bmake/dist/var.c Sun Jun 5 15:57:18 2016 (r301449) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $ */ +/* $NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"); +__RCSID("$NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -530,7 +530,7 @@ VarAdd(const char *name, const char *val h = Hash_CreateEntry(&ctxt->context, name, NULL); Hash_SetValue(h, v); v->name = h->name; - if (DEBUG(VAR)) { + if (DEBUG(VAR) && (ctxt->flags & INTERNAL) == 0) { fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name, val); } } @@ -1950,7 +1950,7 @@ VarRealpath(GNode *ctx MAKE_ATTR_UNUSED, Buf_AddByte(buf, vpstate->varSpace); } addSpace = TRUE; - rp = realpath(word, rbuf); + rp = cached_realpath(word, rbuf); if (rp && *rp == '/' && stat(rp, &st) == 0) word = rp; From owner-svn-src-all@freebsd.org Sun Jun 5 15:57:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86896B6AB3B; Sun, 5 Jun 2016 15:57:33 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 400C0168C; Sun, 5 Jun 2016 15:57:33 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55FvWAP058797; Sun, 5 Jun 2016 15:57:32 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55FvWG5058796; Sun, 5 Jun 2016 15:57:32 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606051557.u55FvWG5058796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 5 Jun 2016 15:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301450 - vendor/NetBSD/bmake/20160604 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 15:57:33 -0000 Author: sjg Date: Sun Jun 5 15:57:32 2016 New Revision: 301450 URL: https://svnweb.freebsd.org/changeset/base/301450 Log: tag bmake-20160604 Added: vendor/NetBSD/bmake/20160604/ - copied from r301449, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Sun Jun 5 16:07:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC72BB6AFCE; Sun, 5 Jun 2016 16:07:58 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B73F81ECA; Sun, 5 Jun 2016 16:07:58 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55G7vfD062395; Sun, 5 Jun 2016 16:07:57 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55G7vUg062390; Sun, 5 Jun 2016 16:07:57 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201606051607.u55G7vUg062390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 5 Jun 2016 16:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301451 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 16:07:59 -0000 Author: skra Date: Sun Jun 5 16:07:57 2016 New Revision: 301451 URL: https://svnweb.freebsd.org/changeset/base/301451 Log: (1) Add a new bus method to get a mapping data for an interrupt. BUS_MAP_INTR() is used to get an interrupt mapping data according to provided hints. The hints could be modified afterwards, but only if mapping data was allocated. This method is intended to be called before BUS_ALLOC_RESOURCE(). An interrupt mapping data describes an interrupt - hardware number, type, configuration, cpu binding, and whatever is needed to setup it. (2) Introduce a method which allows storing of an additional data in struct resource to be available for bus drivers. This method is convenient in two ways: - there is no need to rework existing bus drivers as they can simply be extended to provide an additional data, - there is no need to modify any existing bus methods as struct resource is already passed to them as argument and thus stored data is simply accessible by other bus drivers. For now, implement this method only for INTRNG. This is motivated by needs of modern SOCs where hardware initialization is not straightforward and resources descriptions are complex, opaque for everyone but provider, and may vary from SOC to SOC. Typical situation is that one bus driver can fetch a resource description for its child device, but it's opaque for this driver. Another bus driver knows a provider for this kind of resource and can pass this resource description to it. In fact, something like device IVARS would be perfect for that if implemented generally enough. Unfortunatelly, IVARS are usable only by their owners now. Only owner knows its IVARS layout, thus other bus drivers are not able to use them. Differential Revision: https://reviews.freebsd.org/D6632 Modified: head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/kern/subr_intr.c head/sys/sys/bus.h head/sys/sys/intr.h Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Sun Jun 5 15:57:32 2016 (r301450) +++ head/sys/kern/bus_if.m Sun Jun 5 16:07:57 2016 (r301451) @@ -418,6 +418,35 @@ METHOD int release_resource { }; /** + * @brief Map an interrupt + * + * This method is used to get an interrupt mapping data according to provided + * hints. The hints could be modified afterwards, but only if mapping data was + * allocated. This method is intended to be called before BUS_ALLOC_RESOURCE(). + * + * @param _dev the parent device of @p _child + * @param _child the device which is requesting an allocation + * @param _rid a pointer to the resource identifier + * @param _start a pointer to the hint at the start of the resource + * range - pass @c 0 for any start address + * @param _end a pointer to the hint at the end of the resource + * range - pass @c ~0 for any end address + * @param _count a pointer to the hint at the size of resource + * range required - pass @c 1 for any size + * @param _imd a pointer to the interrupt mapping data which was + * allocated + */ +METHOD int map_intr { + device_t _dev; + device_t _child; + int *_rid; + rman_res_t *_start; + rman_res_t *_end; + rman_res_t *_count; + struct intr_map_data **_imd; +} DEFAULT bus_generic_map_intr; + +/** * @brief Install an interrupt handler * * This method is used to associate an interrupt handler function with Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Jun 5 15:57:32 2016 (r301450) +++ head/sys/kern/subr_bus.c Sun Jun 5 16:07:57 2016 (r301451) @@ -3951,6 +3951,23 @@ bus_generic_new_pass(device_t dev) } /** + * @brief Helper function for implementing BUS_MAP_INTR(). + * + * This simple implementation of BUS_MAP_INTR() simply calls the + * BUS_MAP_INTR() method of the parent of @p dev. + */ +int +bus_generic_map_intr(device_t dev, device_t child, int *rid, rman_res_t *start, + rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) +{ + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_MAP_INTR(dev->parent, child, rid, start, end, count, + imd)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_SETUP_INTR(). * * This simple implementation of BUS_SETUP_INTR() simply calls the @@ -4405,6 +4422,41 @@ bus_release_resources(device_t dev, cons } } +#ifdef INTRNG +/** + * @internal + * + * This can be converted to bus method later. (XXX) + */ +static struct intr_map_data * +bus_extend_resource(device_t dev, int type, int *rid, rman_res_t *start, + rman_res_t *end, rman_res_t *count) +{ + struct intr_map_data *imd; + struct resource_list *rl; + int rv; + + if (dev->parent == NULL) + return (NULL); + if (type != SYS_RES_IRQ) + return (NULL); + + if (!RMAN_IS_DEFAULT_RANGE(*start, *end)) + return (NULL); + rl = BUS_GET_RESOURCE_LIST(dev->parent, dev); + if (rl != NULL) { + if (resource_list_find(rl, type, *rid) != NULL) + return (NULL); + } + rv = BUS_MAP_INTR(dev->parent, dev, rid, start, end, count, &imd); + if (rv != 0) + return (NULL); + if (rl != NULL) + resource_list_add(rl, type, *rid, *start, *end, *count); + return (imd); +} +#endif + /** * @brief Wrapper function for BUS_ALLOC_RESOURCE(). * @@ -4412,13 +4464,31 @@ bus_release_resources(device_t dev, cons * parent of @p dev. */ struct resource * -bus_alloc_resource(device_t dev, int type, int *rid, rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags) +bus_alloc_resource(device_t dev, int type, int *rid, rman_res_t start, + rman_res_t end, rman_res_t count, u_int flags) { + struct resource *res; +#ifdef INTRNG + struct intr_map_data *imd; +#endif + if (dev->parent == NULL) return (NULL); - return (BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end, - count, flags)); + +#ifdef INTRNG + imd = bus_extend_resource(dev, type, rid, &start, &end, &count); +#endif + res = BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end, + count, flags); +#ifdef INTRNG + if (imd != NULL) { + if (res != NULL && rman_get_virtual(res) == NULL) + rman_set_virtual(res, imd); + else + imd->destruct(imd); + } +#endif + return (res); } /** @@ -4503,9 +4573,23 @@ bus_unmap_resource(device_t dev, int typ int bus_release_resource(device_t dev, int type, int rid, struct resource *r) { + int rv; +#ifdef INTRNG + struct intr_map_data *imd; +#endif + if (dev->parent == NULL) return (EINVAL); - return (BUS_RELEASE_RESOURCE(dev->parent, dev, type, rid, r)); + +#ifdef INTRNG + imd = (type == SYS_RES_IRQ) ? rman_get_virtual(r) : NULL; +#endif + rv = BUS_RELEASE_RESOURCE(dev->parent, dev, type, rid, r); +#ifdef INTRNG + if (imd != NULL) + imd->destruct(imd); +#endif + return (rv); } /** Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Sun Jun 5 15:57:32 2016 (r301450) +++ head/sys/kern/subr_intr.c Sun Jun 5 16:07:57 2016 (r301451) @@ -560,7 +560,6 @@ intr_ddata_alloc(u_int extsize) mtx_unlock(&isrc_table_lock); ddata->idd_data = (struct intr_map_data *)((uintptr_t)ddata + size); - ddata->idd_data->size = extsize; return (ddata); } Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sun Jun 5 15:57:32 2016 (r301450) +++ head/sys/sys/bus.h Sun Jun 5 16:07:57 2016 (r301451) @@ -272,6 +272,17 @@ enum intr_polarity { INTR_POLARITY_LOW = 2 }; +enum intr_map_data_type { + INTR_MAP_DATA_ACPI, + INTR_MAP_DATA_FDT, + INTR_MAP_DATA_GPIO, +}; + +struct intr_map_data { + enum intr_map_data_type type; + void (*destruct)(struct intr_map_data *); +}; + /** * CPU sets supported by bus_get_cpus(). Note that not all sets may be * supported for a given device. If a request is not supported by a @@ -448,6 +459,9 @@ int bus_generic_release_resource(device_ int type, int rid, struct resource *r); int bus_generic_resume(device_t dev); int bus_generic_resume_child(device_t dev, device_t child); +int bus_generic_map_intr(device_t dev, device_t child, int *rid, + rman_res_t *start, rman_res_t *end, + rman_res_t *count, struct intr_map_data **imd); int bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *intr, Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Sun Jun 5 15:57:32 2016 (r301450) +++ head/sys/sys/intr.h Sun Jun 5 16:07:57 2016 (r301451) @@ -34,17 +34,6 @@ #define INTR_IRQ_INVALID 0xFFFFFFFF -enum intr_map_data_type { - INTR_MAP_DATA_ACPI, - INTR_MAP_DATA_FDT, - INTR_MAP_DATA_GPIO, -}; - -struct intr_map_data { - enum intr_map_data_type type; - size_t size; -}; - #ifdef DEV_ACPI struct intr_map_data_acpi { struct intr_map_data hdr; From owner-svn-src-all@freebsd.org Sun Jun 5 16:09:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1757B6A057; Sun, 5 Jun 2016 16:09:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83A6D1069; Sun, 5 Jun 2016 16:09:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55G9Vrr062554; Sun, 5 Jun 2016 16:09:31 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55G9VDr062553; Sun, 5 Jun 2016 16:09:31 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606051609.u55G9VDr062553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 5 Jun 2016 16:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301452 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 16:09:32 -0000 Author: jilles Date: Sun Jun 5 16:09:31 2016 New Revision: 301452 URL: https://svnweb.freebsd.org/changeset/base/301452 Log: sh: Improve descriptions in 'ulimit -a' output. The format limits descriptions to 18 characters and is not changed, so the descriptions do not describe the limits exactly. Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sun Jun 5 16:07:57 2016 (r301451) +++ head/bin/sh/miscbltin.c Sun Jun 5 16:09:31 2016 (r301452) @@ -406,7 +406,7 @@ static const struct limits limits[] = { { "swap limit", "kbytes", RLIMIT_SWAP, 1024, 'w' }, #endif #ifdef RLIMIT_SBSIZE - { "sbsize", "bytes", RLIMIT_SBSIZE, 1, 'b' }, + { "socket buffer size", "bytes", RLIMIT_SBSIZE, 1, 'b' }, #endif #ifdef RLIMIT_NPTS { "pseudo-terminals", (char *)0, RLIMIT_NPTS, 1, 'p' }, @@ -415,7 +415,7 @@ static const struct limits limits[] = { { "kqueues", (char *)0, RLIMIT_KQUEUES, 1, 'k' }, #endif #ifdef RLIMIT_UMTXP - { "umtxp", (char *)0, RLIMIT_UMTXP, 1, 'o' }, + { "umtx shared locks", (char *)0, RLIMIT_UMTXP, 1, 'o' }, #endif { (char *) 0, (char *)0, 0, 0, '\0' } }; From owner-svn-src-all@freebsd.org Sun Jun 5 16:20:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE7BB6A31A; Sun, 5 Jun 2016 16:20:15 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45FA516D3; Sun, 5 Jun 2016 16:20:15 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55GKE3H066416; Sun, 5 Jun 2016 16:20:14 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55GKD5S066398; Sun, 5 Jun 2016 16:20:13 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201606051620.u55GKD5S066398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 5 Jun 2016 16:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 16:20:15 -0000 Author: skra Date: Sun Jun 5 16:20:12 2016 New Revision: 301453 URL: https://svnweb.freebsd.org/changeset/base/301453 Log: INTRNG - change the way how an interrupt mapping data are provided to the framework in OFW (FDT) case. This is a follow-up to r301451. Differential Revision: https://reviews.freebsd.org/D6634 Modified: head/sys/arm/arm/nexus.c head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/nexus.c head/sys/dev/fdt/simplebus.c head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/iicbus/ofw_iicbus.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/ofw/ofwbus.c head/sys/dev/pci/pci_host_generic.c head/sys/dev/vnic/mrml_bridge.c head/sys/dev/vnic/thunder_mdio_fdt.c head/sys/kern/subr_intr.c head/sys/mips/mips/nexus.c head/sys/sys/intr.h Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/arm/arm/nexus.c Sun Jun 5 16:20:12 2016 (r301453) @@ -412,6 +412,10 @@ nexus_ofw_map_intr(device_t dev, device_ pcell_t *intr) { +#ifdef INTRNG + return (INTR_IRQ_INVALID); +#else return (intr_fdt_map_irq(iparent, intr, icells)); +#endif } #endif Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/arm64/arm64/gic_v3.c Sun Jun 5 16:20:12 2016 (r301453) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#endif + #include "pic_if.h" #include "gic_v3_reg.h" Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/arm64/arm64/nexus.c Sun Jun 5 16:20:12 2016 (r301453) @@ -448,7 +448,7 @@ nexus_ofw_map_intr(device_t dev, device_ pcell_t *intr) { #ifdef INTRNG - return (intr_fdt_map_irq(iparent, intr, icells)); + return (INTR_IRQ_INVALID); #else int irq; Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/fdt/simplebus.c Sun Jun 5 16:20:12 2016 (r301453) @@ -251,7 +251,9 @@ simplebus_setup_dinfo(device_t dev, phan resource_list_init(&ndi->rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &ndi->rl); +#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &ndi->rl, NULL); +#endif return (ndi); } Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/gpio/ofw_gpiobus.c Sun Jun 5 16:20:12 2016 (r301453) @@ -321,11 +321,13 @@ ofw_gpiobus_setup_devinfo(device_t bus, devi->pins[i] = pins[i].pin; } free(pins, M_DEVBUF); +#ifndef INTRNG /* Parse the interrupt resources. */ if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) { ofw_gpiobus_destroy_devinfo(bus, dinfo); return (NULL); } +#endif device_set_ivars(child, dinfo); return (dinfo); Modified: head/sys/dev/iicbus/ofw_iicbus.c ============================================================================== --- head/sys/dev/iicbus/ofw_iicbus.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/iicbus/ofw_iicbus.c Sun Jun 5 16:20:12 2016 (r301453) @@ -187,8 +187,10 @@ ofw_iicbus_attach(device_t dev) childdev = device_add_child(dev, NULL, -1); resource_list_init(&dinfo->opd_dinfo.rl); +#ifndef INTRNG ofw_bus_intr_to_rl(childdev, child, &dinfo->opd_dinfo.rl, NULL); +#endif device_set_ivars(childdev, dinfo); } Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/ofw/ofw_bus_subr.c Sun Jun 5 16:20:12 2016 (r301453) @@ -516,6 +516,7 @@ ofw_bus_find_iparent(phandle_t node) return (iparent); } +#ifndef INTRNG int ofw_bus_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl, int *rlen) @@ -581,6 +582,78 @@ ofw_bus_intr_to_rl(device_t dev, phandle free(intr, M_OFWPROP); return (err); } +#endif + +int +ofw_bus_intr_by_rid(device_t dev, phandle_t node, int wanted_rid, + phandle_t *producer, int *ncells, pcell_t **cells) +{ + phandle_t iparent; + uint32_t icells, *intr; + int err, i, nintr, rid; + boolean_t extended; + + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + iparent = ofw_bus_find_iparent(node); + if (iparent == 0) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + iparent = OF_xref_from_node(iparent); + } + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells " + "property, assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } + extended = false; + } else { + nintr = OF_getencprop_alloc(node, "interrupts-extended", + sizeof(*intr), (void **)&intr); + if (nintr <= 0) + return (ESRCH); + extended = true; + } + err = ESRCH; + rid = 0; + for (i = 0; i < nintr; i += icells, rid++) { + if (extended) { + iparent = intr[i++]; + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells " + "property\n"); + err = ENOENT; + break; + } + if (icells < 1 || (i + icells) > nintr) { + device_printf(dev, "Invalid #interrupt-cells " + "property value <%d>\n", icells); + err = ERANGE; + break; + } + } + if (rid == wanted_rid) { + *cells = malloc(icells * sizeof(**cells), M_OFWPROP, + M_WAITOK); + *producer = iparent; + *ncells= icells; + memcpy(*cells, intr + i, icells * sizeof(**cells)); + err = 0; + break; + } + } + free(intr, M_OFWPROP); + return (err); +} phandle_t ofw_bus_find_child(phandle_t start, const char *child_name) Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Jun 5 16:20:12 2016 (r301453) @@ -52,6 +52,13 @@ struct ofw_compat_data { uintptr_t ocd_data; }; +struct intr_map_data_fdt { + struct intr_map_data hdr; + phandle_t iparent; + u_int ncells; + pcell_t *cells; +}; + #define SIMPLEBUS_PNP_DESCR "Z:compat;P:private;" #define SIMPLEBUS_PNP_INFO(t) \ MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); @@ -82,7 +89,11 @@ int ofw_bus_msimap(phandle_t, uint16_t, /* Routines for parsing device-tree data into resource lists. */ int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t, struct resource_list *); +#ifndef INTRNG int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *, int *); +#endif +int ofw_bus_intr_by_rid(device_t, phandle_t, int, phandle_t *, int *, + pcell_t **); /* Helper to get device status property */ const char *ofw_bus_get_status(device_t dev); Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/ofw/ofwbus.c Sun Jun 5 16:20:12 2016 (r301453) @@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INTRNG +#include +#endif #include #include @@ -77,6 +80,9 @@ static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; static bus_adjust_resource_t ofwbus_adjust_resource; static bus_release_resource_t ofwbus_release_resource; +#ifdef INTRNG +static bus_map_intr_t ofwbus_map_intr; +#endif static device_method_t ofwbus_methods[] = { /* Device interface */ @@ -90,6 +96,9 @@ static device_method_t ofwbus_methods[] DEVMETHOD(bus_alloc_resource, ofwbus_alloc_resource), DEVMETHOD(bus_adjust_resource, ofwbus_adjust_resource), DEVMETHOD(bus_release_resource, ofwbus_release_resource), +#ifdef INTRNG + DEVMETHOD(bus_map_intr, ofwbus_map_intr), +#endif DEVMETHOD_END }; @@ -290,3 +299,53 @@ ofwbus_release_resource(device_t bus, de } return (rman_release_resource(r)); } + +#ifdef INTRNG +static void +ofwbus_destruct_map_data(struct intr_map_data *map_data) +{ + struct intr_map_data_fdt *fdt_map_data; + + KASSERT(map_data->type == INTR_MAP_DATA_FDT, + ("%s: bad map_data type %d", __func__, map_data->type)); + + fdt_map_data = (struct intr_map_data_fdt *)map_data; + OF_prop_free(fdt_map_data->cells); + free(fdt_map_data, M_OFWPROP); +} + +static int +ofwbus_map_intr(device_t bus, device_t child, int *rid, rman_res_t *start, + rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) +{ + phandle_t iparent, node; + pcell_t *cells; + int ncells, rv; + u_int irq; + struct intr_map_data_fdt *fdt_data; + + node = ofw_bus_get_node(child); + rv = ofw_bus_intr_by_rid(child, node, *rid, &iparent, &ncells, &cells); + if (rv != 0) + return (rv); + + fdt_data = malloc(sizeof(*fdt_data), M_OFWPROP, M_WAITOK | M_ZERO); + fdt_data->hdr.type = INTR_MAP_DATA_FDT; + fdt_data->hdr.destruct = ofwbus_destruct_map_data; + fdt_data->iparent = iparent; + fdt_data->ncells = ncells; + fdt_data->cells = cells; + rv = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data, + &irq); + if (rv != 0) { + ofwbus_destruct_map_data((struct intr_map_data *)fdt_data); + return (rv); + } + + *start = irq; + *end = irq; + *count = 1; + *imd = (struct intr_map_data *)fdt_data; + return (0); +} +#endif Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/pci/pci_host_generic.c Sun Jun 5 16:20:12 2016 (r301453) @@ -949,7 +949,9 @@ generic_pcie_ofw_bus_attach(device_t dev resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, &di->di_rl); +#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); +#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/dev/vnic/mrml_bridge.c ============================================================================== --- head/sys/dev/vnic/mrml_bridge.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/vnic/mrml_bridge.c Sun Jun 5 16:20:12 2016 (r301453) @@ -263,7 +263,9 @@ mrmlb_ofw_bus_attach(device_t dev) resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &di->di_rl); +#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); +#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/dev/vnic/thunder_mdio_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_mdio_fdt.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/dev/vnic/thunder_mdio_fdt.c Sun Jun 5 16:20:12 2016 (r301453) @@ -271,7 +271,9 @@ mdionexus_ofw_bus_attach(device_t dev) resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &di->di_rl); +#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); +#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/kern/subr_intr.c Sun Jun 5 16:20:12 2016 (r301453) @@ -64,12 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef FDT -#include -#include -#include -#endif - #ifdef DDB #include #endif @@ -625,33 +619,6 @@ intr_acpi_map_irq(device_t dev, u_int ir return (ddata->idd_irq); } #endif -#ifdef FDT -/* - * Map interrupt source according to FDT data into framework. If such mapping - * does not exist, create it. Return unique interrupt number (resource handle) - * associated with mapped interrupt source. - */ -u_int -intr_fdt_map_irq(phandle_t node, pcell_t *cells, u_int ncells) -{ - size_t cellsize; - struct intr_dev_data *ddata; - struct intr_map_data_fdt *daf; - - cellsize = ncells * sizeof(*cells); - ddata = intr_ddata_alloc(sizeof(struct intr_map_data_fdt) + cellsize); - if (ddata == NULL) - return (INTR_IRQ_INVALID); /* no space left */ - - ddata->idd_xref = (intptr_t)node; - ddata->idd_data->type = INTR_MAP_DATA_FDT; - - daf = (struct intr_map_data_fdt *)ddata->idd_data; - daf->ncells = ncells; - memcpy(daf->cells, cells, cellsize); - return (ddata->idd_irq); -} -#endif /* * Store GPIO interrupt decription in framework and return unique interrupt @@ -1107,7 +1074,11 @@ intr_alloc_irq(device_t dev, struct reso KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = intr_ddata_lookup(rman_get_start(res), &data); + data = rman_get_virtual(res); + if (data == NULL) + isrc = intr_ddata_lookup(rman_get_start(res), &data); + else + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL) return (EINVAL); @@ -1123,7 +1094,11 @@ intr_release_irq(device_t dev, struct re KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = intr_ddata_lookup(rman_get_start(res), &data); + data = rman_get_virtual(res); + if (data == NULL) + isrc = intr_ddata_lookup(rman_get_start(res), &data); + else + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL) return (EINVAL); @@ -1142,7 +1117,11 @@ intr_setup_irq(device_t dev, struct reso KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = intr_ddata_lookup(rman_get_start(res), &data); + data = rman_get_virtual(res); + if (data == NULL) + isrc = intr_ddata_lookup(rman_get_start(res), &data); + else + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL) return (EINVAL); @@ -1202,7 +1181,11 @@ intr_teardown_irq(device_t dev, struct r KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = intr_ddata_lookup(rman_get_start(res), &data); + data = rman_get_virtual(res); + if (data == NULL) + isrc = intr_ddata_lookup(rman_get_start(res), &data); + else + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/mips/mips/nexus.c Sun Jun 5 16:20:12 2016 (r301453) @@ -524,7 +524,11 @@ nexus_ofw_map_intr(device_t dev, device_ pcell_t *intr) { +#ifdef INTRNG + return (INTR_IRQ_INVALID); +#else return (intr_fdt_map_irq(iparent, intr, icells)); +#endif } #endif #endif /* INTRNG */ Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Sun Jun 5 16:09:31 2016 (r301452) +++ head/sys/sys/intr.h Sun Jun 5 16:20:12 2016 (r301453) @@ -42,13 +42,6 @@ struct intr_map_data_acpi { enum intr_trigger trig; }; #endif -#ifdef FDT -struct intr_map_data_fdt { - struct intr_map_data hdr; - u_int ncells; - pcell_t cells[0]; -}; -#endif struct intr_map_data_gpio { struct intr_map_data hdr; @@ -135,9 +128,7 @@ int intr_release_msix(device_t, device_t u_int intr_acpi_map_irq(device_t, u_int, enum intr_polarity, enum intr_trigger); #endif -#ifdef FDT -u_int intr_fdt_map_irq(phandle_t, pcell_t *, u_int); -#endif + u_int intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, u_int intr_mode); From owner-svn-src-all@freebsd.org Sun Jun 5 16:21:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD28FB6A493; Sun, 5 Jun 2016 16:21:54 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5EB198E; Sun, 5 Jun 2016 16:21:54 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55GLrog069697; Sun, 5 Jun 2016 16:21:53 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55GLrXl069696; Sun, 5 Jun 2016 16:21:53 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051621.u55GLrXl069696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 16:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301454 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 16:21:54 -0000 Author: ache Date: Sun Jun 5 16:21:53 2016 New Revision: 301454 URL: https://svnweb.freebsd.org/changeset/base/301454 Log: MFC: r301448 Reflect error indication according to POSIX and what those functions currently do. Modified: stable/10/lib/libc/stdlib/random.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/random.3 ============================================================================== --- stable/10/lib/libc/stdlib/random.3 Sun Jun 5 16:20:12 2016 (r301453) +++ stable/10/lib/libc/stdlib/random.3 Sun Jun 5 16:21:53 2016 (r301454) @@ -175,8 +175,8 @@ If .Fn initstate is called with less than 8 bytes of state information, or if .Fn setstate -detects that the state information has been garbled, error -messages are printed on the standard error output. +detects that the state information has been garbled, +NULL is returned. .Sh SEE ALSO .Xr arc4random 3 , .Xr lrand48 3 , From owner-svn-src-all@freebsd.org Sun Jun 5 16:55:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0BD1B693CA; Sun, 5 Jun 2016 16:55:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD4321712; Sun, 5 Jun 2016 16:55:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55Gtt4s081950; Sun, 5 Jun 2016 16:55:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55Gtt7P081949; Sun, 5 Jun 2016 16:55:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606051655.u55Gtt7P081949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Jun 2016 16:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301455 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 16:55:57 -0000 Author: kib Date: Sun Jun 5 16:55:55 2016 New Revision: 301455 URL: https://svnweb.freebsd.org/changeset/base/301455 Log: Use ANSI function definition. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Jun 5 16:21:53 2016 (r301454) +++ head/sys/kern/kern_proc.c Sun Jun 5 16:55:55 2016 (r301455) @@ -168,7 +168,7 @@ CTASSERT(sizeof(struct kinfo_proc32) == * Initialize global process hashing structures. */ void -procinit() +procinit(void) { sx_init(&allproc_lock, "allproc"); From owner-svn-src-all@freebsd.org Sun Jun 5 17:04:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5892B69ADE; Sun, 5 Jun 2016 17:04:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1E881027; Sun, 5 Jun 2016 17:04:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55H447Z085763; Sun, 5 Jun 2016 17:04:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55H44sN085754; Sun, 5 Jun 2016 17:04:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606051704.u55H44sN085754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Jun 2016 17:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301456 - in head/sys: kern mips/mips sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 17:04:05 -0000 Author: kib Date: Sun Jun 5 17:04:03 2016 New Revision: 301456 URL: https://svnweb.freebsd.org/changeset/base/301456 Log: Get rid of struct proc p_sched and struct thread td_sched pointers. p_sched is unused. The struct td_sched is always co-allocated with the struct thread, except for the thread0. Avoid useless indirection, instead calculate td_sched location using simple pointer arithmetic in td_get_sched(9). For thread0, which is statically allocated, create a structure to emulate layout of the dynamic allocation. Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D6711 Modified: head/sys/kern/init_main.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/kern/kern_synch.c head/sys/kern/kern_thread.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/mips/mips/locore.S head/sys/sys/proc.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/kern/init_main.c Sun Jun 5 17:04:03 2016 (r301456) @@ -99,7 +99,7 @@ void mi_startup(void); /* Should be e static struct session session0; static struct pgrp pgrp0; struct proc proc0; -struct thread thread0 __aligned(16); +struct thread0_storage thread0_st __aligned(16); struct vmspace vmspace0; struct proc *initproc; Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/kern/kern_fork.c Sun Jun 5 17:04:03 2016 (r301456) @@ -1011,7 +1011,7 @@ fork_exit(void (*callout)(void *, struct KASSERT(p->p_state == PRS_NORMAL, ("executing process is still new")); CTR4(KTR_PROC, "fork_exit: new thread %p (td_sched %p, pid %d, %s)", - td, td->td_sched, p->p_pid, td->td_name); + td, td_get_sched(td), p->p_pid, td->td_name); sched_fork_exit(td); /* Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/kern/kern_proc.c Sun Jun 5 17:04:03 2016 (r301456) @@ -237,7 +237,6 @@ proc_init(void *mem, int size, int flags p = (struct proc *)mem; SDT_PROBE3(proc, , init, entry, p, size, flags); - p->p_sched = (struct p_sched *)&p[1]; mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW); mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_NEW); mtx_init(&p->p_statmtx, "pstatl", NULL, MTX_SPIN | MTX_NEW); Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/kern/kern_synch.c Sun Jun 5 17:04:03 2016 (r301456) @@ -441,7 +441,7 @@ mi_switch(int flags, struct thread *newt PCPU_INC(cnt.v_swtch); PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)", - td->td_tid, td->td_sched, td->td_proc->p_pid, td->td_name); + td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); #if (KTR_COMPILE & KTR_SCHED) != 0 if (TD_IS_IDLETHREAD(td)) KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", @@ -457,7 +457,7 @@ mi_switch(int flags, struct thread *newt "prio:%d", td->td_priority); CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)", - td->td_tid, td->td_sched, td->td_proc->p_pid, td->td_name); + td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); /* * If the last thread was exiting, finish cleaning it up. Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/kern/kern_thread.c Sun Jun 5 17:04:03 2016 (r301456) @@ -211,7 +211,6 @@ thread_init(void *mem, int size, int fla td->td_turnstile = turnstile_alloc(); td->td_rlqe = NULL; EVENTHANDLER_INVOKE(thread_init, td); - td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); td->td_kstack = 0; td->td_sel = NULL; Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/kern/sched_4bsd.c Sun Jun 5 17:04:03 2016 (r301456) @@ -117,7 +117,10 @@ struct td_sched { #define THREAD_CAN_SCHED(td, cpu) \ CPU_ISSET((cpu), &(td)->td_cpuset->cs_mask) -static struct td_sched td_sched0; +_Static_assert(sizeof(struct thread) + sizeof(struct td_sched) <= + sizeof(struct thread0_storage), + "increase struct thread0_storage.t0st_sched size"); + static struct mtx sched_lock; static int realstathz = 127; /* stathz is sometimes 0 and run off of hz. */ @@ -491,8 +494,8 @@ schedcpu(void) } FOREACH_THREAD_IN_PROC(p, td) { awake = 0; + ts = td_get_sched(td); thread_lock(td); - ts = td->td_sched; /* * Increment sleep time (if sleeping). We * ignore overflow, as above. @@ -596,7 +599,7 @@ updatepri(struct thread *td) fixpt_t loadfac; unsigned int newcpu; - ts = td->td_sched; + ts = td_get_sched(td); loadfac = loadfactor(averunnable.ldavg[0]); if (ts->ts_slptime > 5 * loadfac) ts->ts_estcpu = 0; @@ -621,7 +624,8 @@ resetpriority(struct thread *td) if (td->td_pri_class != PRI_TIMESHARE) return; - newpriority = PUSER + td->td_sched->ts_estcpu / INVERSE_ESTCPU_WEIGHT + + newpriority = PUSER + + td_get_sched(td)->ts_estcpu / INVERSE_ESTCPU_WEIGHT + NICE_WEIGHT * (td->td_proc->p_nice - PRIO_MIN); newpriority = min(max(newpriority, PRI_MIN_TIMESHARE), PRI_MAX_TIMESHARE); @@ -682,13 +686,12 @@ sched_initticks(void *dummy) void schedinit(void) { + /* - * Set up the scheduler specific parts of proc0. + * Set up the scheduler specific parts of thread0. */ - proc0.p_sched = NULL; /* XXX */ - thread0.td_sched = &td_sched0; thread0.td_lock = &sched_lock; - td_sched0.ts_slice = sched_slice; + td_get_sched(&thread0)->ts_slice = sched_slice; mtx_init(&sched_lock, "sched lock", NULL, MTX_SPIN | MTX_RECURSE); } @@ -731,7 +734,7 @@ sched_clock(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); - ts = td->td_sched; + ts = td_get_sched(td); ts->ts_cpticks++; ts->ts_estcpu = ESTCPULIM(ts->ts_estcpu + 1); @@ -775,8 +778,8 @@ sched_exit_thread(struct thread *td, str KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "exit", "prio:%d", child->td_priority); thread_lock(td); - td->td_sched->ts_estcpu = ESTCPULIM(td->td_sched->ts_estcpu + - child->td_sched->ts_estcpu); + td_get_sched(td)->ts_estcpu = ESTCPULIM(td_get_sched(td)->ts_estcpu + + td_get_sched(child)->ts_estcpu); thread_unlock(td); thread_lock(child); if ((child->td_flags & TDF_NOLOAD) == 0) @@ -793,17 +796,18 @@ sched_fork(struct thread *td, struct thr void sched_fork_thread(struct thread *td, struct thread *childtd) { - struct td_sched *ts; + struct td_sched *ts, *tsc; childtd->td_oncpu = NOCPU; childtd->td_lastcpu = NOCPU; childtd->td_lock = &sched_lock; childtd->td_cpuset = cpuset_ref(td->td_cpuset); childtd->td_priority = childtd->td_base_pri; - ts = childtd->td_sched; + ts = td_get_sched(childtd); bzero(ts, sizeof(*ts)); - ts->ts_estcpu = td->td_sched->ts_estcpu; - ts->ts_flags |= (td->td_sched->ts_flags & TSF_AFFINITY); + tsc = td_get_sched(td); + ts->ts_estcpu = tsc->ts_estcpu; + ts->ts_flags |= (tsc->ts_flags & TSF_AFFINITY); ts->ts_slice = 1; } @@ -952,7 +956,7 @@ sched_sleep(struct thread *td, int pri) THREAD_LOCK_ASSERT(td, MA_OWNED); td->td_slptick = ticks; - td->td_sched->ts_slptime = 0; + td_get_sched(td)->ts_slptime = 0; if (pri != 0 && PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) sched_prio(td, pri); if (TD_IS_SUSPENDED(td) || pri >= PSOCK) @@ -968,7 +972,7 @@ sched_switch(struct thread *td, struct t int preempted; tmtx = NULL; - ts = td->td_sched; + ts = td_get_sched(td); p = td->td_proc; THREAD_LOCK_ASSERT(td, MA_OWNED); @@ -1095,7 +1099,7 @@ sched_wakeup(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); - ts = td->td_sched; + ts = td_get_sched(td); td->td_flags &= ~TDF_CANSWAP; if (ts->ts_slptime > 1) { updatepri(td); @@ -1266,7 +1270,7 @@ sched_add(struct thread *td, int flags) int forwarded = 0; int single_cpu = 0; - ts = td->td_sched; + ts = td_get_sched(td); THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT((td->td_inhibitors == 0), ("sched_add: trying to run inhibited thread")); @@ -1361,7 +1365,7 @@ sched_add(struct thread *td, int flags) { struct td_sched *ts; - ts = td->td_sched; + ts = td_get_sched(td); THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT((td->td_inhibitors == 0), ("sched_add: trying to run inhibited thread")); @@ -1414,7 +1418,7 @@ sched_rem(struct thread *td) { struct td_sched *ts; - ts = td->td_sched; + ts = td_get_sched(td); KASSERT(td->td_flags & TDF_INMEM, ("sched_rem: thread swapped out")); KASSERT(TD_ON_RUNQ(td), @@ -1527,7 +1531,7 @@ sched_bind(struct thread *td, int cpu) THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); KASSERT(td == curthread, ("sched_bind: can only bind curthread")); - ts = td->td_sched; + ts = td_get_sched(td); td->td_flags |= TDF_BOUND; #ifdef SMP @@ -1586,7 +1590,7 @@ sched_pctcpu(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); - ts = td->td_sched; + ts = td_get_sched(td); return (ts->ts_pctcpu); } @@ -1603,7 +1607,7 @@ sched_pctcpu_delta(struct thread *td) int realstathz; THREAD_LOCK_ASSERT(td, MA_OWNED); - ts = td->td_sched; + ts = td_get_sched(td); delta = 0; realstathz = stathz ? stathz : hz; if (ts->ts_cpticks != 0) { @@ -1628,7 +1632,7 @@ u_int sched_estcpu(struct thread *td) { - return (td->td_sched->ts_estcpu); + return (td_get_sched(td)->ts_estcpu); } /* @@ -1707,7 +1711,7 @@ sched_tdname(struct thread *td) #ifdef KTR struct td_sched *ts; - ts = td->td_sched; + ts = td_get_sched(td); if (ts->ts_name[0] == '\0') snprintf(ts->ts_name, sizeof(ts->ts_name), "%s tid %d", td->td_name, td->td_tid); @@ -1723,7 +1727,7 @@ sched_clear_tdname(struct thread *td) { struct td_sched *ts; - ts = td->td_sched; + ts = td_get_sched(td); ts->ts_name[0] = '\0'; } #endif @@ -1741,7 +1745,7 @@ sched_affinity(struct thread *td) * Set the TSF_AFFINITY flag if there is at least one CPU this * thread can't run on. */ - ts = td->td_sched; + ts = td_get_sched(td); ts->ts_flags &= ~TSF_AFFINITY; CPU_FOREACH(cpu) { if (!THREAD_CAN_SCHED(td, cpu)) { Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/kern/sched_ule.c Sun Jun 5 17:04:03 2016 (r301456) @@ -106,12 +106,14 @@ struct td_sched { #define TSF_BOUND 0x0001 /* Thread can not migrate. */ #define TSF_XFERABLE 0x0002 /* Thread was added as transferable. */ -static struct td_sched td_sched0; - #define THREAD_CAN_MIGRATE(td) ((td)->td_pinned == 0) #define THREAD_CAN_SCHED(td, cpu) \ CPU_ISSET((cpu), &(td)->td_cpuset->cs_mask) +_Static_assert(sizeof(struct thread) + sizeof(struct td_sched) <= + sizeof(struct thread0_storage), + "increase struct thread0_storage.t0st_sched size"); + /* * Priority ranges used for interactive and non-interactive timeshare * threads. The timeshare priorities are split up into four ranges. @@ -460,7 +462,7 @@ tdq_runq_add(struct tdq *tdq, struct thr THREAD_LOCK_ASSERT(td, MA_OWNED); pri = td->td_priority; - ts = td->td_sched; + ts = td_get_sched(td); TD_SET_RUNQ(td); if (THREAD_CAN_MIGRATE(td)) { tdq->tdq_transferable++; @@ -506,7 +508,7 @@ tdq_runq_rem(struct tdq *tdq, struct thr { struct td_sched *ts; - ts = td->td_sched; + ts = td_get_sched(td); TDQ_LOCK_ASSERT(tdq, MA_OWNED); KASSERT(ts->ts_runq != NULL, ("tdq_runq_remove: thread %p null ts_runq", td)); @@ -962,7 +964,7 @@ tdq_move(struct tdq *from, struct tdq *t td = tdq_steal(tdq, cpu); if (td == NULL) return (0); - ts = td->td_sched; + ts = td_get_sched(td); /* * Although the run queue is locked the thread may be blocked. Lock * it to clear this and acquire the run-queue lock. @@ -1046,7 +1048,7 @@ tdq_notify(struct tdq *tdq, struct threa if (tdq->tdq_ipipending) return; - cpu = td->td_sched->ts_cpu; + cpu = td_get_sched(td)->ts_cpu; pri = td->td_priority; ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) @@ -1174,7 +1176,7 @@ sched_setcpu(struct thread *td, int cpu, THREAD_LOCK_ASSERT(td, MA_OWNED); tdq = TDQ_CPU(cpu); - td->td_sched->ts_cpu = cpu; + td_get_sched(td)->ts_cpu = cpu; /* * If the lock matches just return the queue. */ @@ -1221,7 +1223,7 @@ sched_pickcpu(struct thread *td, int fla int cpu, pri, self; self = PCPU_GET(cpuid); - ts = td->td_sched; + ts = td_get_sched(td); if (smp_started == 0) return (self); /* @@ -1472,7 +1474,7 @@ sched_interact_score(struct thread *td) struct td_sched *ts; int div; - ts = td->td_sched; + ts = td_get_sched(td); /* * The score is only needed if this is likely to be an interactive * task. Don't go through the expense of computing it if there's @@ -1537,16 +1539,16 @@ sched_priority(struct thread *td) pri, score)); } else { pri = SCHED_PRI_MIN; - if (td->td_sched->ts_ticks) - pri += min(SCHED_PRI_TICKS(td->td_sched), + if (td_get_sched(td)->ts_ticks) + pri += min(SCHED_PRI_TICKS(td_get_sched(td)), SCHED_PRI_RANGE - 1); pri += SCHED_PRI_NICE(td->td_proc->p_nice); KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, ("sched_priority: invalid priority %d: nice %d, " "ticks %d ftick %d ltick %d tick pri %d", - pri, td->td_proc->p_nice, td->td_sched->ts_ticks, - td->td_sched->ts_ftick, td->td_sched->ts_ltick, - SCHED_PRI_TICKS(td->td_sched))); + pri, td->td_proc->p_nice, td_get_sched(td)->ts_ticks, + td_get_sched(td)->ts_ftick, td_get_sched(td)->ts_ltick, + SCHED_PRI_TICKS(td_get_sched(td)))); } sched_user_prio(td, pri); @@ -1564,7 +1566,7 @@ sched_interact_update(struct thread *td) struct td_sched *ts; u_int sum; - ts = td->td_sched; + ts = td_get_sched(td); sum = ts->ts_runtime + ts->ts_slptime; if (sum < SCHED_SLP_RUN_MAX) return; @@ -1606,14 +1608,16 @@ sched_interact_update(struct thread *td) static void sched_interact_fork(struct thread *td) { + struct td_sched *ts; int ratio; int sum; - sum = td->td_sched->ts_runtime + td->td_sched->ts_slptime; + ts = td_get_sched(td); + sum = ts->ts_runtime + ts->ts_slptime; if (sum > SCHED_SLP_RUN_FORK) { ratio = sum / SCHED_SLP_RUN_FORK; - td->td_sched->ts_runtime /= ratio; - td->td_sched->ts_slptime /= ratio; + ts->ts_runtime /= ratio; + ts->ts_slptime /= ratio; } } @@ -1623,15 +1627,15 @@ sched_interact_fork(struct thread *td) void schedinit(void) { + struct td_sched *ts0; /* - * Set up the scheduler specific parts of proc0. + * Set up the scheduler specific parts of thread0. */ - proc0.p_sched = NULL; /* XXX */ - thread0.td_sched = &td_sched0; - td_sched0.ts_ltick = ticks; - td_sched0.ts_ftick = ticks; - td_sched0.ts_slice = 0; + ts0 = td_get_sched(&thread0); + ts0->ts_ltick = ticks; + ts0->ts_ftick = ticks; + ts0->ts_slice = 0; } /* @@ -1694,7 +1698,7 @@ sched_thread_priority(struct thread *td, SDT_PROBE4(sched, , , lend__pri, td, td->td_proc, prio, curthread); } - ts = td->td_sched; + ts = td_get_sched(td); THREAD_LOCK_ASSERT(td, MA_OWNED); if (td->td_priority == prio) return; @@ -1829,7 +1833,7 @@ sched_switch_migrate(struct tdq *tdq, st { struct tdq *tdn; - tdn = TDQ_CPU(td->td_sched->ts_cpu); + tdn = TDQ_CPU(td_get_sched(td)->ts_cpu); #ifdef SMP tdq_load_rem(tdq, td); /* @@ -1888,7 +1892,7 @@ sched_switch(struct thread *td, struct t cpuid = PCPU_GET(cpuid); tdq = TDQ_CPU(cpuid); - ts = td->td_sched; + ts = td_get_sched(td); mtx = td->td_lock; sched_pctcpu_update(ts, 1); ts->ts_rltick = ticks; @@ -1948,7 +1952,7 @@ sched_switch(struct thread *td, struct t SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; - sched_pctcpu_update(newtd->td_sched, 0); + sched_pctcpu_update(td_get_sched(newtd), 0); #ifdef KDTRACE_HOOKS /* @@ -2038,7 +2042,7 @@ sched_wakeup(struct thread *td) int slptick; THREAD_LOCK_ASSERT(td, MA_OWNED); - ts = td->td_sched; + ts = td_get_sched(td); td->td_flags &= ~TDF_CANSWAP; /* * If we slept for more than a tick update our interactivity and @@ -2066,14 +2070,14 @@ void sched_fork(struct thread *td, struct thread *child) { THREAD_LOCK_ASSERT(td, MA_OWNED); - sched_pctcpu_update(td->td_sched, 1); + sched_pctcpu_update(td_get_sched(td), 1); sched_fork_thread(td, child); /* * Penalize the parent and child for forking. */ sched_interact_fork(child); sched_priority(child); - td->td_sched->ts_runtime += tickincr; + td_get_sched(td)->ts_runtime += tickincr; sched_interact_update(td); sched_priority(td); } @@ -2093,8 +2097,8 @@ sched_fork_thread(struct thread *td, str /* * Initialize child. */ - ts = td->td_sched; - ts2 = child->td_sched; + ts = td_get_sched(td); + ts2 = td_get_sched(child); child->td_oncpu = NOCPU; child->td_lastcpu = NOCPU; child->td_lock = TDQ_LOCKPTR(tdq); @@ -2169,7 +2173,7 @@ sched_exit_thread(struct thread *td, str * launch expensive things to mark their children as expensive. */ thread_lock(td); - td->td_sched->ts_runtime += child->td_sched->ts_runtime; + td_get_sched(td)->ts_runtime += td_get_sched(child)->ts_runtime; sched_interact_update(td); sched_priority(td); thread_unlock(td); @@ -2264,7 +2268,7 @@ sched_clock(struct thread *td) if (TAILQ_EMPTY(&tdq->tdq_timeshare.rq_queues[tdq->tdq_ridx])) tdq->tdq_ridx = tdq->tdq_idx; } - ts = td->td_sched; + ts = td_get_sched(td); sched_pctcpu_update(ts, 1); if (td->td_pri_class & PRI_FIFO_BIT) return; @@ -2273,7 +2277,7 @@ sched_clock(struct thread *td) * We used a tick; charge it to the thread so * that we can compute our interactivity. */ - td->td_sched->ts_runtime += tickincr; + td_get_sched(td)->ts_runtime += tickincr; sched_interact_update(td); sched_priority(td); } @@ -2455,7 +2459,7 @@ sched_rem(struct thread *td) KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "runq rem", "prio:%d", td->td_priority); SDT_PROBE3(sched, , , dequeue, td, td->td_proc, NULL); - tdq = TDQ_CPU(td->td_sched->ts_cpu); + tdq = TDQ_CPU(td_get_sched(td)->ts_cpu); TDQ_LOCK_ASSERT(tdq, MA_OWNED); MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); KASSERT(TD_ON_RUNQ(td), @@ -2477,9 +2481,7 @@ sched_pctcpu(struct thread *td) struct td_sched *ts; pctcpu = 0; - ts = td->td_sched; - if (ts == NULL) - return (0); + ts = td_get_sched(td); THREAD_LOCK_ASSERT(td, MA_OWNED); sched_pctcpu_update(ts, TD_IS_RUNNING(td)); @@ -2505,7 +2507,7 @@ sched_affinity(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); - ts = td->td_sched; + ts = td_get_sched(td); if (THREAD_CAN_SCHED(td, ts->ts_cpu)) return; if (TD_ON_RUNQ(td)) { @@ -2536,7 +2538,7 @@ sched_bind(struct thread *td, int cpu) THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); KASSERT(td == curthread, ("sched_bind: can only bind curthread")); - ts = td->td_sched; + ts = td_get_sched(td); if (ts->ts_flags & TSF_BOUND) sched_unbind(td); KASSERT(THREAD_CAN_MIGRATE(td), ("%p must be migratable", td)); @@ -2559,7 +2561,7 @@ sched_unbind(struct thread *td) THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); - ts = td->td_sched; + ts = td_get_sched(td); if ((ts->ts_flags & TSF_BOUND) == 0) return; ts->ts_flags &= ~TSF_BOUND; @@ -2570,7 +2572,7 @@ int sched_is_bound(struct thread *td) { THREAD_LOCK_ASSERT(td, MA_OWNED); - return (td->td_sched->ts_flags & TSF_BOUND); + return (td_get_sched(td)->ts_flags & TSF_BOUND); } /* @@ -2761,7 +2763,7 @@ sched_tdname(struct thread *td) #ifdef KTR struct td_sched *ts; - ts = td->td_sched; + ts = td_get_sched(td); if (ts->ts_name[0] == '\0') snprintf(ts->ts_name, sizeof(ts->ts_name), "%s tid %d", td->td_name, td->td_tid); @@ -2777,7 +2779,7 @@ sched_clear_tdname(struct thread *td) { struct td_sched *ts; - ts = td->td_sched; + ts = td_get_sched(td); ts->ts_name[0] = '\0'; } #endif Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/mips/mips/locore.S Sun Jun 5 17:04:03 2016 (r301456) @@ -173,7 +173,7 @@ VECTOR(_locore, unknown) jal _C_LABEL(platform_start) nop - PTR_LA sp, _C_LABEL(thread0) + PTR_LA sp, _C_LABEL(thread0_st) PTR_L a0, TD_PCB(sp) REG_LI t0, ~7 and a0, a0, t0 Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Jun 5 16:55:55 2016 (r301455) +++ head/sys/sys/proc.h Sun Jun 5 17:04:03 2016 (r301456) @@ -325,7 +325,6 @@ struct thread { int td_kstack_pages; /* (a) Size of the kstack. */ volatile u_int td_critnest; /* (k*) Critical section nest level. */ struct mdthread td_md; /* (k) Any machine-dependent fields. */ - struct td_sched *td_sched; /* (*) Scheduler-specific data. */ struct kaudit_record *td_ar; /* (k) Active audit record, if any. */ struct lpohead td_lprof[2]; /* (a) lock profiling objects. */ struct kdtrace_thread *td_dtrace; /* (*) DTrace-specific data. */ @@ -341,6 +340,11 @@ struct thread { int td_oncpu; /* (t) Which cpu we are on. */ }; +struct thread0_storage { + struct thread t0st_thread; + uint64_t t0st_sched[10]; +}; + struct mtx *thread_lock_block(struct thread *); void thread_lock_unblock(struct thread *, struct mtx *); void thread_lock_set(struct thread *, struct mtx *); @@ -616,7 +620,6 @@ struct proc { struct proc *p_leader; /* (b) */ void *p_emuldata; /* (c) Emulator state data. */ struct label *p_label; /* (*) Proc (not subject) MAC label. */ - struct p_sched *p_sched; /* (*) Scheduler-specific data. */ STAILQ_HEAD(, ktr_request) p_ktr; /* (o) KTR event queue. */ LIST_HEAD(, mqueue_notifier) p_mqnotifier; /* (c) mqueue notifiers.*/ struct kdtrace_proc *p_dtrace; /* (*) DTrace-specific data. */ @@ -890,7 +893,8 @@ extern int allproc_gen; extern struct sx proctree_lock; extern struct mtx ppeers_lock; extern struct proc proc0; /* Process slot for swapper. */ -extern struct thread thread0; /* Primary thread in proc0. */ +extern struct thread0_storage thread0_st; /* Primary thread in proc0. */ +#define thread0 (thread0_st.t0st_thread) extern struct vmspace vmspace0; /* VM space for proc0. */ extern int hogticks; /* Limit on kernel cpu hogs. */ extern int lastpid; @@ -1065,6 +1069,13 @@ curthread_pflags_restore(int save) curthread->td_pflags &= save; } +static __inline __pure2 struct td_sched * +td_get_sched(struct thread *td) +{ + + return ((struct td_sched *)&td[1]); +} + #endif /* _KERNEL */ #endif /* !_SYS_PROC_H_ */ From owner-svn-src-all@freebsd.org Sun Jun 5 17:11:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73CB3B69C15; Sun, 5 Jun 2016 17:11:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 410F113A3; Sun, 5 Jun 2016 17:11:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55HBN9x088828; Sun, 5 Jun 2016 17:11:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55HBNZE088827; Sun, 5 Jun 2016 17:11:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606051711.u55HBNZE088827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Jun 2016 17:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301457 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 17:11:24 -0000 Author: kib Date: Sun Jun 5 17:11:23 2016 New Revision: 301457 URL: https://svnweb.freebsd.org/changeset/base/301457 Log: Avoid spurious EINVAL in amd64 pmap_change_attr(). Do not try to change attributes for DMAP when working on a mapping which is not covered by the DMAP. This was reported on real system where a BAR of a device (NTB) was mapped outside the PCI window. Reported and tested by: mav Reviewed by: jhb, mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D6668 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jun 5 17:04:03 2016 (r301456) +++ head/sys/amd64/amd64/pmap.c Sun Jun 5 17:11:23 2016 (r301457) @@ -6533,7 +6533,7 @@ static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) { vm_offset_t base, offset, tmpva; - vm_paddr_t pa_start, pa_end; + vm_paddr_t pa_start, pa_end, pa_end1; pdp_entry_t *pdpe; pd_entry_t *pde; pt_entry_t *pte; @@ -6716,9 +6716,12 @@ pmap_change_attr_locked(vm_offset_t va, tmpva += PAGE_SIZE; } } - if (error == 0 && pa_start != pa_end) - error = pmap_change_attr_locked(PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode); + if (error == 0 && pa_start != pa_end && pa_start < dmaplimit) { + pa_end1 = MIN(pa_end, dmaplimit); + if (pa_start != pa_end1) + error = pmap_change_attr_locked(PHYS_TO_DMAP(pa_start), + pa_end1 - pa_start, mode); + } /* * Flush CPU caches if required to make sure any data isn't cached that From owner-svn-src-all@freebsd.org Sun Jun 5 18:11:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF37FB6AE7F; Sun, 5 Jun 2016 18:11:53 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77CDE1AA5; Sun, 5 Jun 2016 18:11:53 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55IBqxg010821; Sun, 5 Jun 2016 18:11:52 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55IBqv2010817; Sun, 5 Jun 2016 18:11:52 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606051811.u55IBqv2010817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 5 Jun 2016 18:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301459 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 18:11:53 -0000 Author: ache Date: Sun Jun 5 18:11:52 2016 New Revision: 301459 URL: https://svnweb.freebsd.org/changeset/base/301459 Log: MFC: r301115 Don't use fixup for C99 and up, the compiler result is already correct. Suggested by: bde Modified: stable/10/lib/libc/stdlib/div.c stable/10/lib/libc/stdlib/imaxdiv.c stable/10/lib/libc/stdlib/ldiv.c stable/10/lib/libc/stdlib/lldiv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/div.c ============================================================================== --- stable/10/lib/libc/stdlib/div.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/div.c Sun Jun 5 18:11:52 2016 (r301459) @@ -46,6 +46,7 @@ div(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) /* * The ANSI standard says that |r.quot| <= |n/d|, where * n/d is to be computed in infinite precision. In other @@ -73,5 +74,6 @@ div(num, denom) r.quot++; r.rem -= denom; } +#endif return (r); } Modified: stable/10/lib/libc/stdlib/imaxdiv.c ============================================================================== --- stable/10/lib/libc/stdlib/imaxdiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/imaxdiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -37,9 +37,11 @@ imaxdiv(intmax_t numer, intmax_t denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); } Modified: stable/10/lib/libc/stdlib/ldiv.c ============================================================================== --- stable/10/lib/libc/stdlib/ldiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/ldiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -48,9 +48,11 @@ ldiv(num, denom) r.quot = num / denom; r.rem = num % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (num >= 0 && r.rem < 0) { r.quot++; r.rem -= denom; } +#endif return (r); } Modified: stable/10/lib/libc/stdlib/lldiv.c ============================================================================== --- stable/10/lib/libc/stdlib/lldiv.c Sun Jun 5 17:31:36 2016 (r301458) +++ stable/10/lib/libc/stdlib/lldiv.c Sun Jun 5 18:11:52 2016 (r301459) @@ -37,9 +37,11 @@ lldiv(long long numer, long long denom) retval.quot = numer / denom; retval.rem = numer % denom; +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) if (numer >= 0 && retval.rem < 0) { retval.quot++; retval.rem -= denom; } +#endif return (retval); } From owner-svn-src-all@freebsd.org Sun Jun 5 18:16:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19FD6B6B30E; Sun, 5 Jun 2016 18:16:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9AAC1E9C; Sun, 5 Jun 2016 18:16:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55IGYvs012992; Sun, 5 Jun 2016 18:16:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55IGYwI012990; Sun, 5 Jun 2016 18:16:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606051816.u55IGYwI012990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 18:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301460 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 18:16:35 -0000 Author: bdrewery Date: Sun Jun 5 18:16:33 2016 New Revision: 301460 URL: https://svnweb.freebsd.org/changeset/base/301460 Log: Cleanup COMPAT_FREEBSD32 support. This is a NOP. The COMPAT_IA32 was renamed in r205014 to COMPAT_FREEBSD32 and COMPAT_ARCH32 does not seem to have existed. Also remove some leftovers from the sysent rework in r301404. Include freebsd32_util.h for the freebsd32_sysent prototype. X-MFC-With: r301404 Reported by: kib MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Sun Jun 5 18:11:52 2016 (r301459) +++ head/sys/dev/filemon/filemon.c Sun Jun 5 18:16:33 2016 (r301460) @@ -54,16 +54,12 @@ __FBSDID("$FreeBSD$"); #include "filemon.h" -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) +#if defined(COMPAT_FREEBSD32) #include #include - -extern struct sysentvec ia32_freebsd_sysvec; +#include #endif -extern struct sysentvec elf32_freebsd_sysvec; -extern struct sysentvec elf64_freebsd_sysvec; - static d_close_t filemon_close; static d_ioctl_t filemon_ioctl; static d_open_t filemon_open; Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Sun Jun 5 18:11:52 2016 (r301459) +++ head/sys/dev/filemon/filemon_wrapper.c Sun Jun 5 18:16:33 2016 (r301460) @@ -39,10 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) -extern struct sysent freebsd32_sysent[]; -#endif - static eventhandler_tag filemon_exec_tag; static eventhandler_tag filemon_exit_tag; static eventhandler_tag filemon_fork_tag; @@ -429,7 +425,7 @@ filemon_wrapper_install(void) sysent[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; sysent[SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) +#if defined(COMPAT_FREEBSD32) freebsd32_sysent[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; freebsd32_sysent[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; freebsd32_sysent[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; @@ -438,7 +434,7 @@ filemon_wrapper_install(void) freebsd32_sysent[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; freebsd32_sysent[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; freebsd32_sysent[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; -#endif /* COMPAT_ARCH32 */ +#endif /* COMPAT_FREEBSD32 */ filemon_exec_tag = EVENTHANDLER_REGISTER(process_exec, filemon_event_process_exec, NULL, EVENTHANDLER_PRI_LAST); @@ -461,7 +457,7 @@ filemon_wrapper_deinstall(void) sysent[SYS_symlink].sy_call = (sy_call_t *)sys_symlink; sysent[SYS_linkat].sy_call = (sy_call_t *)sys_linkat; -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) +#if defined(COMPAT_FREEBSD32) freebsd32_sysent[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *)sys_chdir; freebsd32_sysent[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; freebsd32_sysent[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat; @@ -470,7 +466,7 @@ filemon_wrapper_deinstall(void) freebsd32_sysent[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link; freebsd32_sysent[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink; freebsd32_sysent[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *)sys_linkat; -#endif /* COMPAT_ARCH32 */ +#endif /* COMPAT_FREEBSD32 */ EVENTHANDLER_DEREGISTER(process_exec, filemon_exec_tag); EVENTHANDLER_DEREGISTER(process_exit, filemon_exit_tag); From owner-svn-src-all@freebsd.org Sun Jun 5 18:39:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B07C1B6BA28; Sun, 5 Jun 2016 18:39:41 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67B631F4E; Sun, 5 Jun 2016 18:39:41 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by mail-qk0-x234.google.com with SMTP id n63so79704446qkf.0; Sun, 05 Jun 2016 11:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+E4wJC6ovlDwNDH2DFIMyIOskaUswuIsznFVbJMvvhQ=; b=cFQlzPon0yZaEvmY8VN0fXfuCAsdCmh3JwoNXSy9A0Q6xowiPsKKi2Iy2DeNyTonWA UjSH6fNtqN984ihjDTT4iW5LZjGtha1aNqUp7bSdhmBR5AIfMtzdIAh719HZC9vmc9Xk vS//41y1DpQUxUCXlsHZfMEl7di6LXN+LwYZNfwoWGFMfC+yxBnxaEaEaEYZnrGAlLxi Hr2XLUi5+V0EE2ydz1KHSjYi6cAUfnBDzntCnbEMikqJKJu8rjCs4UEzho51a6EDrvFs TDMvbjYe+MDvqKXa7OSBkK2HgfTJC4zi+l6/kmMlKqplh0Mw4wCctDZV7ieZQ1FXunlE LejA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+E4wJC6ovlDwNDH2DFIMyIOskaUswuIsznFVbJMvvhQ=; b=Fd2Wm9RI9V7Po8cLwx5OtO1PN0Dltc0OyTXjQ4SQG1hAik3CRsUjbDdirn3Jq+MJoE 6Zh0vMKvHIebAJJKdFI5islR91OLGI2/05ZnlGncnNqHjS0sHbulzgrq5s4hn85hiMqp eIeMn0V+9ZgIyAy8HorJd0ybgJr48AWgkN1K1Uh4vpqA7NQWx1Fy9RQyKpgxT/7eSsq7 cOFRpRPe88Me8N4LXhXoTO0HBMV8yPWkFSCsoe6JQbxYU0jGa4DCxAHn8lyCkWoUHxJV kv+6CdmzgK0hu89A/Ktg9E0wvhWynqxUBnAaHZCslrOgiqHzQ0q7t9Cc4y9jw1xZr7zh GlLQ== X-Gm-Message-State: ALyK8tLiL4Ds+jH6MFcTe1gDge5rWAfvmK76UtePvyNubgeHbuunffxUv8yJxnvoPGCqAQ== X-Received: by 10.55.214.194 with SMTP id p63mr12907366qkl.130.1465151980265; Sun, 05 Jun 2016 11:39:40 -0700 (PDT) Received: from [192.168.1.3] (pool-70-104-142-118.nycmny.fios.verizon.net. [70.104.142.118]) by smtp.gmail.com with ESMTPSA id j190sm3970756qkf.29.2016.06.05.11.39.39 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Jun 2016 11:39:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... From: Matteo Riondato In-Reply-To: <201606021906.u52J649H019481@repo.freebsd.org> Date: Sun, 5 Jun 2016 14:39:38 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201606021906.u52J649H019481@repo.freebsd.org> To: Kurt Lidl X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 18:39:41 -0000 > On Jun 2, 2016, at 3:06 PM, Kurt Lidl wrote: >=20 > Author: lidl > Date: Thu Jun 2 19:06:04 2016 > New Revision: 301226 > URL: https://svnweb.freebsd.org/changeset/base/301226 >=20 > Log: > Add basic blacklist build support >=20 [snip] > Modified: head/etc/defaults/rc.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/etc/defaults/rc.conf Thu Jun 2 18:41:33 2016 = (r301225) > +++ head/etc/defaults/rc.conf Thu Jun 2 19:06:04 2016 = (r301226) > @@ -270,6 +270,8 @@ hastd_program=3D"/sbin/hastd" # path to ha > hastd_flags=3D"" # Optional flags to hastd. > ctld_enable=3D"NO" # CAM Target Layer / iSCSI target = daemon. > local_unbound_enable=3D"NO" # local caching resolver > +blacklistd_enable=3D"YES" # Run blacklistd daemon (YES/NO). > +blacklistd_flags=3D"" # Optional flags for = blacklistd(8). What is the rationale for having this enabled by default?=20 Is any of the services that use it (in their default config) enabled by = default? Thanks, Matteo From owner-svn-src-all@freebsd.org Sun Jun 5 19:12:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE4BBB6B2E6; Sun, 5 Jun 2016 19:12:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0CE614EA; Sun, 5 Jun 2016 19:12:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55JCqvH036463; Sun, 5 Jun 2016 19:12:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55JCqdR036458; Sun, 5 Jun 2016 19:12:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606051912.u55JCqdR036458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 5 Jun 2016 19:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301461 - in head/lib/libc: gen locale regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 19:12:54 -0000 Author: pfg Date: Sun Jun 5 19:12:52 2016 New Revision: 301461 URL: https://svnweb.freebsd.org/changeset/base/301461 Log: libc/locale: Fix type breakage in __collate_range_cmp(). When collation support was brought in, the second and third arguments in __collate_range_cmp() were changed from int to wchar_t, breaking the ABI. Change them to a "char" type which makes more sense and keeps the ABI compatible. Also introduce __wcollate_range_cmp() which does work with wide characters. This function is used only internally in libc so we don't export it. Use the new function in glob(3), fnmatch(3), and regexec(3). PR: 179721 Suggested by: ache. jilles MFC after: 3 weeks (perhaps partial only) Modified: head/lib/libc/gen/fnmatch.c head/lib/libc/gen/glob.c head/lib/libc/locale/collate.h head/lib/libc/locale/collcmp.c head/lib/libc/regex/regcomp.c Modified: head/lib/libc/gen/fnmatch.c ============================================================================== --- head/lib/libc/gen/fnmatch.c Sun Jun 5 18:16:33 2016 (r301460) +++ head/lib/libc/gen/fnmatch.c Sun Jun 5 19:12:52 2016 (r301461) @@ -296,8 +296,8 @@ rangematch(const char *pattern, wchar_t if (table->__collate_load_error ? c <= test && test <= c2 : - __collate_range_cmp(table, c, test) <= 0 - && __collate_range_cmp(table, test, c2) <= 0 + __wcollate_range_cmp(table, c, test) <= 0 + && __wcollate_range_cmp(table, test, c2) <= 0 ) ok = 1; } else if (c == test) Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Sun Jun 5 18:16:33 2016 (r301460) +++ head/lib/libc/gen/glob.c Sun Jun 5 19:12:52 2016 (r301461) @@ -832,8 +832,8 @@ match(Char *name, Char *pat, Char *paten if ((*pat & M_MASK) == M_RNG) { if (table->__collate_load_error ? CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) : - __collate_range_cmp(table, CHAR(c), CHAR(k)) <= 0 - && __collate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0 + __wcollate_range_cmp(table, CHAR(c), CHAR(k)) <= 0 + && __wcollate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0 ) ok = 1; pat += 2; Modified: head/lib/libc/locale/collate.h ============================================================================== --- head/lib/libc/locale/collate.h Sun Jun 5 18:16:33 2016 (r301460) +++ head/lib/libc/locale/collate.h Sun Jun 5 19:12:52 2016 (r301461) @@ -128,7 +128,8 @@ int __collate_load_tables(const char *); int __collate_equiv_value(locale_t, const wchar_t *, size_t); void _collate_lookup(struct xlocale_collate *,const wchar_t *, int *, int *, int, const int **); -int __collate_range_cmp(struct xlocale_collate *, wchar_t, wchar_t); +int __collate_range_cmp(struct xlocale_collate *, char, char); +int __wcollate_range_cmp(struct xlocale_collate *, wchar_t, wchar_t); size_t _collate_wxfrm(struct xlocale_collate *, const wchar_t *, wchar_t *, size_t); size_t _collate_sxfrm(struct xlocale_collate *, const wchar_t *, char *, Modified: head/lib/libc/locale/collcmp.c ============================================================================== --- head/lib/libc/locale/collcmp.c Sun Jun 5 18:16:33 2016 (r301460) +++ head/lib/libc/locale/collcmp.c Sun Jun 5 19:12:52 2016 (r301461) @@ -41,14 +41,27 @@ __FBSDID("$FreeBSD$"); * Compare two characters using collate */ -int __collate_range_cmp(struct xlocale_collate *table, wchar_t c1, wchar_t c2) +int __collate_range_cmp(struct xlocale_collate *table, char c1, char c2) +{ + char s1[2], s2[2]; + + s1[0] = c1; + s1[1] = '\0'; + s2[0] = c2; + s2[1] = '\0'; + struct _xlocale l = {{0}}; + l.components[XLC_COLLATE] = (struct xlocale_component *)table; + return (strcoll_l(s1, s2, &l)); +} + +int __wcollate_range_cmp(struct xlocale_collate *table, wchar_t c1, wchar_t c2) { wchar_t s1[2], s2[2]; s1[0] = c1; - s1[1] = 0; + s1[1] = L'\0'; s2[0] = c2; - s2[1] = 0; + s2[1] = L'\0'; struct _xlocale l = {{0}}; l.components[XLC_COLLATE] = (struct xlocale_component *)table; return (wcscoll_l(s1, s2, &l)); Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Sun Jun 5 18:16:33 2016 (r301460) +++ head/lib/libc/regex/regcomp.c Sun Jun 5 19:12:52 2016 (r301461) @@ -821,10 +821,10 @@ p_b_term(struct parse *p, cset *cs) (void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE); CHaddrange(p, cs, start, finish); } else { - (void)REQUIRE(__collate_range_cmp(table, start, finish) <= 0, REG_ERANGE); + (void)REQUIRE(__wcollate_range_cmp(table, start, finish) <= 0, REG_ERANGE); for (i = 0; i <= UCHAR_MAX; i++) { - if ( __collate_range_cmp(table, start, i) <= 0 - && __collate_range_cmp(table, i, finish) <= 0 + if ( __wcollate_range_cmp(table, start, i) <= 0 + && __wcollate_range_cmp(table, i, finish) <= 0 ) CHadd(p, cs, i); } From owner-svn-src-all@freebsd.org Sun Jun 5 19:49:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF82B6BAF0 for ; Sun, 5 Jun 2016 19:49:07 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5FA818BB for ; Sun, 5 Jun 2016 19:49:06 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f53.google.com with SMTP id w16so82810746lfd.2 for ; Sun, 05 Jun 2016 12:49:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=7sXFmoxOlQEw1PsHiqd89f8kZMoeMeJZsz4gJC9vMU0=; b=FCIxq/AjCTAptWFiiQks4aTQiFgNktquJmd9SfmAhWT3pFtK6MP+Rw8ra9jseX6cCX 3BEF75GDdVhw3np23/PApprfxjKte76bjNdC6xQsmje8Qt2vP5SqW1vW/KjTo1uHkFXF /aRGGwqxz0fT4YhfqOjAMaCKBBUF+x9TjrLzij20/z/TDX+cyeDv4bnas187yd4/0d4f e37UupwBl8tk9sCTJuHHSNfqrNxBnr5tLnQ0VaKMmntkgkjT/KgdeCmhoqxDcusBDcCX H/DqjfPFtejaeOmSdvfe2NnWAt1lxoFP0fhYTF3qZ/J10egv5CW4Amtl367nEYxXZjdC 3xlw== X-Gm-Message-State: ALyK8tKE3jugTCgQmLDzDVwtlnm5jUA1fHzpBa7tVNdviP5Gq78cmeRAA8LmeDgPY8R3aQ== X-Received: by 10.25.89.68 with SMTP id n65mr439745lfb.29.1465156144817; Sun, 05 Jun 2016 12:49:04 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id x124sm1539403lfd.12.2016.06.05.12.49.03 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Jun 2016 12:49:04 -0700 (PDT) Subject: Re: svn commit: r301461 - in head/lib/libc: gen locale regex To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606051912.u55JCqdR036458@repo.freebsd.org> From: Andrey Chernov Message-ID: <40c481fe-5585-45d2-d4e3-b9988a8198f3@freebsd.org> Date: Sun, 5 Jun 2016 22:49:03 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606051912.u55JCqdR036458@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 19:49:07 -0000 On 05.06.2016 22:12, Pedro F. Giffuni wrote: > --- head/lib/libc/regex/regcomp.c Sun Jun 5 18:16:33 2016 (r301460) > +++ head/lib/libc/regex/regcomp.c Sun Jun 5 19:12:52 2016 (r301461) > @@ -821,10 +821,10 @@ p_b_term(struct parse *p, cset *cs) > (void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE); > CHaddrange(p, cs, start, finish); > } else { > - (void)REQUIRE(__collate_range_cmp(table, start, finish) <= 0, REG_ERANGE); > + (void)REQUIRE(__wcollate_range_cmp(table, start, finish) <= 0, REG_ERANGE); > for (i = 0; i <= UCHAR_MAX; i++) { > - if ( __collate_range_cmp(table, start, i) <= 0 > - && __collate_range_cmp(table, i, finish) <= 0 > + if ( __wcollate_range_cmp(table, start, i) <= 0 > + && __wcollate_range_cmp(table, i, finish) <= 0 > ) > CHadd(p, cs, i); > } > As I already mention in PR, we have broken regcomp after someone adds wchar_t support there. Now regcomp ranges works only for the first 256 wchars of the current locale, notice that loop upper limit: for (i = 0; i <= UCHAR_MAX; i++) { In general, ranges are either broken in regcomp now or are memory eating. We have bitmask only for the first 256 wchars, all other added to the range literally. Imagine what happens if someone specify full Unicode range in regexp. Proper fix will be adding bitmask for the whole Unicode range, and even in that case regcomp attempting to use collation in ranges will be _very_slow_ since needs to check all Unicode chars in its for (i = 0; i <= Max_Unicode_wchar; i++) { loop. Better stop pretending that we are able to do collation support in the ranges, since POSIX cares about its own locale only here: "In the POSIX locale, a range expression represents the set of collating elements that fall between two elements in the collation sequence, inclusive. In other locales, a range expression has unspecified behavior: strictly conforming applications shall not rely on whether the range expression is valid, or on the set of collating elements matched." Until whole Unicode range bitmask will be implemented (if ever), better stop pretending to honor collation order, we just can't do it with wchars now and do what NetBSD/OpenBSD does (using wchar_t) instead. It does not prevent memory eating on big ranges (bitmask is needed, see above), but at least fix the thing that only first 256 wchars are considered. From owner-svn-src-all@freebsd.org Sun Jun 5 20:07:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45DD7B6BFED for ; Sun, 5 Jun 2016 20:07:31 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE9281671 for ; Sun, 5 Jun 2016 20:07:30 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f44.google.com with SMTP id s186so18101406lfs.1 for ; Sun, 05 Jun 2016 13:07:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=j2JCegc/W9+2asuZGJf2/cbBUrncyQmr8XRw7hAES9k=; b=bp4S0B6Q5+8Iaw2X+WW/Ac82GWbjSwSB+l986QDyr96bXtMA1465tITxHna3dMm9fW MGNC+AUcLqvI2ml20ZtEFK5Jz+pv8AmdcVN08ehA8IXg+pyZTWmPu87Ad5S4ZWqpZsyE gB+Lq+tHkExQdMU62DNfRh7Lmpb6sOGdab+S+qukGP/ZKUJ5GZ9/c2gsq+IB6T3Pebac 3WYTaa4PeM7O3gFh6H3kgEzhJR1p8/1SVsDnH8u/qM4OgTovIZ2MLku4owaKq8wyttdt Wp4pjmA42pokFCSF88uy1hT7Ii+oKxxVfmqEx1S1wc+YCySXBfh/s1QpOVtlfwTPe6if 8zlg== X-Gm-Message-State: ALyK8tL9wMSzxwHZ0fhezkV+EwQpypFZww6UsyDajsXIANDE0ade00i36i3yYpwhen2JJw== X-Received: by 10.25.29.85 with SMTP id d82mr436857lfd.93.1465157248525; Sun, 05 Jun 2016 13:07:28 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id h67sm1360239lji.39.2016.06.05.13.07.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Jun 2016 13:07:27 -0700 (PDT) Subject: Re: svn commit: r301461 - in head/lib/libc: gen locale regex To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606051912.u55JCqdR036458@repo.freebsd.org> From: Andrey Chernov Message-ID: <8513a0d8-01b4-45bb-4e22-0829683652af@freebsd.org> Date: Sun, 5 Jun 2016 23:07:26 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606051912.u55JCqdR036458@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 20:07:31 -0000 On 05.06.2016 22:12, Pedro F. Giffuni wrote: > When collation support was brought in, the second and third > arguments in __collate_range_cmp() were changed from int to > wchar_t, breaking the ABI. Change them to a "char" type which > makes more sense and keeps the ABI compatible. Not only that breaks ABI, but changing strcoll_l() to wcscoll_l() in the __collate_range_cmp() too (now fixed), while this function is visible outside of libc. From owner-svn-src-all@freebsd.org Sun Jun 5 20:26:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2526AB6B6BE; Sun, 5 Jun 2016 20:26:19 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD4AB1464; Sun, 5 Jun 2016 20:26:18 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55KQIt1064068; Sun, 5 Jun 2016 20:26:18 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55KQG6A064049; Sun, 5 Jun 2016 20:26:16 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606052026.u55KQG6A064049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 5 Jun 2016 20:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301462 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 20:26:19 -0000 Author: sjg Date: Sun Jun 5 20:26:16 2016 New Revision: 301462 URL: https://svnweb.freebsd.org/changeset/base/301462 Log: Import bmake-20160604 Performace improvements for meta mode. Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/bmake.1 head/contrib/bmake/bmake.cat1 head/contrib/bmake/boot-strap head/contrib/bmake/main.c head/contrib/bmake/make-bootstrap.sh.in head/contrib/bmake/make.1 head/contrib/bmake/make.h head/contrib/bmake/meta.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/dpadd.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/meta.autodep.mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/nonints.h head/contrib/bmake/var.c head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/ChangeLog Sun Jun 5 20:26:16 2016 (r301462) @@ -1,3 +1,26 @@ +2016-06-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160604 + Merge with NetBSD make, pick up + o meta.c: missing filemon data is only relevant if we read a + meta file. + Also do not return oodate for a missing metafile if gn->path + points to .CURDIR + +2016-06-02 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160602 + Merge with NetBSD make, pick up + o cached_realpath(): avoid hitting filesystem more than necessary. + o meta.c: refactor need_meta decision, add knobs for + missing meta file and filemon data wrt out-of-datedness. + +2016-05-28 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160528 + + * boot-strap, make-bootstrap.sh.in: Makefile now uses _MAKE_VERSION + 2016-05-12 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160512 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/Makefile Sun Jun 5 20:26:16 2016 (r301462) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.63 2016/05/12 20:34:46 sjg Exp $ +# $Id: Makefile,v 1.66 2016/06/04 22:21:15 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160512 +_MAKE_VERSION= 20160604 PROG= bmake Modified: head/contrib/bmake/bmake.1 ============================================================================== --- head/contrib/bmake/bmake.1 Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/bmake.1 Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ +.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd May 10, 2016 +.Dd June 2, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -846,7 +846,7 @@ Can affect the mode that .Nm runs in. It can contain a number of keywords: -.Bl -hang -width ignore-cmd +.Bl -hang -width missing-filemon=bf. .It Pa compat Like .Fl B , @@ -870,6 +870,17 @@ will not create .meta files in This can be overridden by setting .Va bf to a value which represents True. +.It Pa missing-meta= Ar bf +If +.Va bf +is True, then a missing .meta file makes the target out-of-date. +.It Pa missing-filemon= Ar bf +If +.Va bf +is True, then missing filemon data makes the target out-of-date. +.It Pa nofilemon +Do not use +.Xr filemon 4 . .It Pa env For debugging, it can be useful to include the environment in the .meta file. Modified: head/contrib/bmake/bmake.cat1 ============================================================================== --- head/contrib/bmake/bmake.cat1 Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/bmake.cat1 Sun Jun 5 20:26:16 2016 (r301462) @@ -531,37 +531,51 @@ VVAARRIIAABBLLEE AASSSSIIGG mode that bbmmaakkee runs in. It can contain a number of key- words: - _c_o_m_p_a_t Like --BB, puts bbmmaakkee into "compat" mode. + _c_o_m_p_a_t Like --BB, puts bbmmaakkee into "compat" + mode. - _m_e_t_a Puts bbmmaakkee into "meta" mode, where meta files - are created for each target to capture the - command run, the output generated and if - filemon(4) is available, the system calls - which are of interest to bbmmaakkee. The captured - output can be very useful when diagnosing - errors. - - _c_u_r_d_i_r_O_k_= _b_f Normally bbmmaakkee will not create .meta files - in `_._C_U_R_D_I_R'. This can be overridden by set- - ting _b_f to a value which represents True. - - _e_n_v For debugging, it can be useful to include - the environment in the .meta file. - - _v_e_r_b_o_s_e If in "meta" mode, print a clue about the - target being built. This is useful if the - build is otherwise running silently. The - message printed the value of: - _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X. - - _i_g_n_o_r_e_-_c_m_d Some makefiles have commands which are simply - not stable. This keyword causes them to be - ignored for determining whether a target is - out of date in "meta" mode. See also - ..NNOOMMEETTAA__CCMMPP. + _m_e_t_a Puts bbmmaakkee into "meta" mode, where + meta files are created for each tar- + get to capture the command run, the + output generated and if filemon(4) + is available, the system calls which + are of interest to bbmmaakkee. The cap- + tured output can be very useful when + diagnosing errors. + + _c_u_r_d_i_r_O_k_= _b_f Normally bbmmaakkee will not create .meta + files in `_._C_U_R_D_I_R'. This can be + overridden by setting _b_f to a value + which represents True. + + _m_i_s_s_i_n_g_-_m_e_t_a_= _b_f If _b_f is True, then a missing .meta + file makes the target out-of-date. + + _m_i_s_s_i_n_g_-_f_i_l_e_m_o_n_= _b_f If _b_f is True, then missing filemon + data makes the target out-of-date. + + _n_o_f_i_l_e_m_o_n Do not use filemon(4). + + _e_n_v For debugging, it can be useful to + include the environment in the .meta + file. + + _v_e_r_b_o_s_e If in "meta" mode, print a clue + about the target being built. This + is useful if the build is otherwise + running silently. The message + printed the value of: + _._M_A_K_E_._M_E_T_A_._P_R_E_F_I_X. + + _i_g_n_o_r_e_-_c_m_d Some makefiles have commands which + are simply not stable. This keyword + causes them to be ignored for deter- + mining whether a target is out of + date in "meta" mode. See also + ..NNOOMMEETTAA__CCMMPP. - _s_i_l_e_n_t_= _b_f If _b_f is True, when a .meta file is created, - mark the target ..SSIILLEENNTT. + _s_i_l_e_n_t_= _b_f If _b_f is True, when a .meta file is + created, mark the target ..SSIILLEENNTT. _._M_A_K_E_._M_E_T_A_._B_A_I_L_I_W_I_C_K In "meta" mode, provides a list of prefixes which match @@ -1475,4 +1489,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 May 10, 2016 NetBSD 5.1 +NetBSD 5.1 June 2, 2016 NetBSD 5.1 Modified: head/contrib/bmake/boot-strap ============================================================================== --- head/contrib/bmake/boot-strap Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/boot-strap Sun Jun 5 20:26:16 2016 (r301462) @@ -111,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.48 2015/10/25 05:20:48 sjg Exp $ +# $Id: boot-strap,v 1.49 2016/05/29 00:09:14 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -451,7 +451,7 @@ op_all() { op_install else op_test - MAKE_VERSION=`sed -n '/^MAKE_VERSION/ { s,.*= *,,;p; }' $srcdir/Makefile` + MAKE_VERSION=`sed -n '/^_MAKE_VERSION/ { s,.*= *,,;p; }' $srcdir/Makefile` echo You can install by running: echo echo $0 $cmd_args op=install Modified: head/contrib/bmake/main.c ============================================================================== --- head/contrib/bmake/main.c Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/main.c Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $ */ +/* $NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.244 2016/04/05 04:25:43 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1014,7 +1014,7 @@ main(int argc, char **argv) /* * A relative path, canonicalize it. */ - p1 = realpath(argv[0], mdpath); + p1 = cached_realpath(argv[0], mdpath); if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) { p1 = argv[0]; /* realpath failed */ } @@ -1884,6 +1884,40 @@ usage(void) } +/* + * realpath(3) can get expensive, cache results... + */ +char * +cached_realpath(const char *pathname, char *resolved) +{ + static GNode *cache; + char *rp, *cp; + + if (!pathname || !pathname[0]) + return NULL; + + if (!cache) { + cache = Targ_NewGN("Realpath"); +#ifndef DEBUG_REALPATH_CACHE + cache->flags = INTERNAL; +#endif + } + + rp = Var_Value(pathname, cache, &cp); + if (rp) { + /* a hit */ + if (resolved) + strlcpy(resolved, rp, MAXPATHLEN); + else + resolved = bmake_strdup(rp); + } else { + if ((rp = realpath(pathname, resolved))) { + Var_Set(pathname, rp, cache, 0); + } + } + return rp ? resolved : NULL; +} + int PrintAddr(void *a, void *b) { Modified: head/contrib/bmake/make-bootstrap.sh.in ============================================================================== --- head/contrib/bmake/make-bootstrap.sh.in Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/make-bootstrap.sh.in Sun Jun 5 20:26:16 2016 (r301462) @@ -13,7 +13,7 @@ esac CC="@CC@" CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS} -DBMAKE_PATH_MAX=@bmake_path_max@" -MAKE_VERSION=`sed -n '/^MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile` +MAKE_VERSION=`sed -n '/^_MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile` MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \ -D@force_machine@MACHINE=\"@machine@\" -DMACHINE_ARCH=\"@machine_arch@\" \ Modified: head/contrib/bmake/make.1 ============================================================================== --- head/contrib/bmake/make.1 Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/make.1 Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.257 2016/05/10 23:45:45 sjg Exp $ +.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd May 10, 2016 +.Dd June 2, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -857,7 +857,7 @@ Can affect the mode that .Nm runs in. It can contain a number of keywords: -.Bl -hang -width ignore-cmd +.Bl -hang -width missing-filemon=bf. .It Pa compat Like .Fl B , @@ -881,6 +881,17 @@ will not create .meta files in This can be overridden by setting .Va bf to a value which represents True. +.It Pa missing-meta= Ar bf +If +.Va bf +is True, then a missing .meta file makes the target out-of-date. +.It Pa missing-filemon= Ar bf +If +.Va bf +is True, then missing filemon data makes the target out-of-date. +.It Pa nofilemon +Do not use +.Xr filemon 4 . .It Pa env For debugging, it can be useful to include the environment in the .meta file. Modified: head/contrib/bmake/make.h ============================================================================== --- head/contrib/bmake/make.h Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/make.h Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.98 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: make.h,v 1.99 2016/06/03 01:21:59 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -199,6 +199,7 @@ typedef struct GNode { #define DONE_ALLSRC 0x40 /* We do it once only */ #define CYCLE 0x1000 /* Used by MakePrintStatus */ #define DONECYCLE 0x2000 /* Used by MakePrintStatus */ +#define INTERNAL 0x4000 /* Internal use only */ enum enum_made { UNMADE, DEFERRED, REQUESTED, BEINGMADE, MADE, UPTODATE, ERROR, ABORTED Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/meta.c Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.57 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.60 2016/06/04 22:17:14 sjg Exp $ */ /* * Implement 'meta' mode. @@ -73,6 +73,8 @@ static char *metaIgnorePathsStr; /* stri Boolean useMeta = FALSE; static Boolean useFilemon = FALSE; static Boolean writeMeta = FALSE; +static Boolean metaMissing = FALSE; /* oodate if missing */ +static Boolean filemonMissing = FALSE; /* oodate if missing */ static Boolean metaEnv = FALSE; /* don't save env unless asked */ static Boolean metaVerbose = FALSE; static Boolean metaIgnoreCMDs = FALSE; /* ignore CMDs in .meta files */ @@ -237,24 +239,13 @@ eat_dots(char *buf, size_t bufsz, int do static char * meta_name(struct GNode *gn, char *mname, size_t mnamelen, const char *dname, - const char *tname) + const char *tname, + const char *cwd) { char buf[MAXPATHLEN]; - char cwd[MAXPATHLEN]; char *rp; char *cp; char *tp; - char *p[4]; /* >= number of possible uses */ - int i; - - i = 0; - if (!dname) - dname = Var_Value(".OBJDIR", gn, &p[i++]); - if (!tname) - tname = Var_Value(TARGET, gn, &p[i++]); - - if (realpath(dname, cwd)) - dname = cwd; /* * Weed out relative paths from the target file name. @@ -264,7 +255,7 @@ meta_name(struct GNode *gn, char *mname, * basename as given to us. */ if ((cp = strrchr(tname, '/'))) { - if (realpath(tname, buf)) { + if (cached_realpath(tname, buf)) { if ((rp = strrchr(buf, '/'))) { rp++; cp++; @@ -309,9 +300,6 @@ meta_name(struct GNode *gn, char *mname, } } free(tp); - for (i--; i >= 0; i--) { - free(p[i]); - } return (mname); } @@ -391,29 +379,26 @@ printCMD(void *cmdp, void *mfpp) */ #define SKIP_META_TYPE(_type) do { \ if ((gn->type & __CONCAT(OP_, _type))) { \ - if (DEBUG(META)) { \ + if (verbose) { \ fprintf(debug_file, "Skipping meta for %s: .%s\n", \ gn->name, __STRING(_type)); \ } \ - return (NULL); \ + return FALSE; \ } \ } while (0) -static FILE * -meta_create(BuildMon *pbm, GNode *gn) + +/* + * Do we need/want a .meta file ? + */ +static Boolean +meta_needed(GNode *gn, const char *dname, const char *tname, + char *objdir, int verbose) { - meta_file_t mf; - char buf[MAXPATHLEN]; - char objdir[MAXPATHLEN]; - char **ptr; - const char *dname; - const char *tname; - char *fname; - const char *cp; - char *p[4]; /* >= possible uses */ - int i; struct stat fs; + if (verbose) + verbose = DEBUG(META); /* This may be a phony node which we don't want meta data for... */ /* Skip .meta for .BEGIN, .END, .ERROR etc as well. */ @@ -426,48 +411,70 @@ meta_create(BuildMon *pbm, GNode *gn) SKIP_META_TYPE(MAKE); } - mf.fp = NULL; - - i = 0; - - dname = Var_Value(".OBJDIR", gn, &p[i++]); - tname = Var_Value(TARGET, gn, &p[i++]); - - /* The object directory may not exist. Check it.. */ - if (stat(dname, &fs) != 0) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n", - gn->name); - goto out; - } /* Check if there are no commands to execute. */ if (Lst_IsEmpty(gn->commands)) { - if (DEBUG(META)) + if (verbose) fprintf(debug_file, "Skipping meta for %s: no commands\n", gn->name); - goto out; + return FALSE; + } + if ((gn->type & (OP_META|OP_SUBMAKE)) == OP_SUBMAKE) { + /* OP_SUBMAKE is a bit too aggressive */ + if (Lst_ForEach(gn->commands, is_submake, gn)) { + if (DEBUG(META)) + fprintf(debug_file, "Skipping meta for %s: .SUBMAKE\n", + gn->name); + return FALSE; + } + } + + /* The object directory may not exist. Check it.. */ + if (stat(dname, &fs) != 0) { + if (verbose) + fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n", + gn->name); + return FALSE; } /* make sure these are canonical */ - if (realpath(dname, objdir)) + if (cached_realpath(dname, objdir)) dname = objdir; /* If we aren't in the object directory, don't create a meta file. */ if (!metaCurdirOk && strcmp(curdir, dname) == 0) { - if (DEBUG(META)) + if (verbose) fprintf(debug_file, "Skipping meta for %s: .OBJDIR == .CURDIR\n", gn->name); - goto out; - } - if (!(gn->type & OP_META)) { - /* We do not generate .meta files for sub-makes */ - if (Lst_ForEach(gn->commands, is_submake, gn)) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: .MAKE\n", - gn->name); - goto out; - } + return FALSE; } + return TRUE; +} + + +static FILE * +meta_create(BuildMon *pbm, GNode *gn) +{ + meta_file_t mf; + char buf[MAXPATHLEN]; + char objdir[MAXPATHLEN]; + char **ptr; + const char *dname; + const char *tname; + char *fname; + const char *cp; + char *p[4]; /* >= possible uses */ + int i; + + mf.fp = NULL; + i = 0; + + dname = Var_Value(".OBJDIR", gn, &p[i++]); + tname = Var_Value(TARGET, gn, &p[i++]); + + /* if this succeeds objdir is realpath of dname */ + if (!meta_needed(gn, dname, tname, objdir, TRUE)) + goto out; + dname = objdir; if (metaVerbose) { char *mp; @@ -492,7 +499,7 @@ meta_create(BuildMon *pbm, GNode *gn) goto out; fname = meta_name(gn, pbm->meta_fname, sizeof(pbm->meta_fname), - dname, tname); + dname, tname, objdir); #ifdef DEBUG_META_MODE if (DEBUG(META)) @@ -561,6 +568,10 @@ meta_init(void) } +#define get_mode_bf(bf, token) \ + if ((cp = strstr(make_mode, token))) \ + bf = boolValue(&cp[sizeof(token) - 1]) + /* * Initialization we need after reading makefiles. */ @@ -583,17 +594,13 @@ meta_mode_init(const char *make_mode) writeMeta = FALSE; if (strstr(make_mode, "nofilemon")) useFilemon = FALSE; - if ((cp = strstr(make_mode, "curdirok="))) { - metaCurdirOk = boolValue(&cp[9]); - } - if ((cp = strstr(make_mode, "silent="))) { - metaSilent = boolValue(&cp[7]); - } if (strstr(make_mode, "ignore-cmd")) metaIgnoreCMDs = TRUE; - /* for backwards compatability */ - Var_Set(".MAKE.META_CREATED", "${.MAKE.META.CREATED}", VAR_GLOBAL, 0); - Var_Set(".MAKE.META_FILES", "${.MAKE.META.FILES}", VAR_GLOBAL, 0); + if (useFilemon) + get_mode_bf(filemonMissing, "missing-filemon="); + get_mode_bf(metaCurdirOk, "curdirok="); + get_mode_bf(metaMissing, "missing-meta="); + get_mode_bf(metaSilent, "silent="); } if (metaVerbose && !Var_Exists(MAKE_META_PREFIX, VAR_GLOBAL)) { /* @@ -921,6 +928,8 @@ meta_oodate(GNode *gn, Boolean oodate) char fname1[MAXPATHLEN]; char fname2[MAXPATHLEN]; char fname3[MAXPATHLEN]; + const char *dname; + const char *tname; char *p; char *cp; char *link_src; @@ -930,10 +939,23 @@ meta_oodate(GNode *gn, Boolean oodate) FILE *fp; Boolean needOODATE = FALSE; Lst missingFiles; - + char *pa[4]; /* >= possible uses */ + int i; + int have_filemon = FALSE; + if (oodate) return oodate; /* we're done */ + i = 0; + + dname = Var_Value(".OBJDIR", gn, &pa[i++]); + tname = Var_Value(TARGET, gn, &pa[i++]); + + /* if this succeeds fname3 is realpath of dname */ + if (!meta_needed(gn, dname, tname, fname3, FALSE)) + goto oodate_out; + dname = fname3; + missingFiles = Lst_Init(FALSE); /* @@ -944,7 +966,7 @@ meta_oodate(GNode *gn, Boolean oodate) */ Make_DoAllVar(gn); - meta_name(gn, fname, sizeof(fname), NULL, NULL); + meta_name(gn, fname, sizeof(fname), dname, tname, dname); #ifdef DEBUG_META_MODE if (DEBUG(META)) @@ -957,7 +979,6 @@ meta_oodate(GNode *gn, Boolean oodate) int lineno = 0; int lastpid = 0; int pid; - int f = 0; int x; LstNode ln; struct stat fs; @@ -996,13 +1017,13 @@ meta_oodate(GNode *gn, Boolean oodate) link_src = NULL; move_target = NULL; /* Find the start of the build monitor section. */ - if (!f) { + if (!have_filemon) { if (strncmp(buf, "-- filemon", 10) == 0) { - f = 1; + have_filemon = TRUE; continue; } if (strncmp(buf, "# buildmon", 10) == 0) { - f = 1; + have_filemon = TRUE; continue; } } @@ -1014,7 +1035,7 @@ meta_oodate(GNode *gn, Boolean oodate) fprintf(debug_file, "%s: %d: %s\n", fname, lineno, buf); #endif strsep(&p, " "); - if (f) { + if (have_filemon) { /* * We are in the 'filemon' output section. * Each record from filemon follows the general form: @@ -1239,7 +1260,7 @@ meta_oodate(GNode *gn, Boolean oodate) * they are _expected_ to change. */ if (*p == '/') { - realpath(p, fname1); /* clean it up */ + cached_realpath(p, fname1); /* clean it up */ if (Lst_ForEach(metaIgnorePaths, prefix_match, fname1)) { #ifdef DEBUG_META_MODE if (DEBUG(META)) @@ -1324,7 +1345,7 @@ meta_oodate(GNode *gn, Boolean oodate) oodate = TRUE; } else if (S_ISDIR(fs.st_mode)) { /* Update the latest directory. */ - realpath(p, latestdir); + cached_realpath(p, latestdir); } } else if (errno == ENOENT && *p == '/' && strncmp(p, cwd, cwdlen) != 0) { @@ -1434,12 +1455,27 @@ meta_oodate(GNode *gn, Boolean oodate) fname, (char *)Lst_Datum(Lst_First(missingFiles))); oodate = TRUE; } - } else { - if ((gn->type & OP_META)) { + if (!oodate && !have_filemon && filemonMissing) { if (DEBUG(META)) - fprintf(debug_file, "%s: required but missing\n", fname); + fprintf(debug_file, "%s: missing filemon data\n", fname); oodate = TRUE; } + } else { + if (writeMeta && metaMissing) { + cp = NULL; + + /* if target is in .CURDIR we do not need a meta file */ + if (gn->path && (cp = strrchr(gn->path, '/')) && cp > gn->path) { + if (strncmp(curdir, gn->path, (cp - gn->path)) != 0) { + cp = NULL; /* not in .CURDIR */ + } + } + if (!cp) { + if (DEBUG(META)) + fprintf(debug_file, "%s: required but missing\n", fname); + oodate = TRUE; + } + } } Lst_Destroy(missingFiles, (FreeProc *)free); @@ -1454,6 +1490,11 @@ meta_oodate(GNode *gn, Boolean oodate) Var_Set(OODATE, Var_Value(ALLSRC, gn, &cp), gn, 0); free(cp); } + + oodate_out: + for (i--; i >= 0; i--) { + free(pa[i]); + } return oodate; } Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/mk/ChangeLog Sun Jun 5 20:26:16 2016 (r301462) @@ -1,3 +1,16 @@ +2016-06-02 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160602 + * meta.autodep.mk: when passing META_FILES to gendirdeps.mk + do not apply :T to META_XTRAS + patch from Bryan Drewery at FreeBSD.org. + +2016-05-30 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160530 + * meta.stage.mk: we assume ${CLEANFILES} gets .NOPATH + make it so. + 2016-05-12 Simon J. Gerraty * install-mk (MK_VERSION): 20160512 Modified: head/contrib/bmake/mk/dpadd.mk ============================================================================== --- head/contrib/bmake/mk/dpadd.mk Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/mk/dpadd.mk Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -# $Id: dpadd.mk,v 1.21 2016/05/18 20:54:55 sjg Exp $ +# $Id: dpadd.mk,v 1.22 2016/05/31 23:30:59 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -100,7 +100,7 @@ __dpadd_libs := ${DPADD:M*/lib*} # Order -L's to search ours first. # Avoids picking up old versions already installed. -__dpadd_libdirs := ${__dpadd_libs}:R:H:S/^/-L/g:O:u:N-L} +__dpadd_libdirs := ${__dpadd_libs:R:H:S/^/-L/g:O:u:N-L} LDADD += ${__dpadd_libdirs:M-L${OBJTOP}/*} LDADD += ${__dpadd_libdirs:N-L${OBJTOP}/*:N-L${HOST_LIBDIR:U/usr/lib}} .if defined(HOST_LIBDIR) && ${HOST_LIBDIR} != "/usr/lib" Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/mk/install-mk Sun Jun 5 20:26:16 2016 (r301462) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.126 2016/05/18 20:54:55 sjg Exp $ +# $Id: install-mk,v 1.128 2016/06/03 17:22:32 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20160512 +MK_VERSION=20160602 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/mk/meta.autodep.mk ============================================================================== --- head/contrib/bmake/mk/meta.autodep.mk Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/mk/meta.autodep.mk Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.44 2016/04/07 17:00:38 sjg Exp $ +# $Id: meta.autodep.mk,v 1.45 2016/06/03 17:22:32 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -266,7 +266,7 @@ ${_DEPENDFILE}: ${_depend} ${.PARSEDIR}/ DPADD='${FORCE_DPADD:O:u}' ${_gendirdeps_mutex} \ MAKESYSPATH=${_makesyspath} \ ${.MAKE} -f gendirdeps.mk RELDIR=${RELDIR} _DEPENDFILE=${_DEPENDFILE} \ - META_FILES='${META_XTRAS:T:O:u} ${META_FILES:T:O:u:${META_FILE_FILTER:ts:}}') + META_FILES='${META_XTRAS:O:u} ${META_FILES:T:O:u:${META_FILE_FILTER:ts:}}') @test -s $@ && touch $@; : .endif Modified: head/contrib/bmake/mk/meta.stage.mk ============================================================================== --- head/contrib/bmake/mk/meta.stage.mk Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/mk/meta.stage.mk Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.44 2016/03/16 18:21:23 sjg Exp $ +# $Id: meta.stage.mk,v 1.45 2016/05/26 03:59:09 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -270,6 +270,8 @@ beforeinstall: .dirdep .NOPATH: ${STAGE_FILES} .if !empty(STAGE_TARGETS) +.NOPATH: ${CLEANFILES} + MK_STALE_STAGED?= no .if ${MK_STALE_STAGED} == "yes" all: stale_staged Modified: head/contrib/bmake/nonints.h ============================================================================== --- head/contrib/bmake/nonints.h Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/nonints.h Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.72 2016/02/18 20:25:08 sjg Exp $ */ +/* $NetBSD: nonints.h,v 1.73 2016/06/03 01:21:59 sjg Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -122,6 +122,7 @@ void execError(const char *, const char char *getTmpdir(void); Boolean s2Boolean(const char *, Boolean); Boolean getBoolean(const char *, Boolean); +char *cached_realpath(const char *, char *); /* parse.c */ void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Sun Jun 5 19:12:52 2016 (r301461) +++ head/contrib/bmake/var.c Sun Jun 5 20:26:16 2016 (r301462) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $ */ +/* $NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"); +__RCSID("$NetBSD: var.c,v 1.208 2016/06/03 01:21:59 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -530,7 +530,7 @@ VarAdd(const char *name, const char *val h = Hash_CreateEntry(&ctxt->context, name, NULL); Hash_SetValue(h, v); v->name = h->name; - if (DEBUG(VAR)) { + if (DEBUG(VAR) && (ctxt->flags & INTERNAL) == 0) { fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name, val); } } @@ -1950,7 +1950,7 @@ VarRealpath(GNode *ctx MAKE_ATTR_UNUSED, Buf_AddByte(buf, vpstate->varSpace); } addSpace = TRUE; - rp = realpath(word, rbuf); + rp = cached_realpath(word, rbuf); if (rp && *rp == '/' && stat(rp, &st) == 0) word = rp; Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Sun Jun 5 19:12:52 2016 (r301461) +++ head/usr.bin/bmake/Makefile Sun Jun 5 20:26:16 2016 (r301462) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.63 2016/05/12 20:34:46 sjg Exp $ +# $Id: Makefile,v 1.66 2016/06/04 22:21:15 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160512 +_MAKE_VERSION= 20160604 PROG?= ${.CURDIR:T} From owner-svn-src-all@freebsd.org Sun Jun 5 20:53:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A8ADB6A4F1; Sun, 5 Jun 2016 20:53:28 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from mr11p00im-asmtp001.me.com (mr11p00im-asmtp001.me.com [17.110.69.252]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3218B1AC5; Sun, 5 Jun 2016 20:53:28 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp001.me.com by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O8B00B00FMEPV00@mr11p00im-asmtp001.me.com>; Sun, 05 Jun 2016 20:53:22 +0000 (GMT) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=UTF-8 Received: from akita.hsd1.ca.comcast.net (c-73-222-51-139.hsd1.ca.comcast.net [73.222.51.139]) by mr11p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O8B000CDGOXLN30@mr11p00im-asmtp001.me.com>; Sun, 05 Jun 2016 20:53:22 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-05_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1606050255 Message-id: <1465159996.2319.1.camel@me.com> Subject: Re: svn commit: r301172 - head/contrib/blacklist From: Rui Paulo To: Jan Beich , Kurt Lidl Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 05 Jun 2016 13:53:16 -0700 In-reply-to: References: <201606012204.u51M4AUj056457@repo.freebsd.org> X-Mailer: Evolution 3.20.2-2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1465160002; bh=HM8z2XbFbDU9VeZYmYKvIpGXQMdQG7pmOY+5dNc6xlI=; h=MIME-version:Content-type:Message-id:Subject:From:To:Date; b=LF47HpzhX6flQNK0SwUUhyu+KF0lPj9/AAM7bSj2F4Z0cOil0Fw0ed6uqGe5haSN4 q/0CepMPO6Cn1yHg5ye0d4Ymh8GAveiCmiaute2Vm3hjLSVHJ2ejY6JzYCrutE0eAB eVxKZGn67w0CCGAYzR/tKF7QN1VWcO5ZvTAz/bz1AqHq3ofC9Nki18NUyQ0qiXXGF2 Y59zqo/Y7BFfvy1IdYI7nmSSnMrQFJrriuEcAj7eq5egzpCSMil3XREzb048NhpioX rY+X2e65XkF+kWNHVHmWW1xx4SFMgHZTqH27urKyqYClF79MVtWUrwrGpt+8wXVzh7 mRwG0Brk5vFEw== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 20:53:28 -0000 On Fri, 2016-06-03 at 08:50 +0200, Jan Beich wrote: > Kurt Lidl writes: > > > Author: lidl > > Date: Wed Jun  1 22:04:10 2016 > > New Revision: 301172 > > URL: https://svnweb.freebsd.org/changeset/base/301172 > > > > Log: > >   Import NetBSD's blacklist source from vendor tree > >    > >   This import includes The basic blacklist library and utility > > programs, > >   to add a system-wide packet filtering notification mechanism to > >   FreeBSD. > >    > >   The rational behind the daemon was given by Christos Zoulas in a > >   presentation at vBSDcon 2015: https://youtu.be/fuuf8G28mjs > >    > >   Reviewed by: rpaulo > >   Approved by: rpaulo > >   Obtained from: NetBSD > >   Relnotes: YES > > Can you track FreeBSD version in manpages? Maybe ping upstream, so > they > add .Fx as well. > > $ fgrep .Nx contrib/blacklist/**/*.[0-9] > contrib/blacklist/bin/blacklistctl.8:.Nx 7 . > contrib/blacklist/bin/blacklistd.8:.Nx 7 . > contrib/blacklist/bin/blacklistd.conf.5:.Nx 7 . > > $ man blacklistd | col -b | fgrep -A1 HISTORY > HISTORY >      blacklistd appeared in NetBSD 7. We don't really need to submit that change to NetBSD.  Just change the man page in FreeBSD and hopefully future merges won't remove it. ;-) -- Rui Paulo From owner-svn-src-all@freebsd.org Sun Jun 5 20:58:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F25B6A678; Sun, 5 Jun 2016 20:58:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4411DB2; Sun, 5 Jun 2016 20:58:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55Kw7RK075629; Sun, 5 Jun 2016 20:58:07 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55Kw75C075628; Sun, 5 Jun 2016 20:58:07 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201606052058.u55Kw75C075628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sun, 5 Jun 2016 20:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r301463 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 20:58:08 -0000 Author: rpaulo Date: Sun Jun 5 20:58:07 2016 New Revision: 301463 URL: https://svnweb.freebsd.org/changeset/base/301463 Log: Free Kurt Lidl from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Jun 5 20:26:16 2016 (r301462) +++ svnadmin/conf/mentors Sun Jun 5 20:58:07 2016 (r301463) @@ -31,7 +31,6 @@ peterj jhb Co-mentor: grog phil theraven Co-mentor: sjg slm ken Co-mentor: scottl, ambrisko snb dwmalone -lidl rpaulo Co-mentor: adrian torek rpaulo venkat delphij Co-mentor: luigi, jhb versus gavin Co-mentor: fjoe From owner-svn-src-all@freebsd.org Sun Jun 5 21:17:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 016AEB6B11E; Sun, 5 Jun 2016 21:17:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E5E7A1FCC; Sun, 5 Jun 2016 21:17:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id D979D100F; Sun, 5 Jun 2016 21:17:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8BF8220A48; Sun, 5 Jun 2016 21:17:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Ej-NmEHajkIO; Sun, 5 Jun 2016 21:17:13 +0000 (UTC) Subject: Re: svn commit: r301462 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 9AE3220A3D To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606052026.u55KQG6A064049@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <0b66d72a-76f0-deb1-1955-13409b3ff51f@FreeBSD.org> Date: Sun, 5 Jun 2016 14:17:10 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606052026.u55KQG6A064049@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 21:17:17 -0000 On 6/5/16 1:26 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Sun Jun 5 20:26:16 2016 > New Revision: 301462 > URL: https://svnweb.freebsd.org/changeset/base/301462 > > Log: > Import bmake-20160604 > > Performace improvements for meta mode. Thanks! -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Sun Jun 5 21:21:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00310B6B251; Sun, 5 Jun 2016 21:21:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C190F127D; Sun, 5 Jun 2016 21:21:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55LLfWf086570; Sun, 5 Jun 2016 21:21:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55LLfSs086569; Sun, 5 Jun 2016 21:21:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052121.u55LLfSs086569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 21:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301464 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 21:21:43 -0000 Author: bdrewery Date: Sun Jun 5 21:21:41 2016 New Revision: 301464 URL: https://svnweb.freebsd.org/changeset/base/301464 Log: Import latest meta.stage.mk 1.45 (r301462) Modified: head/share/mk/meta.stage.mk Modified: head/share/mk/meta.stage.mk ============================================================================== --- head/share/mk/meta.stage.mk Sun Jun 5 20:58:07 2016 (r301463) +++ head/share/mk/meta.stage.mk Sun Jun 5 21:21:41 2016 (r301464) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: meta.stage.mk,v 1.44 2016/03/16 18:21:23 sjg Exp $ +# $Id: meta.stage.mk,v 1.45 2016/05/26 03:59:09 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -271,6 +271,8 @@ beforeinstall: .dirdep .NOPATH: ${STAGE_FILES} .if !empty(STAGE_TARGETS) +.NOPATH: ${CLEANFILES} + MK_STALE_STAGED?= no .if ${MK_STALE_STAGED} == "yes" all: stale_staged From owner-svn-src-all@freebsd.org Sun Jun 5 23:04:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B800BB6BAF5; Sun, 5 Jun 2016 23:04:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 856991729; Sun, 5 Jun 2016 23:04:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N4F4V023899; Sun, 5 Jun 2016 23:04:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N4FrW023898; Sun, 5 Jun 2016 23:04:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052304.u55N4FrW023898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301465 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:04:16 -0000 Author: bdrewery Date: Sun Jun 5 23:04:15 2016 New Revision: 301465 URL: https://svnweb.freebsd.org/changeset/base/301465 Log: Fix bmake version upgrade logic to use the new bmake. Otherwise it was only used on the next build. This was a flaw in r295980. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jun 5 21:21:41 2016 (r301464) +++ head/Makefile Sun Jun 5 23:04:15 2016 (r301465) @@ -170,9 +170,13 @@ HAVE_MAKE= bmake .else HAVE_MAKE= fmake .endif +.if ${HAVE_MAKE} != ${WANT_MAKE} || \ + (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) +NEED_MAKE_UPGRADE= t +.endif .if exists(${MYMAKE}) SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk -.elif ${WANT_MAKE} != ${HAVE_MAKE} +.elif defined(NEED_MAKE_UPGRADE) # It may not exist yet but we may cause it to. # In the case of fmake, upgrade_checks may cause a newer version to be built. SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ @@ -313,8 +317,7 @@ kernel: buildkernel installkernel # for building the world. # upgrade_checks: -.if ${HAVE_MAKE} != ${WANT_MAKE} || \ - (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) +.if defined(NEED_MAKE_UPGRADE) @${_+_}(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) .endif From owner-svn-src-all@freebsd.org Sun Jun 5 23:04:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64D55B6BB65; Sun, 5 Jun 2016 23:04:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 273AD18C6; Sun, 5 Jun 2016 23:04:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N4hFw023964; Sun, 5 Jun 2016 23:04:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N4hcb023959; Sun, 5 Jun 2016 23:04:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052304.u55N4hcb023959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301466 - in head: . share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:04:44 -0000 Author: bdrewery Date: Sun Jun 5 23:04:42 2016 New Revision: 301466 URL: https://svnweb.freebsd.org/changeset/base/301466 Log: WITH_META_MODE: Enable bmake's missing meta rebuild feature Modified: head/Makefile head/share/mk/local.meta.sys.mk head/share/mk/sys.mk head/tools/build/options/WITH_META_MODE Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jun 5 23:04:15 2016 (r301465) +++ head/Makefile Sun Jun 5 23:04:42 2016 (r301466) @@ -162,8 +162,13 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH # We cannot blindly use a make which may not be the one we want # so be exlicit - until all choice is removed. WANT_MAKE= bmake +.if !empty(.MAKE.MODE:Mmeta) +# 20160604 - support missing-meta,missing-filemon and performance improvements +WANT_MAKE_VERSION= 20160604 +.else # 20160220 - support .dinclude for FAST_DEPEND. WANT_MAKE_VERSION= 20160220 +.endif MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} .if defined(.PARSEDIR) HAVE_MAKE= bmake Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Sun Jun 5 23:04:15 2016 (r301465) +++ head/share/mk/local.meta.sys.mk Sun Jun 5 23:04:42 2016 (r301466) @@ -278,3 +278,8 @@ CFLAGS+= ${CROSS_TARGET_FLAGS} ACFLAGS+= ${CROSS_TARGET_FLAGS} LDFLAGS+= -Wl,-m -Wl,elf_${MACHINE_ARCH}_fbsd .endif + +META_MODE+= missing-meta=yes +.if empty(META_MODE:Mnofilemon) +META_MODE+= missing-filemon=yes +.endif Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun Jun 5 23:04:15 2016 (r301465) +++ head/share/mk/sys.mk Sun Jun 5 23:04:42 2016 (r301466) @@ -47,6 +47,9 @@ __ENV_ONLY_OPTIONS:= \ .elif ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) && ${.MAKEFLAGS:M-B} == "" # verbose will show .MAKE.META.PREFIX for each target. META_MODE+= meta verbose +.if !defined(NO_META_MISSING) +META_MODE+= missing-meta=yes +.endif # silent will hide command output if a .meta file is created. .if !defined(NO_SILENT) META_MODE+= silent=yes @@ -57,6 +60,10 @@ META_MODE+= silent=yes .endif META_MODE+= nofilemon .endif +# Require filemon data with bmake +.if empty(META_MODE:Mnofilemon) +META_MODE+= missing-filemon=yes +.endif .endif META_MODE?= normal .export META_MODE Modified: head/tools/build/options/WITH_META_MODE ============================================================================== --- head/tools/build/options/WITH_META_MODE Sun Jun 5 23:04:15 2016 (r301465) +++ head/tools/build/options/WITH_META_MODE Sun Jun 5 23:04:42 2016 (r301466) @@ -19,9 +19,10 @@ The command to execute changes. .It The current working directory changes. .It -The target's meta file is missing, if it had -.Sy .META -as a dependency. +The target's meta file is missing. +.It +The target's meta file is missing filemon data when filemon is loaded +and a previous run did not have it loaded. .It [requires .Xr filemon 4 ] From owner-svn-src-all@freebsd.org Sun Jun 5 23:05:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E48CBB6BBAD; Sun, 5 Jun 2016 23:05:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4D11A6F; Sun, 5 Jun 2016 23:05:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N51WW024033; Sun, 5 Jun 2016 23:05:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N51KI024032; Sun, 5 Jun 2016 23:05:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052305.u55N51KI024032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301467 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:05:03 -0000 Author: bdrewery Date: Sun Jun 5 23:05:01 2016 New Revision: 301467 URL: https://svnweb.freebsd.org/changeset/base/301467 Log: WITH_META_MODE: Avoid host tool timestamps causing a rebuild. Using buildworld, installworld, buildworld. It is expected that nothing should rebuild. However any host tool used could have its timestamp updated. Any library used by dynamic tools could have its timestamp updated. The filemon(4) data in the .meta files captures all reads to these files. This causes the 2nd buildworld to rebuild everything since host tools and files have been updated. Because the build is self-reliant and bootstraps itself, it should be safe to ignore mtime changes on host files used during the build. Host files should only impact the build of legacy, build-tools, bootstrap-tools, cross-tools, but those are already intended to be reproducible from its own bootstrapping. It is possible in a rare case that a bug in a host file does produce a broken build tool. If that happens it will just have to be communicated properly. An alternative solution would be to update the mtime of all files in the object directory after installworld so that the host files are not newer than the object files. That also requires special care for read-only obj directories and special care to not mess with any intended timestamps in the build, such as done for reproducibility. Reported by: many Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun Jun 5 23:04:42 2016 (r301466) +++ head/share/mk/sys.mk Sun Jun 5 23:05:01 2016 (r301467) @@ -68,6 +68,26 @@ META_MODE+= missing-filemon=yes META_MODE?= normal .export META_MODE .MAKE.MODE?= ${META_MODE} +.if !empty(.MAKE.MODE:Mmeta) && !defined(NO_META_IGNORE_HOST) +# Ignore host file changes that will otherwise cause +# buildworld -> installworld -> buildworld to rebuild everything. +# Since the build is self-reliant and bootstraps everything it needs, +# this should not be a real problem for incremental builds. +# Note that these are prefix matching, so /lib matches /libexec. +.MAKE.META.IGNORE_PATHS+= \ + ${__MAKE_SHELL} \ + /bin \ + /lib \ + /rescue \ + /sbin \ + /usr/bin \ + /usr/include \ + /usr/lib \ + /usr/sbin \ + /usr/share \ + +.endif + .if ${MK_AUTO_OBJ} == "yes" # This needs to be done early - before .PATH is computed From owner-svn-src-all@freebsd.org Sun Jun 5 23:05:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF5A2B6BBF6; Sun, 5 Jun 2016 23:05:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E7651AEF; Sun, 5 Jun 2016 23:05:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N57Ef024128; Sun, 5 Jun 2016 23:05:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N57bQ024127; Sun, 5 Jun 2016 23:05:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052305.u55N57bQ024127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301469 - head/targets/pseudo/bootstrap-tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:05:09 -0000 Author: bdrewery Date: Sun Jun 5 23:05:07 2016 New Revision: 301469 URL: https://svnweb.freebsd.org/changeset/base/301469 Log: DIRDEPS_BUILD: Fix bootstrap-tools not handling CCACHE_DIR properly. CCACHE_DIR needs to be resolved to its full path before processing legacy.meta or meta mode may see the change to the stats file. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/pseudo/bootstrap-tools/Makefile Modified: head/targets/pseudo/bootstrap-tools/Makefile ============================================================================== --- head/targets/pseudo/bootstrap-tools/Makefile Sun Jun 5 23:05:04 2016 (r301468) +++ head/targets/pseudo/bootstrap-tools/Makefile Sun Jun 5 23:05:07 2016 (r301469) @@ -84,3 +84,6 @@ BSTCARGS= \ # finally we build toolchain leveraging the above. bootstrap-toolchain: .MAKE cross-tools ${BSTCENV} ${MAKE} -C ${.CURDIR:H:H} ${BSTCARGS} toolchain + +# Ensure CCACHE_DIR is ignored since we are processing .meta files here. +.include From owner-svn-src-all@freebsd.org Sun Jun 5 23:05:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D892B6BC27; Sun, 5 Jun 2016 23:05:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483DB1C06; Sun, 5 Jun 2016 23:05:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N5Adc024174; Sun, 5 Jun 2016 23:05:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N5Al5024173; Sun, 5 Jun 2016 23:05:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052305.u55N5Al5024173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301470 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:05:11 -0000 Author: bdrewery Date: Sun Jun 5 23:05:10 2016 New Revision: 301470 URL: https://svnweb.freebsd.org/changeset/base/301470 Log: Add a MINIMUM_SUPPORTED_OSREL and bump it to 900044. This is actually a revision in the stable/9 branch released as 9.1. The localedef build requires xlocale from this period. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 5 23:05:07 2016 (r301469) +++ head/Makefile.inc1 Sun Jun 5 23:05:10 2016 (r301470) @@ -431,6 +431,9 @@ PACKAGE= kernel # BOOTSTRAPPING?= 0 +# Keep these in sync +MINIMUM_SUPPORTED_OSREL?= 900044 +MINIMUM_SUPPORTED_REL?= 9.1 # Common environment for world related stages CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -1512,8 +1515,8 @@ _elftoolchain_libs= lib/libelf lib/libdw .endif legacy: .PHONY -.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0 - @echo "ERROR: Source upgrades from versions prior to 8.0 are not supported."; \ +.if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 + @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false .endif .for _tool in tools/build ${_elftoolchain_libs} From owner-svn-src-all@freebsd.org Sun Jun 5 23:05:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5289B6BBC2; Sun, 5 Jun 2016 23:05:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84B881A73; Sun, 5 Jun 2016 23:05:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N5488024081; Sun, 5 Jun 2016 23:05:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N54jJ024080; Sun, 5 Jun 2016 23:05:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052305.u55N54jJ024080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301468 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:05:05 -0000 Author: bdrewery Date: Sun Jun 5 23:05:04 2016 New Revision: 301468 URL: https://svnweb.freebsd.org/changeset/base/301468 Log: WITH_SYSTEM_COMPILER: Disable with WITH_META_MODE for now. The WITH_META_MODE build is intended to be a working incremental build. It spies on the build command to see if things should be rebuilt if the command changes. If you run buildworld, it builds a cross-compiler, then do installworld and buildworld again it will invoke the WITH_SYSTEM_COMPILER logic. This then adds on -target/--sysroot, etc, and causes rebuilds due to the changed build command even though the compiler used is technically the same revision. Since the incremental build is not cleaning anything by default then there is much less risk to rebuilding the already-existing cross-compiler. Just disable the combined logic and always use and build the cross-compiler. An alternative to this would be to always pass -target/--sysroot. Doing so may occur in the future. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Jun 5 23:05:01 2016 (r301467) +++ head/share/mk/src.opts.mk Sun Jun 5 23:05:04 2016 (r301468) @@ -352,6 +352,10 @@ MK_ELFTOOLCHAIN_BOOTSTRAP:= no MK_GCC_BOOTSTRAP:= no .endif +.if ${MK_META_MODE} == "yes" +MK_SYSTEM_COMPILER:= no +.endif + .if ${MK_TOOLCHAIN} == "no" MK_BINUTILS:= no MK_CLANG:= no From owner-svn-src-all@freebsd.org Sun Jun 5 23:05:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 046F6B6BCAC; Sun, 5 Jun 2016 23:05:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B21891E24; Sun, 5 Jun 2016 23:05:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N5Hfg024282; Sun, 5 Jun 2016 23:05:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N5HUq024280; Sun, 5 Jun 2016 23:05:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052305.u55N5HUq024280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301472 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:05:19 -0000 Author: bdrewery Date: Sun Jun 5 23:05:17 2016 New Revision: 301472 URL: https://svnweb.freebsd.org/changeset/base/301472 Log: Only include bsd.compiler.mk for bmakes that use -m .../share/mk by default. Otherwise they error when trying to include the file, which also has its own dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jun 5 23:05:14 2016 (r301471) +++ head/Makefile Sun Jun 5 23:05:17 2016 (r301472) @@ -103,7 +103,9 @@ # This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION # can be cached for sub-makes. +.if ${MAKE_VERSION} >= 20140620 .include +.endif # Note: we use this awkward construct to be compatible with FreeBSD's # old make used in 10.0 and 9.2 and earlier. From owner-svn-src-all@freebsd.org Sun Jun 5 23:05:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18807B6BC7C; Sun, 5 Jun 2016 23:05:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFD401D60; Sun, 5 Jun 2016 23:05:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55N5Fq7024232; Sun, 5 Jun 2016 23:05:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55N5ERU024225; Sun, 5 Jun 2016 23:05:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052305.u55N5ERU024225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301471 - in head: contrib/elftoolchain/brandelf contrib/elftoolchain/elfcopy contrib/elftoolchain/elfdump contrib/elftoolchain/libdwarf contrib/elftoolchain/libelftc contrib/elftoolcha... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:05:16 -0000 Author: bdrewery Date: Sun Jun 5 23:05:14 2016 New Revision: 301471 URL: https://svnweb.freebsd.org/changeset/base/301471 Log: Use the in-tree sys/elf_common.h to build libelftc. This fixes build failures on older releases that lack various definitions such as EM_AARCH64 (which was unfixed before this). Revert all of the recent compatibility changes that worked around this problem. This uses the same method of using the in-tree header as lib/libelf, lib/libdwarf and usr.bin/readelf. Reviewed by: emaste Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6734 Modified: head/contrib/elftoolchain/brandelf/brandelf.c head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c head/contrib/elftoolchain/readelf/readelf.c head/lib/libelftc/Makefile Modified: head/contrib/elftoolchain/brandelf/brandelf.c ============================================================================== --- head/contrib/elftoolchain/brandelf/brandelf.c Sun Jun 5 23:05:10 2016 (r301470) +++ head/contrib/elftoolchain/brandelf/brandelf.c Sun Jun 5 23:05:14 2016 (r301471) @@ -46,11 +46,6 @@ ELFTC_VCSID("$Id: brandelf.c 3440 2016-04-07 14:51:47Z emaste $"); -/* Backwards compatability for older FreeBSD releases. */ -#ifndef ELFOSABI_CLOUDABI -#define ELFOSABI_CLOUDABI 17 -#endif - static int elftype(const char *); static const char *iselftype(int); static void printelftypes(void); Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Sun Jun 5 23:05:10 2016 (r301470) +++ head/contrib/elftoolchain/elfcopy/main.c Sun Jun 5 23:05:14 2016 (r301471) @@ -41,11 +41,6 @@ ELFTC_VCSID("$Id: main.c 3446 2016-05-03 01:31:17Z emaste $"); -/* Backwards compatability for older FreeBSD releases. */ -#ifndef ELFOSABI_CLOUDABI -#define ELFOSABI_CLOUDABI 17 -#endif - enum options { ECP_ADD_GNU_DEBUGLINK, Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Sun Jun 5 23:05:10 2016 (r301470) +++ head/contrib/elftoolchain/elfdump/elfdump.c Sun Jun 5 23:05:14 2016 (r301471) @@ -52,14 +52,6 @@ ELFTC_VCSID("$Id: elfdump.c 3474 2016-05-17 20:44:53Z emaste $"); -/* Backwards compatability for older FreeBSD releases. */ -#ifndef EM_IAMCU -#define EM_IAMCU 6 -#endif -#ifndef EM_RISCV -#define EM_RISCV 243 -#endif - #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" #if ELFTC_CLASS == ELFCLASS32 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Sun Jun 5 23:05:10 2016 (r301470) +++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Sun Jun 5 23:05:14 2016 (r301471) @@ -28,11 +28,6 @@ ELFTC_VCSID("$Id: libdwarf_reloc.c 3198 2015-05-14 18:36:19Z emaste $"); -/* Backwards compatability for older FreeBSD releases. */ -#ifndef EM_IAMCU -#define EM_IAMCU 6 -#endif - Dwarf_Unsigned _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) { Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Sun Jun 5 23:05:10 2016 (r301470) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Sun Jun 5 23:05:14 2016 (r301471) @@ -31,14 +31,6 @@ #include #include -/* Backwards compatability for older FreeBSD releases. */ -#ifndef EM_IAMCU -#define EM_IAMCU 6 -#endif -#ifndef EM_RISCV -#define EM_RISCV 243 -#endif - const char * elftc_reloc_type_str(unsigned int mach, unsigned int type) { Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Sun Jun 5 23:05:10 2016 (r301470) +++ head/contrib/elftoolchain/readelf/readelf.c Sun Jun 5 23:05:14 2016 (r301471) @@ -50,15 +50,6 @@ ELFTC_VCSID("$Id: readelf.c 3469 2016-05-15 23:16:09Z emaste $"); /* Backwards compatability for older FreeBSD releases. */ -#ifndef ELFOSABI_CLOUDABI -#define ELFOSABI_CLOUDABI 17 -#endif -#ifndef EM_IAMCU -#define EM_IAMCU 6 -#endif -#ifndef EM_RISCV -#define EM_RISCV 243 -#endif #ifndef STB_GNU_UNIQUE #define STB_GNU_UNIQUE 10 #endif Modified: head/lib/libelftc/Makefile ============================================================================== --- head/lib/libelftc/Makefile Sun Jun 5 23:05:10 2016 (r301470) +++ head/lib/libelftc/Makefile Sun Jun 5 23:05:14 2016 (r301471) @@ -29,4 +29,17 @@ CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTC MAN= +# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile +# We need to link against the correct version of these files. One +# solution is to include ../../sys in the include path. This causes +# problems when a header file in sys depends on a file in another +# part of the tree, e.g. a machine dependent header. +# +SRCS+= sys/elf_common.h +CLEANDIRS= sys +CFLAGS+= -I. +sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA + mkdir -p ${.OBJDIR}/sys + ln -sf ${.ALLSRC} ${.TARGET} + .include From owner-svn-src-all@freebsd.org Sun Jun 5 23:07:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4110B6BE72; Sun, 5 Jun 2016 23:07:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D539713C7; Sun, 5 Jun 2016 23:07:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id CEDA51D7A; Sun, 5 Jun 2016 23:07:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8F0E220B5A; Sun, 5 Jun 2016 23:07:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id PQ_Z_Lq5BpX6; Sun, 5 Jun 2016 23:07:30 +0000 (UTC) Subject: Re: svn commit: r301172 - head/contrib/blacklist DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 0C66420B53 To: Kurt Lidl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606012204.u51M4AUj056457@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <6db835af-3e1c-0b99-67c8-4c62fcc10190@FreeBSD.org> Date: Sun, 5 Jun 2016 16:07:29 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606012204.u51M4AUj056457@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:07:33 -0000 On 6/1/16 3:04 PM, Kurt Lidl wrote: > Author: lidl > Date: Wed Jun 1 22:04:10 2016 > New Revision: 301172 > URL: https://svnweb.freebsd.org/changeset/base/301172 > > Log: > Import NetBSD's blacklist source from vendor tree no description found for WITHOUT_BLACKLIST, skipping no description found for WITHOUT_BLACKLIST_SUPPORT, skipping Need to add these in tools/build/options, svn commit, svn up, and then run from that directory: ./makeman > ../../../share/man/man5/src.conf.5 Then commit ../../../share/man/man5/src.conf.5 -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Sun Jun 5 23:10:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 355FAB6BF3A; Sun, 5 Jun 2016 23:10:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02B9A1737; Sun, 5 Jun 2016 23:10:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55NA6eu024595; Sun, 5 Jun 2016 23:10:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55NA6gn024594; Sun, 5 Jun 2016 23:10:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052310.u55NA6gn024594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301473 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:10:07 -0000 Author: bdrewery Date: Sun Jun 5 23:10:05 2016 New Revision: 301473 URL: https://svnweb.freebsd.org/changeset/base/301473 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Jun 5 23:05:17 2016 (r301472) +++ head/share/man/man5/src.conf.5 Sun Jun 5 23:10:05 2016 (r301473) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd May 24, 2016 +.Dd June 5, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1062,7 +1062,7 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 300630 2016-05-24 23:15:52Z bdrewery +.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 301466 2016-06-05 23:04:42Z bdrewery Creates .Xr make 1 meta files when building, which can provide a reliable incremental build when @@ -1083,9 +1083,10 @@ The command to execute changes. .It The current working directory changes. .It -The target's meta file is missing, if it had -.Sy .META -as a dependency. +The target's meta file is missing. +.It +The target's meta file is missing filemon data when filemon is loaded +and a previous run did not have it loaded. .It [requires .Xr filemon 4 ] From owner-svn-src-all@freebsd.org Sun Jun 5 23:14:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52A76B6B0C3; Sun, 5 Jun 2016 23:14:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24DE21B76; Sun, 5 Jun 2016 23:14:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55NE692028148; Sun, 5 Jun 2016 23:14:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55NE6vB028147; Sun, 5 Jun 2016 23:14:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052314.u55NE6vB028147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301474 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:14:07 -0000 Author: bdrewery Date: Sun Jun 5 23:14:06 2016 New Revision: 301474 URL: https://svnweb.freebsd.org/changeset/base/301474 Log: Document WITH_META_MODE enforcing WITHOUT_SYSTEM_COMPILER. makeman doesn't handle this since it would need to enable all non-default options when checking enabling 1 option, which then convolutes what is really affecting each other. Modified: head/tools/build/options/WITH_META_MODE Modified: head/tools/build/options/WITH_META_MODE ============================================================================== --- head/tools/build/options/WITH_META_MODE Sun Jun 5 23:10:05 2016 (r301473) +++ head/tools/build/options/WITH_META_MODE Sun Jun 5 23:14:06 2016 (r301474) @@ -42,3 +42,6 @@ The build operates as it normally would This option originally invoked a different build system but that was renamed to .Va WITH_DIRDEPS_BUILD . +.Pp +Currently this also enforces +.Va WITHOUT_SYSTEM_COMPILER . From owner-svn-src-all@freebsd.org Sun Jun 5 23:16:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B63B6B1B8; Sun, 5 Jun 2016 23:16:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC5931DDF; Sun, 5 Jun 2016 23:16:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55NGR28028301; Sun, 5 Jun 2016 23:16:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55NGR3T028300; Sun, 5 Jun 2016 23:16:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052316.u55NGR3T028300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301475 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:16:29 -0000 Author: bdrewery Date: Sun Jun 5 23:16:27 2016 New Revision: 301475 URL: https://svnweb.freebsd.org/changeset/base/301475 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Jun 5 23:14:06 2016 (r301474) +++ head/share/man/man5/src.conf.5 Sun Jun 5 23:16:27 2016 (r301475) @@ -1062,7 +1062,7 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 301466 2016-06-05 23:04:42Z bdrewery +.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 301474 2016-06-05 23:14:06Z bdrewery Creates .Xr make 1 meta files when building, which can provide a reliable incremental build when @@ -1107,6 +1107,9 @@ This option originally invoked a differe to .Va WITH_DIRDEPS_BUILD . .Pp +Currently this also enforces +.Va WITHOUT_SYSTEM_COMPILER . +.Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , not From owner-svn-src-all@freebsd.org Sun Jun 5 23:34:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 409FCB6B572; Sun, 5 Jun 2016 23:34:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12DED1953; Sun, 5 Jun 2016 23:34:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55NYJoT035894; Sun, 5 Jun 2016 23:34:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55NYJIe035893; Sun, 5 Jun 2016 23:34:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052334.u55NYJIe035893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301476 - head/usr.bin/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:34:20 -0000 Author: bdrewery Date: Sun Jun 5 23:34:19 2016 New Revision: 301476 URL: https://svnweb.freebsd.org/changeset/base/301476 Log: Use the in-tree sys/elf_common.h This is the same fix as r301471. Modified: head/usr.bin/elfcopy/Makefile Modified: head/usr.bin/elfcopy/Makefile ============================================================================== --- head/usr.bin/elfcopy/Makefile Sun Jun 5 23:16:27 2016 (r301475) +++ head/usr.bin/elfcopy/Makefile Sun Jun 5 23:34:19 2016 (r301476) @@ -30,4 +30,17 @@ MAN= ${PROG}.1 strip.1 LINKS= ${BINDIR}/${PROG} ${BINDIR}/strip +# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile +# We need to link against the correct version of these files. One +# solution is to include ../../sys in the include path. This causes +# problems when a header file in sys depends on a file in another +# part of the tree, e.g. a machine dependent header. +# +SRCS+= sys/elf_common.h +CLEANDIRS= sys +CFLAGS+= -I. +sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA + mkdir -p ${.OBJDIR}/sys + ln -sf ${.ALLSRC} ${.TARGET} + .include From owner-svn-src-all@freebsd.org Sun Jun 5 23:56:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13E2BB6BA46; Sun, 5 Jun 2016 23:56:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D95B012CC; Sun, 5 Jun 2016 23:56:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u55NuT0h043387; Sun, 5 Jun 2016 23:56:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u55NuTWC043386; Sun, 5 Jun 2016 23:56:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606052356.u55NuTWC043386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Jun 2016 23:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301477 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 23:56:30 -0000 Author: bdrewery Date: Sun Jun 5 23:56:28 2016 New Revision: 301477 URL: https://svnweb.freebsd.org/changeset/base/301477 Log: legacy: Avoid building/installing headers twice. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 5 23:34:19 2016 (r301476) +++ head/Makefile.inc1 Sun Jun 5 23:56:28 2016 (r301477) @@ -1524,8 +1524,9 @@ legacy: .PHONY cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ - ${MAKE} DIRPRFX=${_tool}/ all; \ - ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install + ${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no all; \ + ${MAKE} DIRPRFX=${_tool}/ MK_INCLUDES=no \ + DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor # From owner-svn-src-all@freebsd.org Mon Jun 6 00:35:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF8FEB6A647; Mon, 6 Jun 2016 00:35:46 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9143312BD; Mon, 6 Jun 2016 00:35:46 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u560ZjEt058247; Mon, 6 Jun 2016 00:35:45 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u560ZjfA058246; Mon, 6 Jun 2016 00:35:45 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201606060035.u560ZjfA058246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 6 Jun 2016 00:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301478 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 00:35:46 -0000 Author: gnn Date: Mon Jun 6 00:35:45 2016 New Revision: 301478 URL: https://svnweb.freebsd.org/changeset/base/301478 Log: Add missing constants from RFCs 4443 and 6550 Modified: head/sys/netinet/icmp6.h Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Sun Jun 5 23:56:28 2016 (r301477) +++ head/sys/netinet/icmp6.h Mon Jun 6 00:35:45 2016 (r301478) @@ -144,6 +144,9 @@ struct icmp6_hdr { #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ #define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ #define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */ +#define ICMP6_DST_UNREACH_POLICY 5 /* failed ingress/egress policy */ +#define ICMP6_DST_UNREACH_REJECT 6 /* Reject route to destination */ +#define ICMP6_DST_UNREACH_SRCROUTE 7 /* Error in source routing header */ #define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */ #define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */ From owner-svn-src-all@freebsd.org Mon Jun 6 02:43:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C4BDB6A4EF; Mon, 6 Jun 2016 02:43:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C04841CBA; Mon, 6 Jun 2016 02:43:42 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u562hfGM005774; Mon, 6 Jun 2016 02:43:41 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u562hfOE005772; Mon, 6 Jun 2016 02:43:41 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606060243.u562hfOE005772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 6 Jun 2016 02:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301479 - in head: etc/mtree share/examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 02:43:43 -0000 Author: araujo Date: Mon Jun 6 02:43:41 2016 New Revision: 301479 URL: https://svnweb.freebsd.org/changeset/base/301479 Log: Install/Connect ypldap.conf(5) on examples. Modified: head/etc/mtree/BSD.usr.dist head/share/examples/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Mon Jun 6 00:35:45 2016 (r301478) +++ head/etc/mtree/BSD.usr.dist Mon Jun 6 02:43:41 2016 (r301479) @@ -425,6 +425,8 @@ .. uefisign .. + ypldap + .. .. firmware .. Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Mon Jun 6 00:35:45 2016 (r301478) +++ head/share/examples/Makefile Mon Jun 6 02:43:41 2016 (r301479) @@ -37,7 +37,8 @@ LDIRS= BSD_daemon \ ses \ scsi_target \ sunrpc \ - uefisign + uefisign \ + ypldap XFILES= BSD_daemon/FreeBSD.pfa \ BSD_daemon/README \ @@ -192,7 +193,8 @@ XFILES= BSD_daemon/FreeBSD.pfa \ sunrpc/sort/rsort.c \ sunrpc/sort/sort.x \ sunrpc/sort/sort_proc.c \ - uefisign/uefikeys + uefisign/uefikeys \ + ypldap/ypldap.conf BINDIR= ${SHAREDIR}/examples From owner-svn-src-all@freebsd.org Mon Jun 6 03:55:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C62F6B6B371; Mon, 6 Jun 2016 03:55:01 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 977AD12C8; Mon, 6 Jun 2016 03:55:01 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u563t0lN033205; Mon, 6 Jun 2016 03:55:00 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u563t0XO033203; Mon, 6 Jun 2016 03:55:00 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606060355.u563t0XO033203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 6 Jun 2016 03:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301480 - in head/etc: defaults rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 03:55:01 -0000 Author: araujo Date: Mon Jun 6 03:55:00 2016 New Revision: 301480 URL: https://svnweb.freebsd.org/changeset/base/301480 Log: Add rc.d script for ypldap(8). Added: head/etc/rc.d/ypldap (contents, props changed) Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Jun 6 02:43:41 2016 (r301479) +++ head/etc/defaults/rc.conf Mon Jun 6 03:55:00 2016 (r301480) @@ -392,6 +392,8 @@ nis_ypxfrd_enable="NO" # Run rpc.ypxfrd nis_ypxfrd_flags="" # Flags to rpc.ypxfrd (if enabled). nis_yppasswdd_enable="NO" # Run rpc.yppasswdd at boot time (or NO). nis_yppasswdd_flags="" # Flags to rpc.yppasswdd (if enabled). +nis_ypldap_enable="NO" # Run ypldap at boot time (or NO). +nis_ypldap_flags="" # Flags to ypldap (if enabled). ### SNMP daemon ### # Be sure to understand the security implications of running SNMP v1/v2 Added: head/etc/rc.d/ypldap ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/ypldap Mon Jun 6 03:55:00 2016 (r301480) @@ -0,0 +1,27 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: ypldap +# REQUIRE: ypserv +# BEFORE: DAEMON +# KEYWORD: shutdown + +. /etc/rc.subr + +name="ypldap" +rcvar="nis_ypldap_enable" + +load_rc_config $name + +command="/usr/sbin/${name}" +command_args="${nis_ypldap_flags}" + +start_precmd="ypldap_precmd" + +ypldap_precmd() +{ + force_depend ypserv nis_server || return 1 +} +run_rc_command "$1" From owner-svn-src-all@freebsd.org Mon Jun 6 04:13:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C7DB6B6F1; Mon, 6 Jun 2016 04:13:50 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73E101DB2; Mon, 6 Jun 2016 04:13:50 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u564DnHj040498; Mon, 6 Jun 2016 04:13:49 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u564Dnvr040497; Mon, 6 Jun 2016 04:13:49 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606060413.u564Dnvr040497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 6 Jun 2016 04:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301481 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 04:13:50 -0000 Author: araujo Date: Mon Jun 6 04:13:49 2016 New Revision: 301481 URL: https://svnweb.freebsd.org/changeset/base/301481 Log: Connect ypldap(8) script on Makefile, forgotten on my previous commit r301480. Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Mon Jun 6 03:55:00 2016 (r301480) +++ head/etc/rc.d/Makefile Mon Jun 6 04:13:49 2016 (r301481) @@ -120,6 +120,7 @@ FILES= DAEMON \ var \ watchdogd \ ypbind \ + ypldap \ yppasswdd \ ypserv \ ypset \ From owner-svn-src-all@freebsd.org Mon Jun 6 04:18:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F6E9B6B77A; Mon, 6 Jun 2016 04:18:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D01D71F43; Mon, 6 Jun 2016 04:18:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u564Iunu040706; Mon, 6 Jun 2016 04:18:56 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u564IuLW040705; Mon, 6 Jun 2016 04:18:56 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606060418.u564IuLW040705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 6 Jun 2016 04:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301482 - head/usr.sbin/bluetooth/btpand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 04:18:58 -0000 Author: araujo Date: Mon Jun 6 04:18:56 2016 New Revision: 301482 URL: https://svnweb.freebsd.org/changeset/base/301482 Log: For pointers use NULL instead of 0. Modified: head/usr.sbin/bluetooth/btpand/btpand.c Modified: head/usr.sbin/bluetooth/btpand/btpand.c ============================================================================== --- head/usr.sbin/bluetooth/btpand/btpand.c Mon Jun 6 04:13:49 2016 (r301481) +++ head/usr.sbin/bluetooth/btpand/btpand.c Mon Jun 6 04:18:56 2016 (r301482) @@ -171,7 +171,7 @@ main(int argc, char *argv[]) usage(); if (!bdaddr_any(&remote_bdaddr) && (server_limit != 0 || - control_path != 0 || (service_name != NULL && l2cap_psm != 0))) + control_path != NULL || (service_name != NULL && l2cap_psm != 0))) usage(); /* default options */ From owner-svn-src-all@freebsd.org Mon Jun 6 05:55:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 776EAB6CF2A; Mon, 6 Jun 2016 05:55:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3951A1EAE; Mon, 6 Jun 2016 05:55:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u565tcAh077008; Mon, 6 Jun 2016 05:55:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u565tbcc077000; Mon, 6 Jun 2016 05:55:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606060555.u565tbcc077000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 6 Jun 2016 05:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301483 - in head/sys: conf dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 modules/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 05:55:39 -0000 Author: sephe Date: Mon Jun 6 05:55:37 2016 New Revision: 301483 URL: https://svnweb.freebsd.org/changeset/base/301483 Log: hyperv: Move machine dependent bits into machine dependent files. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6701 Added: head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c (contents, props changed) head/sys/dev/hyperv/vmbus/hyperv_machdep.h (contents, props changed) head/sys/dev/hyperv/vmbus/i386/hyperv_machdep.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/hyperv/vmbus/hyperv.c head/sys/modules/hyperv/vmbus/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Jun 6 04:18:56 2016 (r301482) +++ head/sys/conf/files.amd64 Mon Jun 6 05:55:37 2016 (r301483) @@ -278,6 +278,7 @@ dev/hyperv/vmbus/hyperv.c optional hy dev/hyperv/vmbus/hyperv_busdma.c optional hyperv dev/hyperv/vmbus/vmbus.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv +dev/hyperv/vmbus/amd64/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Jun 6 04:18:56 2016 (r301482) +++ head/sys/conf/files.i386 Mon Jun 6 05:55:37 2016 (r301483) @@ -253,6 +253,7 @@ dev/hyperv/vmbus/hyperv.c optional hy dev/hyperv/vmbus/hyperv_busdma.c optional hyperv dev/hyperv/vmbus/vmbus.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv +dev/hyperv/vmbus/i386/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis Added: head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Mon Jun 6 05:55:37 2016 (r301483) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +uint64_t +hypercall_md(volatile void *hc_addr, uint64_t in_val, + uint64_t in_paddr, uint64_t out_paddr) +{ + uint64_t status; + + __asm__ __volatile__ ("mov %0, %%r8" : : "r" (out_paddr): "r8"); + __asm__ __volatile__ ("call *%3" : "=a" (status) : + "c" (in_val), "d" (in_paddr), "m" (hc_addr)); + return (status); +} Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Mon Jun 6 04:18:56 2016 (r301482) +++ head/sys/dev/hyperv/vmbus/hyperv.c Mon Jun 6 05:55:37 2016 (r301483) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -104,40 +105,17 @@ hyperv_get_timecount(struct timecounter * @brief Invoke the specified hypercall */ static uint64_t -hv_vmbus_do_hypercall(uint64_t control, void* input, void* output) +hv_vmbus_do_hypercall(uint64_t value, void *input, void *output) { -#ifdef __x86_64__ - uint64_t hv_status = 0; - uint64_t input_address = (input) ? hv_get_phys_addr(input) : 0; - uint64_t output_address = (output) ? hv_get_phys_addr(output) : 0; - volatile void *hypercall_page = hypercall_context.hc_addr; - - __asm__ __volatile__ ("mov %0, %%r8" : : "r" (output_address): "r8"); - __asm__ __volatile__ ("call *%3" : "=a"(hv_status): - "c" (control), "d" (input_address), - "m" (hypercall_page)); - return (hv_status); -#else - uint32_t control_high = control >> 32; - uint32_t control_low = control & 0xFFFFFFFF; - uint32_t hv_status_high = 1; - uint32_t hv_status_low = 1; - uint64_t input_address = (input) ? hv_get_phys_addr(input) : 0; - uint32_t input_address_high = input_address >> 32; - uint32_t input_address_low = input_address & 0xFFFFFFFF; - uint64_t output_address = (output) ? hv_get_phys_addr(output) : 0; - uint32_t output_address_high = output_address >> 32; - uint32_t output_address_low = output_address & 0xFFFFFFFF; - volatile void *hypercall_page = hypercall_context.hc_addr; - - __asm__ __volatile__ ("call *%8" : "=d"(hv_status_high), - "=a"(hv_status_low) : "d" (control_high), - "a" (control_low), "b" (input_address_high), - "c" (input_address_low), - "D"(output_address_high), - "S"(output_address_low), "m" (hypercall_page)); - return (hv_status_low | ((uint64_t)hv_status_high << 32)); -#endif /* __x86_64__ */ + uint64_t in_paddr = 0, out_paddr = 0; + + if (input != NULL) + in_paddr = hv_get_phys_addr(input); + if (output != NULL) + out_paddr = hv_get_phys_addr(output); + + return hypercall_md(hypercall_context.hc_addr, value, + in_paddr, out_paddr); } /** Added: head/sys/dev/hyperv/vmbus/hyperv_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/hyperv_machdep.h Mon Jun 6 05:55:37 2016 (r301483) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _HYPERV_MACHDEP_H_ +#define _HYPERV_MACHDEP_H_ + +#include + +uint64_t hypercall_md(volatile void *hc_addr, uint64_t in_val, + uint64_t in_paddr, uint64_t out_paddr); + +#endif /* !_HYPERV_MACHDEP_H_ */ Added: head/sys/dev/hyperv/vmbus/i386/hyperv_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/vmbus/i386/hyperv_machdep.c Mon Jun 6 05:55:37 2016 (r301483) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +uint64_t +hypercall_md(volatile void *hc_addr, uint64_t in_val, + uint64_t in_paddr, uint64_t out_paddr) +{ + uint32_t in_val_hi = in_val >> 32; + uint32_t in_val_lo = in_val & 0xFFFFFFFF; + uint32_t status_hi, status_lo; + uint32_t in_paddr_hi = in_paddr >> 32; + uint32_t in_paddr_lo = in_paddr & 0xFFFFFFFF; + uint32_t out_paddr_hi = out_paddr >> 32; + uint32_t out_paddr_lo = out_paddr & 0xFFFFFFFF; + + __asm__ __volatile__ ("call *%8" : "=d"(status_hi), "=a"(status_lo) : + "d" (in_val_hi), "a" (in_val_lo), + "b" (in_paddr_hi), "c" (in_paddr_lo), + "D"(out_paddr_hi), "S"(out_paddr_lo), + "m" (hc_addr)); + return (status_lo | ((uint64_t)status_hi << 32)); +} Modified: head/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- head/sys/modules/hyperv/vmbus/Makefile Mon Jun 6 04:18:56 2016 (r301482) +++ head/sys/modules/hyperv/vmbus/Makefile Mon Jun 6 05:55:37 2016 (r301483) @@ -10,6 +10,7 @@ SRCS= hv_channel.c \ hv_ring_buffer.c \ hyperv.c \ hyperv_busdma.c \ + hyperv_machdep.c \ vmbus.c \ vmbus_et.c SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h From owner-svn-src-all@freebsd.org Mon Jun 6 06:06:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8A30B6D160; Mon, 6 Jun 2016 06:06:58 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward1h.cmail.yandex.net (forward1h.cmail.yandex.net [IPv6:2a02:6b8:0:f35::11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3581431; Mon, 6 Jun 2016 06:06:58 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback10h.mail.yandex.net (mxback10h.mail.yandex.net [84.201.186.19]) by forward1h.cmail.yandex.net (Yandex) with ESMTP id E94AC20BB6; Mon, 6 Jun 2016 09:06:53 +0300 (MSK) Received: from web29h.yandex.ru (web29h.yandex.ru [84.201.187.163]) by mxback10h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id i6TmWUc6As-6qFOKYYo; Mon, 06 Jun 2016 09:06:52 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1465193212; bh=apsvOkuih3ttIpPvLaSjcUJ4+0Qi8e7FTigieJL4ilo=; h=X-Yandex-Sender-Uid:From:Envelope-From:To:Cc:In-Reply-To: References:Subject:MIME-Version:Message-Id:X-Mailer:Date: Content-Transfer-Encoding:Content-Type; b=sB0wCUHhS0RVJyupbIsWQxgjFFiU2MCao/8JeeGRFHN5GQ4CHtj5OE41nSmlVVUG0 we7XD6/O8burlAO0Eb8OihbIyTMrAoV655T3TTUb5GkEikW3k57iLUjovbTGRwHpIC tCGcWs5P3zMDXYwsZEqMISNrgafDJuo6aeA1lveM= Authentication-Results: mxback10h.mail.yandex.net; dkim=pass header.i=@ipfw.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0,1 0,1 1130000031510964 X-Yandex-Sender-Uid: 1130000014307927 Received: by web29h.yandex.ru with HTTP; Mon, 06 Jun 2016 09:06:52 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: George Neville-Neil Cc: Mike Karels , src-committers , svn-src-all , svn-src-head In-Reply-To: References: <201606021751.u52HpTrH090384@repo.freebsd.org> <3448221465067132@web17h.yandex.ru> Subject: Re: svn commit: r301217 - in head/sys: net netinet netinet6 MIME-Version: 1.0 Message-Id: <3505271465193212@web29h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 06 Jun 2016 09:06:52 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 06:06:58 -0000 06.06.2016, 04:40, "George Neville-Neil" : > On 4 Jun 2016, at 15:05, Alexander V. Chernikov wrote: > >>  02.06.2016, 20:51, "George V. Neville-Neil" : >>>  Author: gnn >>>  Date: Thu Jun 2 17:51:29 2016 >>>  New Revision: 301217 >>>  URL: https://svnweb.freebsd.org/changeset/base/301217 >>> >>>  Log: >>>    This change re-adds L2 caching for TCP and UDP, as originally >>>  added in D4306 >>>    but removed due to other changes in the system. Restore the >>>  llentry pointer >>>    to the "struct route", and use it to cache the L2 lookup (ARP or >>>  ND6) as >>>    appropriate. >> >>  I have several comments regarding this commit. >> >>  1 Architecturally, there was quite a lot of efforts to eliminate >>  layering violation between lltable and other places in network stack. >>  It ended by committing D4102, which allowed both to cleanup lower >>  level, provide abstract “prepend” framework which could be used to >>  provide cached data to _otuput() functions. >>  This change brings these violations back in a really invasive way. >> >>  Additionally, implementing L2 PCB caching at the other subsystem >>  expense is really a bad idea. >>  If one wants caching in some subsystem, it should be implemented in >>  that subsystem not polluting other things. >>  Current implementation permits this by filling in “ro_prepend” / >>  ro_plen fields. >> >>  In general, this change looks more like a local hack and not like the >>  code that should be included in the tree. >> >>  2 There was no benchmarks proving the effectiveness of this change. >>  (For example, it is not obvious if it could significantly improve TCP >>  since we still have per-session TCP wlock + (typically) per-ring >>  mutex, so removing lltable rock might not help things here). Given >>  that the patch complicates existing code, there should be adequate >>  benefits to consider whether this change is worth implementing. >> >>  3 The “network” group was not included to the review despite the >>  fact that most of the changes were related to the L2 layer which is >>  not “transport”, so some people might have missed this review. >> >>  4 This change DOES NOT WORK. really. >>  (which raises questions on both review and benchmarking process). >> >>  The reason is that “plle” argument is filled only in “heavy” >>  lltable lookup functions (e.g. when we don’t have neighbour >>  adjacency). 99.9% of the time arpresolve/nd6_resolve() returns the >>  result w/o calling their heavy versions, and the returned “plle” >>  is NULL. >> >>  This can be easily verified by calling something like >>  dtrace -n 'fbt:kernel:ether_output:entry /arg3!=NULL&&((struct route >>  *)arg3)->ro_lle != NULL/ { stack(); }' >> >>  Given that, I kindly ask you to backout this change. > > Hi, > > I'm going to limit the scope of this reply to just you, me and Mike > Karels, from whom this originated. No, please keep the discussion open. The decision on having that particular L2 caching implementation (and L2 caching in general) is quite important, so it would be great if all technical arguments were saved so other people can (now or later) understand the decision details. Thanks for understanding. > > Best, > George From owner-svn-src-all@freebsd.org Mon Jun 6 06:18:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7661BB6D2E9; Mon, 6 Jun 2016 06:18:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE6919B9; Mon, 6 Jun 2016 06:18:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u566IJ5T084326; Mon, 6 Jun 2016 06:18:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u566IJVa084323; Mon, 6 Jun 2016 06:18:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606060618.u566IJVa084323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 6 Jun 2016 06:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301484 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 06:18:20 -0000 Author: sephe Date: Mon Jun 6 06:18:18 2016 New Revision: 301484 URL: https://svnweb.freebsd.org/changeset/base/301484 Log: hyperv/vmbus: Define type for channel messages. And fix message processing; only channel messages are supported. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6706 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_reg.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Mon Jun 6 05:55:37 2016 (r301483) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Mon Jun 6 06:18:18 2016 (r301484) @@ -373,8 +373,8 @@ int hv_vmbus_post_message(void *buffer, * insufficient resources. 20 times should suffice in practice. */ for (retries = 0; retries < 20; retries++) { - ret = hv_vmbus_post_msg_via_msg_ipc(connId, 1, buffer, - bufferLen); + ret = hv_vmbus_post_msg_via_msg_ipc(connId, + VMBUS_MSGTYPE_CHANNEL, buffer, bufferLen); if (ret == HV_STATUS_SUCCESS) return (0); Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Jun 6 05:55:37 2016 (r301483) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Jun 6 06:18:18 2016 (r301484) @@ -85,8 +85,13 @@ vmbus_msg_task(void *xsc, int pending __ hv_vmbus_channel_msg_header *hdr; hv_vmbus_channel_msg_type msg_type; - if (msg->msg_type == VMBUS_MSGTYPE_NONE) - break; /* no message */ + if (msg->msg_type == VMBUS_MSGTYPE_NONE) { + /* No message */ + break; + } else if (msg->msg_type != VMBUS_MSGTYPE_CHANNEL) { + /* Not a channel message */ + goto handled; + } /* XXX: update messageHandler interface */ hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *, Modified: head/sys/dev/hyperv/vmbus/vmbus_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_reg.h Mon Jun 6 05:55:37 2016 (r301483) +++ head/sys/dev/hyperv/vmbus/vmbus_reg.h Mon Jun 6 06:18:18 2016 (r301484) @@ -49,6 +49,7 @@ struct vmbus_message { CTASSERT(sizeof(struct vmbus_message) == VMBUS_MSG_SIZE); #define VMBUS_MSGTYPE_NONE 0 +#define VMBUS_MSGTYPE_CHANNEL 1 #define VMBUS_MSGTYPE_TIMER_EXPIRED 0x80000010 #define VMBUS_MSGFLAG_PENDING 0x01 From owner-svn-src-all@freebsd.org Mon Jun 6 07:09:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E322EB6D9AB; Mon, 6 Jun 2016 07:09:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B430C1E5A; Mon, 6 Jun 2016 07:09:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56792nl002682; Mon, 6 Jun 2016 07:09:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56792uW002681; Mon, 6 Jun 2016 07:09:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606060709.u56792uW002681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 6 Jun 2016 07:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301485 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 07:09:04 -0000 Author: adrian Date: Mon Jun 6 07:09:02 2016 New Revision: 301485 URL: https://svnweb.freebsd.org/changeset/base/301485 Log: [bwn] don't use a 1MB CCK RTS frame for 11a OFDM transmissions. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon Jun 6 06:18:18 2016 (r301484) +++ head/sys/dev/bwn/if_bwn.c Mon Jun 6 07:09:02 2016 (r301485) @@ -6229,7 +6229,6 @@ bwn_set_txhdr(struct bwn_mac *mac, struc else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) rate = rate_fb = tp->ucastrate; else { - /* XXX TODO: don't fall back to CCK rates for OFDM */ rix = ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; @@ -6324,9 +6323,11 @@ bwn_set_txhdr(struct bwn_mac *mac, struc macctl |= BWN_TX_MAC_LONGFRAME; if (ic->ic_flags & IEEE80211_F_USEPROT) { - /* XXX RTS rate is always 1MB??? */ - /* XXX TODO: don't fall back to CCK rates for OFDM */ - rts_rate = BWN_CCK_RATE_1MB; + /* Note: don't fall back to CCK rates for 5G */ + if (phy->gmode) + rts_rate = BWN_CCK_RATE_1MB; + else + rts_rate = BWN_OFDM_RATE_6MB; rts_rate_fb = bwn_get_fbrate(rts_rate); /* XXX 'rate' here is hardware rate now, not the net80211 rate */ From owner-svn-src-all@freebsd.org Mon Jun 6 07:10:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3734B6DA21; Mon, 6 Jun 2016 07:10:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE27B1024; Mon, 6 Jun 2016 07:10:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u567Acbq002801; Mon, 6 Jun 2016 07:10:38 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u567Ackh002797; Mon, 6 Jun 2016 07:10:38 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201606060710.u567Ackh002797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Mon, 6 Jun 2016 07:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301486 - stable/10/sys/dev/mrsas X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 07:10:40 -0000 Author: kadesai Date: Mon Jun 6 07:10:38 2016 New Revision: 301486 URL: https://svnweb.freebsd.org/changeset/base/301486 Log: MFC r301203 r301203: Added support for Avago/Broadcom Cutlass(12 Gbps- 16 port count) controllers. Sponsored by: AVAGO Technologies/Broadcom Limited Modified: stable/10/sys/dev/mrsas/mrsas.c stable/10/sys/dev/mrsas/mrsas.h stable/10/sys/dev/mrsas/mrsas_cam.c stable/10/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas.c Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas.c Mon Jun 6 07:10:38 2016 (r301486) @@ -188,6 +188,8 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"}, {0x1000, MRSAS_INTRUDER, 0xffff, 0xffff, "AVAGO Intruder SAS Controller"}, {0x1000, MRSAS_INTRUDER_24, 0xffff, 0xffff, "AVAGO Intruder_24 SAS Controller"}, + {0x1000, MRSAS_CUTLASS_52, 0xffff, 0xffff, "AVAGO Cutlass_52 SAS Controller"}, + {0x1000, MRSAS_CUTLASS_53, 0xffff, 0xffff, "AVAGO Cutlass_53 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -1629,7 +1631,9 @@ mrsas_complete_cmd(struct mrsas_softc *s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1653,7 +1657,9 @@ mrsas_complete_cmd(struct mrsas_softc *s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -2454,7 +2460,9 @@ mrsas_ioc_init(struct mrsas_softc *sc) if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -3490,7 +3498,9 @@ mrsas_build_mptmfi_passthru(struct mrsas if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: stable/10/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/10/sys/dev/mrsas/mrsas.h Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas.h Mon Jun 6 07:10:38 2016 (r301486) @@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$"); #define MRSAS_FURY 0x005f #define MRSAS_INTRUDER 0x00ce #define MRSAS_INTRUDER_24 0x00cf +#define MRSAS_CUTLASS_52 0x0052 +#define MRSAS_CUTLASS_53 0x0053 #define MRSAS_PCI_BAR0 0x10 #define MRSAS_PCI_BAR1 0x14 #define MRSAS_PCI_BAR2 0x1C Modified: stable/10/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas_cam.c Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas_cam.c Mon Jun 6 07:10:38 2016 (r301486) @@ -880,7 +880,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -912,7 +914,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -1191,7 +1195,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1205,7 +1211,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1218,7 +1226,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) { + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1230,7 +1240,9 @@ mrsas_data_load_cb(void *arg, bus_dma_se if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: stable/10/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas_fp.c Mon Jun 6 07:09:02 2016 (r301485) +++ stable/10/sys/dev/mrsas/mrsas_fp.c Mon Jun 6 07:10:38 2016 (r301486) @@ -752,7 +752,9 @@ mr_spanset_get_phy_params(struct mrsas_s if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) do_invader = 1; /* Get row and span from io_info for Uneven Span IO. */ @@ -966,7 +968,9 @@ MR_BuildRaidContext(struct mrsas_softc * if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) pRAID_Context->regLockFlags = (isRead) ? raid->regTypeReqOnRead : raid->regTypeReqOnWrite; else pRAID_Context->regLockFlags = (isRead) ? REGION_TYPE_SHARED_READ : raid->regTypeReqOnWrite; @@ -1454,7 +1458,9 @@ MR_GetPhyParams(struct mrsas_softc *sc, if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY) || (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24)) + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) do_invader = 1; row = mega_div64_32(stripRow, raid->rowDataSize); From owner-svn-src-all@freebsd.org Mon Jun 6 07:27:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8F99B6DC59; Mon, 6 Jun 2016 07:27:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1B2185B; Mon, 6 Jun 2016 07:27:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u567RvfT009994; Mon, 6 Jun 2016 07:27:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u567Rvqi009990; Mon, 6 Jun 2016 07:27:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606060727.u567Rvqi009990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 6 Jun 2016 07:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301487 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 07:27:58 -0000 Author: sephe Date: Mon Jun 6 07:27:57 2016 New Revision: 301487 URL: https://svnweb.freebsd.org/changeset/base/301487 Log: hyperv/vmbus: Factor out channel message processing This paves the way for further cleanup. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6707 Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun 6 07:10:38 2016 (r301486) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun 6 07:27:57 2016 (r301487) @@ -40,6 +40,14 @@ * Internal functions */ +typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg); + +typedef struct hv_vmbus_channel_msg_table_entry { + hv_vmbus_channel_msg_type messageType; + + vmbus_msg_handler messageHandler; +} hv_vmbus_channel_msg_table_entry; + static void vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr); static void vmbus_channel_on_offer_internal(void* context); static void vmbus_channel_on_open_result(hv_vmbus_channel_msg_header* hdr); @@ -53,7 +61,7 @@ static void vmbus_channel_on_version_res /** * Channel message dispatch table */ -hv_vmbus_channel_msg_table_entry +static const hv_vmbus_channel_msg_table_entry g_channel_message_table[HV_CHANNEL_MESSAGE_COUNT] = { { HV_CHANNEL_MESSAGE_INVALID, NULL }, @@ -831,3 +839,25 @@ vmbus_rel_subchan(struct hv_vmbus_channe free(subchan, M_TEMP); } + +void +vmbus_chan_msgproc(struct vmbus_softc *sc, volatile struct vmbus_message *msg) +{ + const hv_vmbus_channel_msg_table_entry *entry; + hv_vmbus_channel_msg_header *hdr; + hv_vmbus_channel_msg_type msg_type; + + /* XXX: update messageHandler interface */ + hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *, msg->msg_data); + msg_type = hdr->message_type; + + if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) { + device_printf(sc->vmbus_dev, "unknown message type 0x%x\n", + msg_type); + return; + } + + entry = &g_channel_message_table[msg_type]; + if (entry->messageHandler) + entry->messageHandler(hdr); +} Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Jun 6 07:10:38 2016 (r301486) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Jun 6 07:27:57 2016 (r301487) @@ -364,16 +364,6 @@ typedef enum { extern hv_vmbus_connection hv_vmbus_g_connection; -typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg); - -typedef struct hv_vmbus_channel_msg_table_entry { - hv_vmbus_channel_msg_type messageType; - - vmbus_msg_handler messageHandler; -} hv_vmbus_channel_msg_table_entry; - -extern hv_vmbus_channel_msg_table_entry g_channel_message_table[]; - /* * Private, VM Bus functions */ Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Jun 6 07:10:38 2016 (r301486) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Jun 6 07:27:57 2016 (r301487) @@ -81,32 +81,14 @@ vmbus_msg_task(void *xsc, int pending __ msg = VMBUS_PCPU_GET(sc, message, curcpu) + VMBUS_SINT_MESSAGE; for (;;) { - const hv_vmbus_channel_msg_table_entry *entry; - hv_vmbus_channel_msg_header *hdr; - hv_vmbus_channel_msg_type msg_type; - if (msg->msg_type == VMBUS_MSGTYPE_NONE) { /* No message */ break; - } else if (msg->msg_type != VMBUS_MSGTYPE_CHANNEL) { - /* Not a channel message */ - goto handled; - } - - /* XXX: update messageHandler interface */ - hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *, - msg->msg_data); - msg_type = hdr->message_type; - - if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) { - printf("VMBUS: unknown message type = %d\n", msg_type); - goto handled; + } else if (msg->msg_type == VMBUS_MSGTYPE_CHANNEL) { + /* Channel message */ + vmbus_chan_msgproc(sc, msg); } - entry = &g_channel_message_table[msg_type]; - if (entry->messageHandler) - entry->messageHandler(hdr); -handled: msg->msg_type = VMBUS_MSGTYPE_NONE; /* * Make sure the write to msg_type (i.e. set to Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Jun 6 07:10:38 2016 (r301486) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Jun 6 07:27:57 2016 (r301487) @@ -93,6 +93,7 @@ vmbus_get_device(void) struct hv_vmbus_channel; struct trapframe; +struct vmbus_message; void vmbus_on_channel_open(const struct hv_vmbus_channel *); void vmbus_event_proc(struct vmbus_softc *, int); @@ -101,4 +102,7 @@ void vmbus_handle_intr(struct trapframe void vmbus_et_intr(struct trapframe *); +void vmbus_chan_msgproc(struct vmbus_softc *, + volatile struct vmbus_message *); + #endif /* !_VMBUS_VAR_H_ */ From owner-svn-src-all@freebsd.org Mon Jun 6 07:39:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACFA1B6DF68; Mon, 6 Jun 2016 07:39:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6771EB4; Mon, 6 Jun 2016 07:39:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u567diwU013627; Mon, 6 Jun 2016 07:39:44 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u567dixV013624; Mon, 6 Jun 2016 07:39:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606060739.u567dixV013624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 6 Jun 2016 07:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301488 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 07:39:45 -0000 Author: sephe Date: Mon Jun 6 07:39:44 2016 New Revision: 301488 URL: https://svnweb.freebsd.org/changeset/base/301488 Log: hyperv/vmbus: Constify channel message MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6708 Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun 6 07:27:57 2016 (r301487) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun 6 07:39:44 2016 (r301488) @@ -40,23 +40,29 @@ * Internal functions */ -typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg); +typedef void (*vmbus_msg_handler)(const hv_vmbus_channel_msg_header *msg); typedef struct hv_vmbus_channel_msg_table_entry { hv_vmbus_channel_msg_type messageType; - vmbus_msg_handler messageHandler; } hv_vmbus_channel_msg_table_entry; -static void vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr); -static void vmbus_channel_on_offer_internal(void* context); -static void vmbus_channel_on_open_result(hv_vmbus_channel_msg_header* hdr); -static void vmbus_channel_on_offer_rescind(hv_vmbus_channel_msg_header* hdr); -static void vmbus_channel_on_offer_rescind_internal(void* context); -static void vmbus_channel_on_gpadl_created(hv_vmbus_channel_msg_header* hdr); -static void vmbus_channel_on_gpadl_torndown(hv_vmbus_channel_msg_header* hdr); -static void vmbus_channel_on_offers_delivered(hv_vmbus_channel_msg_header* hdr); -static void vmbus_channel_on_version_response(hv_vmbus_channel_msg_header* hdr); +static void vmbus_channel_on_offer_internal(void *context); +static void vmbus_channel_on_offer_rescind_internal(void *context); + +static void vmbus_channel_on_offer(const hv_vmbus_channel_msg_header *hdr); +static void vmbus_channel_on_open_result( + const hv_vmbus_channel_msg_header *hdr); +static void vmbus_channel_on_offer_rescind( + const hv_vmbus_channel_msg_header *hdr); +static void vmbus_channel_on_gpadl_created( + const hv_vmbus_channel_msg_header *hdr); +static void vmbus_channel_on_gpadl_torndown( + const hv_vmbus_channel_msg_header *hdr); +static void vmbus_channel_on_offers_delivered( + const hv_vmbus_channel_msg_header *hdr); +static void vmbus_channel_on_version_response( + const hv_vmbus_channel_msg_header *hdr); /** * Channel message dispatch table @@ -392,12 +398,12 @@ vmbus_channel_select_defcpu(struct hv_vm * object to process the offer synchronously */ static void -vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr) +vmbus_channel_on_offer(const hv_vmbus_channel_msg_header *hdr) { - hv_vmbus_channel_offer_channel* offer; - hv_vmbus_channel_offer_channel* copied; + const hv_vmbus_channel_offer_channel *offer; + hv_vmbus_channel_offer_channel *copied; - offer = (hv_vmbus_channel_offer_channel*) hdr; + offer = (const hv_vmbus_channel_offer_channel *)hdr; // copy offer data copied = malloc(sizeof(*copied), M_DEVBUF, M_NOWAIT); @@ -470,12 +476,12 @@ vmbus_channel_on_offer_internal(void* co * synchronously */ static void -vmbus_channel_on_offer_rescind(hv_vmbus_channel_msg_header* hdr) +vmbus_channel_on_offer_rescind(const hv_vmbus_channel_msg_header *hdr) { - hv_vmbus_channel_rescind_offer* rescind; + const hv_vmbus_channel_rescind_offer *rescind; hv_vmbus_channel* channel; - rescind = (hv_vmbus_channel_rescind_offer*) hdr; + rescind = (const hv_vmbus_channel_rescind_offer *)hdr; channel = hv_vmbus_g_connection.channels[rescind->child_rel_id]; if (channel == NULL) @@ -502,7 +508,8 @@ vmbus_channel_on_offer_rescind_internal( * @brief Invoked when all offers have been delivered. */ static void -vmbus_channel_on_offers_delivered(hv_vmbus_channel_msg_header* hdr) +vmbus_channel_on_offers_delivered( + const hv_vmbus_channel_msg_header *hdr __unused) { mtx_lock(&vmbus_chwait_lock); @@ -519,14 +526,14 @@ vmbus_channel_on_offers_delivered(hv_vmb * response and signal the requesting thread. */ static void -vmbus_channel_on_open_result(hv_vmbus_channel_msg_header* hdr) +vmbus_channel_on_open_result(const hv_vmbus_channel_msg_header *hdr) { - hv_vmbus_channel_open_result* result; + const hv_vmbus_channel_open_result *result; hv_vmbus_channel_msg_info* msg_info; hv_vmbus_channel_msg_header* requestHeader; hv_vmbus_channel_open_channel* openMsg; - result = (hv_vmbus_channel_open_result*) hdr; + result = (const hv_vmbus_channel_open_result *)hdr; /* * Find the open msg, copy the result and signal/unblock the wait event @@ -561,14 +568,14 @@ vmbus_channel_on_open_result(hv_vmbus_ch * response and signal the requesting thread. */ static void -vmbus_channel_on_gpadl_created(hv_vmbus_channel_msg_header* hdr) +vmbus_channel_on_gpadl_created(const hv_vmbus_channel_msg_header *hdr) { - hv_vmbus_channel_gpadl_created* gpadl_created; + const hv_vmbus_channel_gpadl_created *gpadl_created; hv_vmbus_channel_msg_info* msg_info; hv_vmbus_channel_msg_header* request_header; hv_vmbus_channel_gpadl_header* gpadl_header; - gpadl_created = (hv_vmbus_channel_gpadl_created*) hdr; + gpadl_created = (const hv_vmbus_channel_gpadl_created *)hdr; /* Find the establish msg, copy the result and signal/unblock * the wait event @@ -603,14 +610,14 @@ vmbus_channel_on_gpadl_created(hv_vmbus_ * response and signal the requesting thread */ static void -vmbus_channel_on_gpadl_torndown(hv_vmbus_channel_msg_header* hdr) +vmbus_channel_on_gpadl_torndown(const hv_vmbus_channel_msg_header *hdr) { - hv_vmbus_channel_gpadl_torndown* gpadl_torndown; + const hv_vmbus_channel_gpadl_torndown *gpadl_torndown; hv_vmbus_channel_msg_info* msg_info; hv_vmbus_channel_msg_header* requestHeader; hv_vmbus_channel_gpadl_teardown* gpadlTeardown; - gpadl_torndown = (hv_vmbus_channel_gpadl_torndown*)hdr; + gpadl_torndown = (const hv_vmbus_channel_gpadl_torndown *)hdr; /* * Find the open msg, copy the result and signal/unblock the @@ -648,14 +655,14 @@ vmbus_channel_on_gpadl_torndown(hv_vmbus * response and signal the requesting thread. */ static void -vmbus_channel_on_version_response(hv_vmbus_channel_msg_header* hdr) +vmbus_channel_on_version_response(const hv_vmbus_channel_msg_header *hdr) { hv_vmbus_channel_msg_info* msg_info; hv_vmbus_channel_msg_header* requestHeader; hv_vmbus_channel_initiate_contact* initiate; - hv_vmbus_channel_version_response* versionResponse; + const hv_vmbus_channel_version_response *versionResponse; - versionResponse = (hv_vmbus_channel_version_response*)hdr; + versionResponse = (const hv_vmbus_channel_version_response *)hdr; mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_FOREACH(msg_info, &hv_vmbus_g_connection.channel_msg_anchor, @@ -841,14 +848,13 @@ vmbus_rel_subchan(struct hv_vmbus_channe } void -vmbus_chan_msgproc(struct vmbus_softc *sc, volatile struct vmbus_message *msg) +vmbus_chan_msgproc(struct vmbus_softc *sc, const struct vmbus_message *msg) { const hv_vmbus_channel_msg_table_entry *entry; - hv_vmbus_channel_msg_header *hdr; + const hv_vmbus_channel_msg_header *hdr; hv_vmbus_channel_msg_type msg_type; - /* XXX: update messageHandler interface */ - hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *, msg->msg_data); + hdr = (const hv_vmbus_channel_msg_header *)msg->msg_data; msg_type = hdr->message_type; if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) { Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Jun 6 07:27:57 2016 (r301487) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Jun 6 07:39:44 2016 (r301488) @@ -86,7 +86,8 @@ vmbus_msg_task(void *xsc, int pending __ break; } else if (msg->msg_type == VMBUS_MSGTYPE_CHANNEL) { /* Channel message */ - vmbus_chan_msgproc(sc, msg); + vmbus_chan_msgproc(sc, + __DEVOLATILE(const struct vmbus_message *, msg)); } msg->msg_type = VMBUS_MSGTYPE_NONE; Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Jun 6 07:27:57 2016 (r301487) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Jun 6 07:39:44 2016 (r301488) @@ -102,7 +102,6 @@ void vmbus_handle_intr(struct trapframe void vmbus_et_intr(struct trapframe *); -void vmbus_chan_msgproc(struct vmbus_softc *, - volatile struct vmbus_message *); +void vmbus_chan_msgproc(struct vmbus_softc *, const struct vmbus_message *); #endif /* !_VMBUS_VAR_H_ */ From owner-svn-src-all@freebsd.org Mon Jun 6 09:04:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2205B6DD91; Mon, 6 Jun 2016 09:04:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29B41D86; Mon, 6 Jun 2016 09:04:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5694KQ2046632; Mon, 6 Jun 2016 09:04:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5694Kmd046631; Mon, 6 Jun 2016 09:04:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060904.u5694Kmd046631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301489 - head/sys/modules/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:04:22 -0000 Author: arybchik Date: Mon Jun 6 09:04:20 2016 New Revision: 301489 URL: https://svnweb.freebsd.org/changeset/base/301489 Log: sfxge(4): prepare sfxge to be RSS API aware This change is needed because 'opt_rss.h' is included by multiple source files and RSS macro is defined as 1 within the file during build process if option RSS is enabled in the kernel. Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6718 Modified: head/sys/modules/sfxge/Makefile Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Mon Jun 6 07:39:44 2016 (r301488) +++ head/sys/modules/sfxge/Makefile Mon Jun 6 09:04:20 2016 (r301489) @@ -5,7 +5,7 @@ KMOD= sfxge SFXGE= ${.CURDIR}/../../dev/sfxge SRCS= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h opt_inet6.h opt_sched.h +SRCS+= opt_inet.h opt_inet6.h opt_sched.h opt_rss.h .PATH: ${.CURDIR}/../../dev/sfxge SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c From owner-svn-src-all@freebsd.org Mon Jun 6 09:05:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78B19B6DDFA; Mon, 6 Jun 2016 09:05:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2641F10; Mon, 6 Jun 2016 09:05:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56956W1046731; Mon, 6 Jun 2016 09:05:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56956x0046730; Mon, 6 Jun 2016 09:05:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060905.u56956x0046730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301490 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:05:07 -0000 Author: arybchik Date: Mon Jun 6 09:05:06 2016 New Revision: 301490 URL: https://svnweb.freebsd.org/changeset/base/301490 Log: sfxge(4): get RSS key to be programmed into NIC from the kernel Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6719 Modified: head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Mon Jun 6 09:04:20 2016 (r301489) +++ head/sys/dev/sfxge/sfxge_rx.c Mon Jun 6 09:05:06 2016 (r301490) @@ -34,6 +34,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -55,6 +57,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef RSS +#include +#endif + #include "common/efx.h" @@ -160,6 +166,9 @@ sfxge_rx_qflush_failed(struct sfxge_rxq rxq->flush_state = SFXGE_FLUSH_FAILED; } +#ifdef RSS +static uint8_t toep_key[RSS_KEYSIZE]; +#else static uint8_t toep_key[] = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, @@ -167,6 +176,7 @@ static uint8_t toep_key[] = { 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa }; +#endif static void sfxge_rx_post_refill(void *arg) @@ -1127,6 +1137,9 @@ sfxge_rx_start(struct sfxge_softc *sc) (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) | (1 << EFX_RX_HASH_IPV6) | (1 << EFX_RX_HASH_TCPIPV6), B_TRUE); +#ifdef RSS + rss_getkey(toep_key); +#endif if ((rc = efx_rx_scale_key_set(sc->enp, toep_key, sizeof(toep_key))) != 0) goto fail; From owner-svn-src-all@freebsd.org Mon Jun 6 09:05:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB75B6DE4B; Mon, 6 Jun 2016 09:05:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 280C810BF; Mon, 6 Jun 2016 09:05:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5695qdl046797; Mon, 6 Jun 2016 09:05:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5695qFe046796; Mon, 6 Jun 2016 09:05:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060905.u5695qFe046796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301491 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:05:53 -0000 Author: arybchik Date: Mon Jun 6 09:05:52 2016 New Revision: 301491 URL: https://svnweb.freebsd.org/changeset/base/301491 Log: sfxge(4): restrict the maximum number of RSS channels by the number of RSS buckets This is done because one has no point to have more channels since they will be unused. Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6720 Modified: head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Mon Jun 6 09:05:06 2016 (r301490) +++ head/sys/dev/sfxge/sfxge.c Mon Jun 6 09:05:52 2016 (r301491) @@ -34,6 +34,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -58,6 +60,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef RSS +#include +#endif + #include "common/efx.h" #include "sfxge.h" @@ -127,7 +133,15 @@ sfxge_estimate_rsrc_limits(struct sfxge_ * - hardwire maximum RSS channels * - administratively specified maximum RSS channels */ +#ifdef RSS + /* + * Avoid extra limitations so that the number of queues + * may be configured at administrator's will + */ + evq_max = MIN(MAX(rss_getnumbuckets(), 1), EFX_MAXRSS); +#else evq_max = MIN(mp_ncpus, EFX_MAXRSS); +#endif if (sc->max_rss_channels > 0) evq_max = MIN(evq_max, sc->max_rss_channels); @@ -163,6 +177,14 @@ sfxge_estimate_rsrc_limits(struct sfxge_ KASSERT(sc->evq_max <= evq_max, ("allocated more than maximum requested")); +#ifdef RSS + if (sc->evq_max < rss_getnumbuckets()) + device_printf(sc->dev, "The number of allocated queues (%u) " + "is less than the number of RSS buckets (%u); " + "performance degradation might be observed", + sc->evq_max, rss_getnumbuckets()); +#endif + /* * NIC is kept initialized in the case of success to be able to * initialize port to find out media types. From owner-svn-src-all@freebsd.org Mon Jun 6 09:06:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5364B6DEBC; Mon, 6 Jun 2016 09:06:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7587D1289; Mon, 6 Jun 2016 09:06:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5696caj046870; Mon, 6 Jun 2016 09:06:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5696csc046869; Mon, 6 Jun 2016 09:06:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060906.u5696csc046869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301492 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:06:39 -0000 Author: arybchik Date: Mon Jun 6 09:06:38 2016 New Revision: 301492 URL: https://svnweb.freebsd.org/changeset/base/301492 Log: sfxge(4): bind interrupts to CPUs in accordance with bucket to CPU map Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6721 Modified: head/sys/dev/sfxge/sfxge_intr.c Modified: head/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Mon Jun 6 09:05:52 2016 (r301491) +++ head/sys/dev/sfxge/sfxge_intr.c Mon Jun 6 09:06:38 2016 (r301492) @@ -34,6 +34,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -49,6 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef RSS +#include +#endif + #include "common/efx.h" #include "sfxge.h" @@ -192,7 +198,12 @@ sfxge_intr_bus_enable(struct sfxge_softc bus_describe_intr(sc->dev, table[index].eih_res, table[index].eih_tag, "%d", index); #endif +#ifdef RSS + bus_bind_intr(sc->dev, table[index].eih_res, + rss_getcpu(index)); +#else bus_bind_intr(sc->dev, table[index].eih_res, index); +#endif } From owner-svn-src-all@freebsd.org Mon Jun 6 09:07:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7452DB6DF24; Mon, 6 Jun 2016 09:07:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40CE61493; Mon, 6 Jun 2016 09:07:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5697Q9X046939; Mon, 6 Jun 2016 09:07:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5697QjB046938; Mon, 6 Jun 2016 09:07:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060907.u5697QjB046938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301493 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:07:27 -0000 Author: arybchik Date: Mon Jun 6 09:07:26 2016 New Revision: 301493 URL: https://svnweb.freebsd.org/changeset/base/301493 Log: sfxge(4): set up the indirection table using the kernel-driven RSS bucket ids Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6722 Modified: head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Mon Jun 6 09:06:38 2016 (r301492) +++ head/sys/dev/sfxge/sfxge_rx.c Mon Jun 6 09:07:26 2016 (r301493) @@ -1129,7 +1129,12 @@ sfxge_rx_start(struct sfxge_softc *sc) * Set up the scale table. Enable all hash types and hash insertion. */ for (index = 0; index < SFXGE_RX_SCALE_MAX; index++) +#ifdef RSS + sc->rx_indir_table[index] = + rss_get_indirection_to_bucket(index) % sc->rxq_count; +#else sc->rx_indir_table[index] = index % sc->rxq_count; +#endif if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, SFXGE_RX_SCALE_MAX)) != 0) goto fail; From owner-svn-src-all@freebsd.org Mon Jun 6 09:08:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7CF0B6DF96; Mon, 6 Jun 2016 09:08:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B586E1746; Mon, 6 Jun 2016 09:08:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5698GVv047013; Mon, 6 Jun 2016 09:08:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5698GMe047012; Mon, 6 Jun 2016 09:08:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060908.u5698GMe047012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301494 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:08:18 -0000 Author: arybchik Date: Mon Jun 6 09:08:16 2016 New Revision: 301494 URL: https://svnweb.freebsd.org/changeset/base/301494 Log: sfxge(4): pick an RSS bucket for the packet enqueued and select TXQ accordingly Submitted by: Ivan Malov Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6723 Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Jun 6 09:07:26 2016 (r301493) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Jun 6 09:08:16 2016 (r301494) @@ -49,6 +49,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -68,6 +70,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef RSS +#include +#endif + #include "common/efx.h" #include "sfxge.h" @@ -818,12 +824,24 @@ sfxge_if_transmit(struct ifnet *ifp, str (CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO)) { int index = 0; +#ifdef RSS + uint32_t bucket_id; + + /* + * Select a TX queue which matches the corresponding + * RX queue for the hash in order to assign both + * TX and RX parts of the flow to the same CPU + */ + if (rss_m2bucket(m, &bucket_id) == 0) + index = bucket_id % (sc->txq_count - (SFXGE_TXQ_NTYPES - 1)); +#else /* check if flowid is set */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { uint32_t hash = m->m_pkthdr.flowid; index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX]; } +#endif #if SFXGE_TX_PARSE_EARLY if (m->m_pkthdr.csum_flags & CSUM_TSO) sfxge_parse_tx_packet(m); From owner-svn-src-all@freebsd.org Mon Jun 6 09:30:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F5CB6B4FB; Mon, 6 Jun 2016 09:30:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83F791207; Mon, 6 Jun 2016 09:30:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u569UV1Z054350; Mon, 6 Jun 2016 09:30:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u569UVku054349; Mon, 6 Jun 2016 09:30:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060930.u569UVku054349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301495 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:30:32 -0000 Author: arybchik Date: Mon Jun 6 09:30:31 2016 New Revision: 301495 URL: https://svnweb.freebsd.org/changeset/base/301495 Log: sfxge(4): update TX vFIFO ULL tag location to avoid merge conflict Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Jun 6 09:08:16 2016 (r301494) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Jun 6 09:30:31 2016 (r301495) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -801,7 +801,7 @@ struct tlv_tx_event_merging_config { * know if the low latency mode is enabled. */ -#define TLV_TAG_TX_VFIFO_ULL_MODE (0x10220000) +#define TLV_TAG_TX_VFIFO_ULL_MODE (0x10270000) struct tlv_tx_vfifo_ull_mode { uint32_t tag; uint32_t length; From owner-svn-src-all@freebsd.org Mon Jun 6 09:52:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4868AB6BD41; Mon, 6 Jun 2016 09:52:00 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 100C110FF; Mon, 6 Jun 2016 09:51:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u569pxKG063398; Mon, 6 Jun 2016 09:51:59 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u569pwOI063390; Mon, 6 Jun 2016 09:51:58 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606060951.u569pwOI063390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 6 Jun 2016 09:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:52:00 -0000 Author: araujo Date: Mon Jun 6 09:51:58 2016 New Revision: 301496 URL: https://svnweb.freebsd.org/changeset/base/301496 Log: Add support to priority code point (PCP) that is an 3-bit field which refers to IEEE 802.1p class of service and maps to the frame priority level. Values in order of priority are: 1 (Background (lowest)), 0 (Best effort (default)), 2 (Excellent effort), 3 (Critical applications), 4 (Video, < 100ms latency), 5 (Video, < 10ms latency), 6 (Internetwork control) and 7 (Network control (highest)). Example of usage: root# ifconfig em0.1 create root# ifconfig em0.1 vlanpcp 3 Note: The review D801 includes the pf(4) part, but as discussed with kristof, we won't commit the pf(4) bits for now. The credits of the original code is from rwatson. Differential Revision: https://reviews.freebsd.org/D801 Reviewed by: gnn, adrian, loos Discussed with: rwatson, glebius, kristof Tested by: many including Matthew Grooms Obtained from: pfSense Relnotes: Yes Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifvlan.c head/share/man/man4/vlan.4 head/sys/net/if.h head/sys/net/if_vlan.c head/sys/net/if_vlan_var.h head/sys/sys/priv.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Mon Jun 6 09:30:31 2016 (r301495) +++ head/sbin/ifconfig/ifconfig.8 Mon Jun 6 09:51:58 2016 (r301496) @@ -2614,6 +2614,29 @@ Note that and .Cm vlandev must both be set at the same time. +.It Cm vlanpcp Ar priority_code_point +Priority code point +.Pq Dv PCP +is an 3-bit field which refers to the IEEE 802.1p +class of service and maps to the frame priority level. +.Pp +Values in order of priority are: +.Cm 1 +.Pq Dv Background (lowest) , +.Cm 0 +.Pq Dv Best effort (default) , +.Cm 2 +.Pq Dv Excellent effort , +.Cm 3 +.Pq Dv Critical applications , +.Cm 4 +.Pq Dv Video, < 100ms latency , +.Cm 5 +.Pq Dv Video, < 10ms latency , +.Cm 6 +.Pq Dv Internetwork control , +.Cm 7 +.Pq Dv Network control (highest) . .It Cm vlandev Ar iface Associate the physical interface .Ar iface Modified: head/sbin/ifconfig/ifvlan.c ============================================================================== --- head/sbin/ifconfig/ifvlan.c Mon Jun 6 09:30:31 2016 (r301495) +++ head/sbin/ifconfig/ifvlan.c Mon Jun 6 09:51:58 2016 (r301496) @@ -1,6 +1,10 @@ /* - * Copyright (c) 1999 - * Bill Paul . All rights reserved. + * Copyright (c) 1999 Bill Paul + * Copyright (c) 2012 ADARA Networks, Inc. + * All rights reserved. + * + * Portions of this software were developed by Robert N. M. Watson under + * contract to ADARA Networks, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,10 +82,14 @@ vlan_status(int s) { struct vlanreq vreq; - if (getvlan(s, &ifr, &vreq) != -1) - printf("\tvlan: %d parent interface: %s\n", - vreq.vlr_tag, vreq.vlr_parent[0] == '\0' ? - "" : vreq.vlr_parent); + if (getvlan(s, &ifr, &vreq) == -1) + return; + printf("\tvlan: %d", vreq.vlr_tag); + if (ioctl(s, SIOCGVLANPCP, (caddr_t)&ifr) != -1) + printf(" vlanpcp: %u", ifr.ifr_vlan_pcp); + printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ? + "" : vreq.vlr_parent); + printf("\n"); } static void @@ -149,6 +157,22 @@ DECL_CMD_FUNC(setvlandev, val, d) } static +DECL_CMD_FUNC(setvlanpcp, val, d) +{ + u_long ul; + char *endp; + + ul = strtoul(val, &endp, 0); + if (*endp != '\0') + errx(1, "invalid value for vlanpcp"); + if (ul > 7) + errx(1, "value for vlanpcp out of range"); + ifr.ifr_vlan_pcp = ul; + if (ioctl(s, SIOCSVLANPCP, (caddr_t)&ifr) == -1) + err(1, "SIOCSVLANPCP"); +} + +static DECL_CMD_FUNC(unsetvlandev, val, d) { struct vlanreq vreq; @@ -169,6 +193,7 @@ DECL_CMD_FUNC(unsetvlandev, val, d) static struct cmd vlan_cmds[] = { DEF_CLONE_CMD_ARG("vlan", setvlantag), DEF_CLONE_CMD_ARG("vlandev", setvlandev), + DEF_CMD_ARG("vlanpcp", setvlanpcp), /* NB: non-clone cmds */ DEF_CMD_ARG("vlan", setvlantag), DEF_CMD_ARG("vlandev", setvlandev), Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Mon Jun 6 09:30:31 2016 (r301495) +++ head/share/man/man4/vlan.4 Mon Jun 6 09:51:58 2016 (r301496) @@ -203,5 +203,3 @@ can be corrected manually if used in con .Sh SEE ALSO .Xr ifconfig 8 , .Xr sysctl 8 -.Sh BUGS -No 802.1Q features except VLAN tagging are implemented. Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Mon Jun 6 09:30:31 2016 (r301495) +++ head/sys/net/if.h Mon Jun 6 09:51:58 2016 (r301496) @@ -393,6 +393,7 @@ struct ifreq { caddr_t ifru_data; int ifru_cap[2]; u_int ifru_fib; + u_char ifru_vlan_pcp; } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ @@ -410,6 +411,7 @@ struct ifreq { #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ #define ifr_index ifr_ifru.ifru_index /* interface index */ #define ifr_fib ifr_ifru.ifru_fib /* interface fib */ +#define ifr_vlan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Jun 6 09:30:31 2016 (r301495) +++ head/sys/net/if_vlan.c Mon Jun 6 09:51:58 2016 (r301496) @@ -1,5 +1,9 @@ /*- * Copyright 1998 Massachusetts Institute of Technology + * Copyright 2012 ADARA Networks, Inc. + * + * Portions of this software were developed by Robert N. M. Watson under + * contract to ADARA Networks, Inc. * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -29,8 +33,7 @@ /* * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. - * Might be extended some day to also handle IEEE 802.1p priority - * tagging. This is sort of sneaky in the implementation, since + * This is sort of sneaky in the implementation, since * we need to pretend to be enough of an Ethernet implementation * to make arp work. The way we do this is by telling everyone * that we are an Ethernet, and then catch the packets that @@ -52,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,6 +118,8 @@ struct ifvlan { int ifvm_mintu; /* min transmission unit */ uint16_t ifvm_proto; /* encapsulation ethertype */ uint16_t ifvm_tag; /* tag to apply on packets leaving if */ + uint16_t ifvm_vid; /* VLAN ID */ + uint8_t ifvm_pcp; /* Priority Code Point (PCP). */ } ifv_mib; SLIST_HEAD(, vlan_mc_entry) vlan_mc_listhead; #ifndef VLAN_ARRAY @@ -121,7 +127,9 @@ struct ifvlan { #endif }; #define ifv_proto ifv_mib.ifvm_proto -#define ifv_vid ifv_mib.ifvm_tag +#define ifv_tag ifv_mib.ifvm_tag +#define ifv_vid ifv_mib.ifvm_vid +#define ifv_pcp ifv_mib.ifvm_pcp #define ifv_encaplen ifv_mib.ifvm_encaplen #define ifv_mtufudge ifv_mib.ifvm_mtufudge #define ifv_mintu ifv_mib.ifvm_mintu @@ -147,6 +155,15 @@ static VNET_DEFINE(int, soft_pad); SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(soft_pad), 0, "pad short frames before tagging"); +/* + * For now, make preserving PCP via an mbuf tag optional, as it increases + * per-packet memory allocations and frees. In the future, it would be + * preferable to reuse ether_vtag for this, or similar. + */ +static int vlan_mtag_pcp = 0; +SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW, &vlan_mtag_pcp, 0, + "Retain VLAN PCP information as packets are passed up the stack"); + static const char vlanname[] = "vlan"; static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface"); @@ -697,6 +714,16 @@ vlan_devat(struct ifnet *ifp, uint16_t v } /* + * Recalculate the cached VLAN tag exposed via the MIB. + */ +static void +vlan_tag_recalculate(struct ifvlan *ifv) +{ + + ifv->ifv_tag = EVL_MAKETAG(ifv->ifv_vid, ifv->ifv_pcp, 0); +} + +/* * VLAN support can be loaded as a module. The only place in the * system that's intimately aware of this is ether_input. We hook * into this code through vlan_input_p which is defined there and @@ -1009,6 +1036,8 @@ vlan_transmit(struct ifnet *ifp, struct { struct ifvlan *ifv; struct ifnet *p; + struct m_tag *mtag; + uint16_t tag; int error, len, mcast; ifv = ifp->if_softc; @@ -1064,11 +1093,16 @@ vlan_transmit(struct ifnet *ifp, struct * knows how to find the VLAN tag to use, so we attach a * packet tag that holds it. */ + if (vlan_mtag_pcp && (mtag = m_tag_locate(m, MTAG_8021Q, + MTAG_8021Q_PCP_OUT, NULL)) != NULL) + tag = EVL_MAKETAG(ifv->ifv_vid, *(uint8_t *)(mtag + 1), 0); + else + tag = ifv->ifv_tag; if (p->if_capenable & IFCAP_VLAN_HWTAGGING) { - m->m_pkthdr.ether_vtag = ifv->ifv_vid; + m->m_pkthdr.ether_vtag = tag; m->m_flags |= M_VLANTAG; } else { - m = ether_vlanencap(m, ifv->ifv_vid); + m = ether_vlanencap(m, tag); if (m == NULL) { if_printf(ifp, "unable to prepend VLAN header\n"); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); @@ -1103,7 +1137,8 @@ vlan_input(struct ifnet *ifp, struct mbu struct ifvlantrunk *trunk = ifp->if_vlantrunk; struct ifvlan *ifv; TRUNK_LOCK_READER; - uint16_t vid; + struct m_tag *mtag; + uint16_t vid, tag; KASSERT(trunk != NULL, ("%s: no trunk", __func__)); @@ -1112,7 +1147,7 @@ vlan_input(struct ifnet *ifp, struct mbu * Packet is tagged, but m contains a normal * Ethernet frame; the tag is stored out-of-band. */ - vid = EVL_VLANOFTAG(m->m_pkthdr.ether_vtag); + tag = m->m_pkthdr.ether_vtag; m->m_flags &= ~M_VLANTAG; } else { struct ether_vlan_header *evl; @@ -1128,7 +1163,7 @@ vlan_input(struct ifnet *ifp, struct mbu return; } evl = mtod(m, struct ether_vlan_header *); - vid = EVL_VLANOFTAG(ntohs(evl->evl_tag)); + tag = ntohs(evl->evl_tag); /* * Remove the 802.1q header by copying the Ethernet @@ -1152,6 +1187,8 @@ vlan_input(struct ifnet *ifp, struct mbu } } + vid = EVL_VLANOFTAG(tag); + TRUNK_RLOCK(trunk); ifv = vlan_gethash(trunk, vid); if (ifv == NULL || !UP_AND_RUNNING(ifv->ifv_ifp)) { @@ -1162,6 +1199,28 @@ vlan_input(struct ifnet *ifp, struct mbu } TRUNK_RUNLOCK(trunk); + if (vlan_mtag_pcp) { + /* + * While uncommon, it is possible that we will find a 802.1q + * packet encapsulated inside another packet that also had an + * 802.1q header. For example, ethernet tunneled over IPSEC + * arriving over ethernet. In that case, we replace the + * existing 802.1q PCP m_tag value. + */ + mtag = m_tag_locate(m, MTAG_8021Q, MTAG_8021Q_PCP_IN, NULL); + if (mtag == NULL) { + mtag = m_tag_alloc(MTAG_8021Q, MTAG_8021Q_PCP_IN, + sizeof(uint8_t), M_NOWAIT); + if (mtag == NULL) { + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + return; + } + m_tag_prepend(m, mtag); + } + *(uint8_t *)(mtag + 1) = EVL_PRIOFTAG(tag); + } + m->m_pkthdr.rcvif = ifv->ifv_ifp; if_inc_counter(ifv->ifv_ifp, IFCOUNTER_IPACKETS, 1); @@ -1201,7 +1260,7 @@ vlan_config(struct ifvlan *ifv, struct i vlan_inithash(trunk); VLAN_LOCK(); if (p->if_vlantrunk != NULL) { - /* A race that that is very unlikely to be hit. */ + /* A race that is very unlikely to be hit. */ vlan_freehash(trunk); free(trunk, M_VLAN); goto exists; @@ -1218,6 +1277,8 @@ exists: } ifv->ifv_vid = vid; /* must set this before vlan_inshash() */ + ifv->ifv_pcp = 0; /* Default: best effort delivery. */ + vlan_tag_recalculate(ifv); error = vlan_inshash(trunk, ifv); if (error) goto done; @@ -1705,6 +1766,34 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd } break; + case SIOCGVLANPCP: +#ifdef VIMAGE + if (ifp->if_vnet != ifp->if_home_vnet) { + error = EPERM; + break; + } +#endif + ifr->ifr_vlan_pcp = ifv->ifv_pcp; + break; + + case SIOCSVLANPCP: +#ifdef VIMAGE + if (ifp->if_vnet != ifp->if_home_vnet) { + error = EPERM; + break; + } +#endif + error = priv_check(curthread, PRIV_NET_SETVLANPCP); + if (error) + break; + if (ifr->ifr_vlan_pcp > 7) { + error = EINVAL; + break; + } + ifv->ifv_pcp = ifr->ifr_vlan_pcp; + vlan_tag_recalculate(ifv); + break; + default: error = EINVAL; break; Modified: head/sys/net/if_vlan_var.h ============================================================================== --- head/sys/net/if_vlan_var.h Mon Jun 6 09:30:31 2016 (r301495) +++ head/sys/net/if_vlan_var.h Mon Jun 6 09:51:58 2016 (r301496) @@ -73,6 +73,23 @@ struct vlanreq { #define SIOCSETVLAN SIOCSIFGENERIC #define SIOCGETVLAN SIOCGIFGENERIC +#define SIOCGVLANPCP _IOWR('i', 152, struct ifreq) /* Get VLAN PCP */ +#define SIOCSVLANPCP _IOW('i', 153, struct ifreq) /* Set VLAN PCP */ + +/* + * Names for 802.1q priorities ("802.1p"). Notice that in this scheme, + * (0 < 1), allowing default 0-tagged traffic to take priority over background + * tagged traffic. + */ +#define IEEE8021Q_PCP_BK 1 /* Background (lowest) */ +#define IEEE8021Q_PCP_BE 0 /* Best effort (default) */ +#define IEEE8021Q_PCP_EE 2 /* Excellent effort */ +#define IEEE8021Q_PCP_CA 3 /* Critical applications */ +#define IEEE8021Q_PCP_VI 4 /* Video, < 100ms latency */ +#define IEEE8021Q_PCP_VO 5 /* Video, < 10ms latency */ +#define IEEE8021Q_PCP_IC 6 /* Internetwork control */ +#define IEEE8021Q_PCP_NC 7 /* Network control (highest) */ + #ifdef _KERNEL /* * Drivers that are capable of adding and removing the VLAN header @@ -110,6 +127,16 @@ struct vlanreq { * if_capabilities. */ +/* + * The 802.1q code may also tag mbufs with the PCP (priority) field for use in + * other layers of the stack, in which case an m_tag will be used. This is + * semantically quite different from use of the ether_vtag field, which is + * defined only between the device driver and VLAN layer. + */ +#define MTAG_8021Q 1326104895 +#define MTAG_8021Q_PCP_IN 0 /* Input priority. */ +#define MTAG_8021Q_PCP_OUT 1 /* Output priority. */ + #define VLAN_CAPABILITIES(_ifp) do { \ if ((_ifp)->if_vlantrunk != NULL) \ (*vlan_trunk_cap_p)(_ifp); \ Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Mon Jun 6 09:30:31 2016 (r301495) +++ head/sys/sys/priv.h Mon Jun 6 09:51:58 2016 (r301496) @@ -342,6 +342,7 @@ #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ #define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ #define PRIV_NET_VXLAN 420 /* Administer vxlan. */ +#define PRIV_NET_SETVLANPCP 421 /* Set VLAN priority. */ /* * 802.11-related privileges. From owner-svn-src-all@freebsd.org Mon Jun 6 10:07:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B98D6B46260; Mon, 6 Jun 2016 10:07:58 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86D581A4D; Mon, 6 Jun 2016 10:07:58 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56A7vi2069143; Mon, 6 Jun 2016 10:07:57 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56A7vSC069142; Mon, 6 Jun 2016 10:07:57 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201606061007.u56A7vSC069142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 6 Jun 2016 10:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301497 - head/sys/dev/etherswitch/mtkswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 10:07:58 -0000 Author: sgalabov Date: Mon Jun 6 10:07:57 2016 New Revision: 301497 URL: https://svnweb.freebsd.org/changeset/base/301497 Log: Remove erroneous lock assertions In mediatek etherswitch support, functions mtkswitch_reg_write32_mt7621 and mtkswitch_reg_read32_mt7621 are called without locks held, so lock assertions fail. Remove the lock assertions. Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c Modified: head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c ============================================================================== --- head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c Mon Jun 6 09:51:58 2016 (r301496) +++ head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c Mon Jun 6 10:07:57 2016 (r301497) @@ -135,7 +135,6 @@ mtkswitch_reg_read32_mt7621(struct mtksw { uint32_t low, hi; - MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY, MTKSWITCH_GLOBAL_REG, MTKSWITCH_REG_ADDR(reg)); low = mtkswitch_phy_read_locked(sc, MTKSWITCH_GLOBAL_PHY, @@ -149,7 +148,6 @@ static uint32_t mtkswitch_reg_write32_mt7621(struct mtkswitch_softc *sc, int reg, uint32_t val) { - MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED); mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY, MTKSWITCH_GLOBAL_REG, MTKSWITCH_REG_ADDR(reg)); mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY, From owner-svn-src-all@freebsd.org Mon Jun 6 10:13:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA1E3B465B6; Mon, 6 Jun 2016 10:13:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB24F1F71; Mon, 6 Jun 2016 10:13:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56ADmYg072801; Mon, 6 Jun 2016 10:13:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56ADm9q072800; Mon, 6 Jun 2016 10:13:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606061013.u56ADm9q072800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 10:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301498 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 10:13:50 -0000 Author: bz Date: Mon Jun 6 10:13:48 2016 New Revision: 301498 URL: https://svnweb.freebsd.org/changeset/base/301498 Log: Make the KASSERT message more helpful by also printing the ifp information which we are asserting. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Jun 6 10:07:57 2016 (r301497) +++ head/sys/net/if_ethersubr.c Mon Jun 6 10:13:48 2016 (r301498) @@ -753,7 +753,8 @@ ether_input(struct ifnet *ifp, struct mb * We will rely on rcvif being set properly in the deferred context, * so assert it is correct here. */ - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch m %p " + "rcvif %p ifp %p", __func__, m, m->m_pkthdr.rcvif, ifp)); CURVNET_SET_QUIET(ifp->if_vnet); netisr_dispatch(NETISR_ETHER, m); CURVNET_RESTORE(); From owner-svn-src-all@freebsd.org Mon Jun 6 11:08:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E0AB6D23B; Mon, 6 Jun 2016 11:08:06 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72C1319AC; Mon, 6 Jun 2016 11:08:06 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56B85QS091223; Mon, 6 Jun 2016 11:08:05 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56B85VY091221; Mon, 6 Jun 2016 11:08:05 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201606061108.u56B85VY091221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Mon, 6 Jun 2016 11:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301500 - in stable/10: lib/libfetch usr.bin/fetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 11:08:06 -0000 Author: grembo (ports committer) Date: Mon Jun 6 11:08:05 2016 New Revision: 301500 URL: https://svnweb.freebsd.org/changeset/base/301500 Log: MFC r297052: Update fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles Modified: stable/10/lib/libfetch/fetch.3 stable/10/usr.bin/fetch/fetch.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/fetch.3 ============================================================================== --- stable/10/lib/libfetch/fetch.3 Mon Jun 6 10:21:53 2016 (r301499) +++ stable/10/lib/libfetch/fetch.3 Mon Jun 6 11:08:05 2016 (r301500) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 1998-2013 Dag-Erling Smørgrav -.\" Copyright (c) 2013 Michael Gmelin +.\" Copyright (c) 2013-2016 Michael Gmelin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2015 +.Dd March 18, 2016 .Dt FETCH 3 .Os .Sh NAME @@ -396,8 +396,15 @@ is currently unimplemented. .Sh HTTPS SCHEME Based on HTTP SCHEME. By default the peer is verified using the CA bundle located in -.Pa /etc/ssl/cert.pem . -The file may contain multiple CA certificates. +.Pa /usr/local/etc/ssl/cert.pem . +If this file does not exist, +.Pa /etc/ssl/cert.pem +is used instead. +If neither file exists, and +.Ev SSL_CA_CERT_PATH +has not been set, +OpenSSL's default CA cert and path settings apply. +The certificate bundle can contain multiple CA certificates. A common source of a current CA bundle is .Pa \%security/ca_root_nss . .Pp @@ -428,10 +435,11 @@ Client certificate based authentication The environment variable .Ev SSL_CLIENT_CERT_FILE should be set to point to a file containing key and client certificate -to be used in PEM format. In case the key is stored in a separate -file, the environment variable +to be used in PEM format. +When a PEM-format key is in a separate file from the client certificate, +the environment variable .Ev SSL_CLIENT_KEY_FILE -can be set to point to the key in PEM format. +can be set to point to the key file. In case the key uses a password, the user will be prompted on standard input (see .Xr PEM 3 ) . @@ -531,7 +539,7 @@ Invalid URL .El .Pp The accompanying error message includes a protocol-specific error code -and message, e.g.\& "File is not available (404 Not Found)" +and message, like "File is not available (404 Not Found)" .Sh ENVIRONMENT .Bl -tag -width ".Ev FETCH_BIND_ADDRESS" .It Ev FETCH_BIND_ADDRESS @@ -648,8 +656,7 @@ for compatibility. Allow SSL version 3 when negotiating the connection (not recommended). .It Ev SSL_CA_CERT_FILE CA certificate bundle containing trusted CA certificates. -Default value: -.Pa /etc/ssl/cert.pem . +Default value: See HTTPS SCHEME above. .It Ev SSL_CA_CERT_PATH Path containing trusted CA hashes. .It Ev SSL_CLIENT_CERT_FILE Modified: stable/10/usr.bin/fetch/fetch.1 ============================================================================== --- stable/10/usr.bin/fetch/fetch.1 Mon Jun 6 10:21:53 2016 (r301499) +++ stable/10/usr.bin/fetch/fetch.1 Mon Jun 6 11:08:05 2016 (r301500) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2000-2014 Dag-Erling Smørgrav -.\" Copyright (c) 2013 Michael Gmelin +.\" Copyright (c) 2013-2016 Michael Gmelin .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2015 +.Dd March 18, 2016 .Dt FETCH 1 .Os .Sh NAME @@ -134,11 +134,17 @@ only. [SSL] Path to certificate bundle containing trusted CA certificates. If not specified, -.Pa /etc/ssl/cert.pem +.Pa /usr/local/etc/ssl/cert.pem is used. -The file may contain multiple CA certificates. The port +If this file does not exist, +.Pa /etc/ssl/cert.pem +is used instead. +If neither file exists and no CA path has been configured, +OpenSSL's default CA cert and path settings apply. +The certificate bundle can contain multiple CA certificates. +The .Pa security/ca_root_nss -is a common source of a current CA bundle. +port is a common source of a current CA bundle. .It Fl -ca-path= Ns Ar dir [SSL] The directory @@ -218,10 +224,16 @@ altogether, or a comma- or whitespace-se which proxies should not be used. .It Fl -no-sslv3 [SSL] -Don't allow SSL version 3 when negotiating the connection. +Do not allow SSL version 3 when negotiating the connection. +This option is deprecated and is provided for backward compatibility +only. +SSLv3 is disabled by default. +Set +.Ev SSL_ALLOW_SSL3 +to change this behavior. .It Fl -no-tlsv1 [SSL] -Don't allow TLS version 1 when negotiating the connection. +Do not allow TLS version 1 when negotiating the connection. .It Fl -no-verify-hostname [SSL] Do not verify that the hostname matches the subject of the @@ -351,8 +363,10 @@ for a description of additional environm .Ev SSL_CLIENT_CERT_FILE , .Ev SSL_CLIENT_KEY_FILE , .Ev SSL_CRL_FILE , -.Ev SSL_NO_SSL3 , +.Ev SSL_ALLOW_SSL3 , .Ev SSL_NO_TLS1 , +.Ev SSL_NO_TLS1_1 , +.Ev SSL_NO_TLS1_2 , .Ev SSL_NO_VERIFY_HOSTNAME and .Ev SSL_NO_VERIFY_PEER . From owner-svn-src-all@freebsd.org Mon Jun 6 11:10:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207F6B6D2AF; Mon, 6 Jun 2016 11:10:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC8ED1B6F; Mon, 6 Jun 2016 11:10:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56BAcGt092482; Mon, 6 Jun 2016 11:10:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56BAcMq092460; Mon, 6 Jun 2016 11:10:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606061110.u56BAcMq092460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 6 Jun 2016 11:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301501 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 11:10:39 -0000 Author: gjb Date: Mon Jun 6 11:10:37 2016 New Revision: 301501 URL: https://svnweb.freebsd.org/changeset/base/301501 Log: Fix missing svn:mergeinfo from r301101. Sponsored by: The FreeBSD Foundation Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Mon Jun 6 12:03:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9383CB6D5C6; Mon, 6 Jun 2016 12:03:13 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AF341C53; Mon, 6 Jun 2016 12:03:13 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6AC5B20FD1; Mon, 6 Jun 2016 08:03:06 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Mon, 06 Jun 2016 08:03:06 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ClFGUREc9xHMSQb52FZSBcfN3GE=; b=LXdhQB QMFm5EQ6qKOvBORohIGGoYgpHsYhTMomY7SRiL/DZoXTiWWdKdieMv4AyWd7c80h vLnoOg3iTy3BNQb5aHE5G+8SDq7S0umqZCF4hgWCEXXkxHylvuGy7BhFcbAV5fVO gsuzPFYuM5SJ1ZaigIdI/uJQGU9L6yId4Xz5s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ClFGUREc9xHMSQb 52FZSBcfN3GE=; b=aTeXoXcuJBzZaA7fNmJv2p8S4L3i92ZL02d3tsgzpnEXENt rGmFUTI+DuyZqPd9WW2M5eaVCU4xMgKx9L960WIDdrnoEttnykF+iGi6ae2lEzqt gi7lNgLv2kaQlATB8wwnCpIY2s2lvfJU/U15eCF/OMhqTkch8rihhCQlcMPk= X-Sasl-enc: 0+tJvLrdYfeaeWq5DwkaS9dkzYv74Zb/URmuYcXgKu+m 1465214585 Received: from pion.local (unknown [5.148.105.34]) by mail.messagingengine.com (Postfix) with ESMTPA id 1B128CCD2E; Mon, 6 Jun 2016 08:03:05 -0400 (EDT) Subject: Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606060951.u569pwOI063390@repo.freebsd.org> From: Bruce Simpson Message-ID: <57556678.1040307@fastmail.net> Date: Mon, 6 Jun 2016 13:03:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <201606060951.u569pwOI063390@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 12:03:13 -0000 It's good to see this patch being aired out and going into mainline finally. However, what about IP DS mapping and/or application layer mapping? We may not need full-on MPLS style classification, unless we plan to take that code later on. (I'm looking at you, NetBSD.) From owner-svn-src-all@freebsd.org Mon Jun 6 12:48:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29704B6A470; Mon, 6 Jun 2016 12:48:35 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC8A619B6; Mon, 6 Jun 2016 12:48:34 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22b.google.com with SMTP id x189so138692288ywe.3; Mon, 06 Jun 2016 05:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Ks7Gm/8MVsvGtRWDRMEiQSdeRZ8h8CeyXTZ7uBZtfPI=; b=lqXQUbp/V/SOh16GccPFIQi3LalVpIlpJXtOyE3j1hsPqe78+2KRbwHU5jqC0xgoph HnkjK3Jg07xgClURXqdrtLUHxf5/epmWOTZ1ZnwSFojUwTNK0xBbEpGD0deMYkqJNwmy UwN9378uMghIy4oYtRrNaraXByVbVes/+2E44naVpIRAQCfU55BqdB6Ba2bDQZ8KyXLI alwRXDolpmZAKMaIKi5T1HyeF9cci5IFImk7XvEjpmg5CzdPlkXPlg3OULLfQfos2Ki7 oeQ2eMmwnbu0avEBrn6JAoUB7jTFP/GKU/qekVo+r2lSZCf+5xcG/6+YT8+DtJLxguvp J7Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Ks7Gm/8MVsvGtRWDRMEiQSdeRZ8h8CeyXTZ7uBZtfPI=; b=ITnkzPAFwts6xejNeknTa5ev3FrGLs8jMDZJGCsTMDaPETYOR2RzokkHuMgi5c8rGE ed6pz7J8Vp+9htADRG8En5S1ct7hFVKDdnmX0uKb7jvxU0YNC8rihAN4ikfPcB0SoX8W e365Ic1tD3pRXz7QRwmfVJb3yT1jAWaewtfELjjngqUy5WpdXecj4oF80h8/Nao+virC 93jcdR1FH/wsBrEcIXAdsRpCZi91A0cyUYmW/vd7C+MmK4hLfVuAVOLur42GfN9GaUKN Fd6gHvrOO9a1E78WrwJ7BiskWnDEoxMvxQi84kyLFNFhQQ06wxlxOs1ANR25eo3JQYv0 BtXw== X-Gm-Message-State: ALyK8tKo6DL97HptjKltbLP0nPmRh74+Qp4BS0Nv5OJajRXZvuV9lSW+a1VawkxgtoyCC4sjMhzFJGNSOrG3Zg== X-Received: by 10.37.200.67 with SMTP id y64mr11013234ybf.116.1465217314129; Mon, 06 Jun 2016 05:48:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.10.212 with HTTP; Mon, 6 Jun 2016 05:48:33 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <57556678.1040307@fastmail.net> References: <201606060951.u569pwOI063390@repo.freebsd.org> <57556678.1040307@fastmail.net> From: Marcelo Araujo Date: Mon, 6 Jun 2016 20:48:33 +0800 Message-ID: Subject: Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys To: Bruce Simpson Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 12:48:35 -0000 Hi Bruce, Thanks for the email. We have on ipfw(8) support for DSCP[1], I'm not sure if this is the same/similar case you mentioned for IP DS(DiffServices?). About the MPLS, the main problem for me is: I have no "network link" with MPLS that I could even make a test, back in 2008 I was looking for options that I could reuse on FreeBSD to have a MPLS router support, nowadays I'm not that keen on MPLS anymore. 2016-06-06 20:03 GMT+08:00 Bruce Simpson : > It's good to see this patch being aired out and going into mainline > finally. However, what about IP DS mapping and/or application layer > mapping? We may not need full-on MPLS style classification, unless we plan > to take that code later on. (I'm looking at you, NetBSD.) > [1] http://svnweb.freebsd.org/base?view=revision&revision=248552 Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Mon Jun 6 12:49:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E6C7B6A4E3; Mon, 6 Jun 2016 12:49:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D02331B40; Mon, 6 Jun 2016 12:49:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56Cnl4F029559; Mon, 6 Jun 2016 12:49:47 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56CnlW1029557; Mon, 6 Jun 2016 12:49:47 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606061249.u56CnlW1029557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 12:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301502 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 12:49:49 -0000 Author: bz Date: Mon Jun 6 12:49:47 2016 New Revision: 301502 URL: https://svnweb.freebsd.org/changeset/base/301502 Log: Provide a public interface to rt_flushifroutes which takes the address family as an argument as well. This will be used to cleanup individual protocols during VNET teardown. Obtained from: projects/vnet Sponsored by: The FreeBSD Foundation Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jun 6 11:10:37 2016 (r301501) +++ head/sys/net/route.c Mon Jun 6 12:49:47 2016 (r301502) @@ -1141,6 +1141,15 @@ rt_ifdelroute(const struct rtentry *rt, * to this interface...oh well... */ void +rt_flushifroutes_af(struct ifnet *ifp, int af) +{ + KASSERT((af >= 1 && af <= AF_MAX), ("%s: af %d not >= 1 and <= %d", + __func__, af, AF_MAX)); + + rt_foreach_fib_walk_del(af, rt_ifdelroute, ifp); +} + +void rt_flushifroutes(struct ifnet *ifp) { Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jun 6 11:10:37 2016 (r301501) +++ head/sys/net/route.h Mon Jun 6 12:49:47 2016 (r301502) @@ -468,6 +468,7 @@ typedef int rt_walktree_f_t(struct rtent typedef void rt_setwarg_t(struct rib_head *, uint32_t, int, void *); void rt_foreach_fib_walk(int af, rt_setwarg_t *, rt_walktree_f_t *, void *); void rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg); +void rt_flushifroutes_af(struct ifnet *, int); void rt_flushifroutes(struct ifnet *ifp); /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ From owner-svn-src-all@freebsd.org Mon Jun 6 12:52:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 178FFB6A6D3; Mon, 6 Jun 2016 12:52:38 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1C201F0B; Mon, 6 Jun 2016 12:52:37 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A2FB62107B; Mon, 6 Jun 2016 08:52:36 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 06 Jun 2016 08:52:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=okrUy3aWdwThE4Px2ELOPZyMy1M=; b=Kr6TD6 YfXLqPauxSXD+qZ3tFUE973PeAe7xyjAv6HyUCT9xBmwPjlciiuTESt3la78z4cV LYpqlDz3cRbuhlXmLQ0364+oqQPuWuRW3nEKyEcZm8h1T260SXzTNjTcrJEuHg63 XdHqjmKHUSgHShnKiX+hF03LiQiN8m+Iwp6Fw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=okrUy3aWdwThE4P x2ELOPZyMy1M=; b=p0qNZYDIxfnBve6R2vqUvuHEfvkESFVLG1acer6OvHhRbpW s8LFauW0a/Ov8Rv9jNgqMdskspZNbDURRpQOPjIiRtWB+TWkk+yKEpmgusm/5MWt EHnrQ1vkKmuIbsyMnoSBQDdZI7PGoe8UdSmeVESKypjMkOpDQOygqDX/4EEo= X-Sasl-enc: WKsz0ygwqa1diJF+w6/6emwWqeDe+AFl43StLb56x70F 1465217556 Received: from pion.local (unknown [5.148.105.34]) by mail.messagingengine.com (Postfix) with ESMTPA id F25BCCC01D; Mon, 6 Jun 2016 08:52:35 -0400 (EDT) Subject: Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys To: araujo@freebsd.org References: <201606060951.u569pwOI063390@repo.freebsd.org> <57556678.1040307@fastmail.net> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: <57557213.6060209@fastmail.net> Date: Mon, 6 Jun 2016 13:52:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 12:52:38 -0000 On 06/06/16 13:48, Marcelo Araujo wrote: > We have on ipfw(8) support for DSCP[1], I'm not sure if this is the > same/similar case you mentioned for IP DS(DiffServices?). Background: I introduced the code to process VLAN 0 tags inline as normal traffic several years ago for 802.1p. I'm referring to a mapping between IP DS bits and priority bits in the 802.1p header. We have that for 802.11 to some extent already, IIRC. Data point: OS X allows applications to request LEDBAT style congestion control (i.e. BitTorrent-style background traffic) for arbitrary TCP sockets through the priority/DS API there. > About the MPLS, the main problem for me is: I have no "network link" > with MPLS that I could even make a test, back in 2008 I was looking for > options that I could reuse on FreeBSD to have a MPLS router support, > nowadays I'm not that keen on MPLS anymore. Yes, it has downsides but there are still potential use cases for it. From owner-svn-src-all@freebsd.org Mon Jun 6 13:01:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48ED8B6A9DC; Mon, 6 Jun 2016 13:01:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1678F16A3; Mon, 6 Jun 2016 13:01:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56D1vQc036882; Mon, 6 Jun 2016 13:01:57 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56D1vpu036881; Mon, 6 Jun 2016 13:01:57 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606061301.u56D1vpu036881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 13:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301503 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 13:01:58 -0000 Author: bz Date: Mon Jun 6 13:01:57 2016 New Revision: 301503 URL: https://svnweb.freebsd.org/changeset/base/301503 Log: SYSINIT functions do not return a value; switch to void, remove the return value, and mark the unused argument __unused. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/net/pfil.c Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Mon Jun 6 12:49:47 2016 (r301502) +++ head/sys/net/pfil.c Mon Jun 6 13:01:57 2016 (r301503) @@ -363,26 +363,24 @@ pfil_chain_remove(pfil_chain_t *chain, p * Stuff that must be initialized for every instance (including the first of * course). */ -static int -vnet_pfil_init(const void *unused) +static void +vnet_pfil_init(const void *unused __unused) { LIST_INIT(&V_pfil_head_list); PFIL_LOCK_INIT_REAL(&V_pfil_lock, "shared"); - return (0); } /* * Called for the removal of each instance. */ -static int -vnet_pfil_uninit(const void *unused) +static void +vnet_pfil_uninit(const void *unused __unused) { KASSERT(LIST_EMPTY(&V_pfil_head_list), ("%s: pfil_head_list %p not empty", __func__, &V_pfil_head_list)); PFIL_LOCK_DESTROY_REAL(&V_pfil_lock); - return (0); } /* Define startup order. */ From owner-svn-src-all@freebsd.org Mon Jun 6 13:04:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 777D4B6AAF5; Mon, 6 Jun 2016 13:04:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49EC819CE; Mon, 6 Jun 2016 13:04:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56D4MSO037000; Mon, 6 Jun 2016 13:04:22 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56D4M8b036999; Mon, 6 Jun 2016 13:04:22 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606061304.u56D4M8b036999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 13:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301504 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 13:04:23 -0000 Author: bz Date: Mon Jun 6 13:04:22 2016 New Revision: 301504 URL: https://svnweb.freebsd.org/changeset/base/301504 Log: Destroy the mutex last. In this case it should not matter, but generally cleanup code might still acquire it thus try to be consistent destroying locks late. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/ip_id.c Modified: head/sys/netinet/ip_id.c ============================================================================== --- head/sys/netinet/ip_id.c Mon Jun 6 13:01:57 2016 (r301503) +++ head/sys/netinet/ip_id.c Mon Jun 6 13:04:22 2016 (r301504) @@ -287,11 +287,11 @@ static void ipid_sysuninit(void) { - mtx_destroy(&V_ip_id_mtx); if (V_id_array != NULL) { free(V_id_array, M_IPID); free(V_id_bits, M_IPID); } counter_u64_free(V_ip_id); + mtx_destroy(&V_ip_id_mtx); } VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysuninit, NULL); From owner-svn-src-all@freebsd.org Mon Jun 6 13:17:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42ED6B6AEB0; Mon, 6 Jun 2016 13:17:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FA41F69; Mon, 6 Jun 2016 13:17:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56DHPDe040682; Mon, 6 Jun 2016 13:17:25 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56DHPXd040681; Mon, 6 Jun 2016 13:17:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606061317.u56DHPXd040681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 13:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301505 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 13:17:26 -0000 Author: bz Date: Mon Jun 6 13:17:25 2016 New Revision: 301505 URL: https://svnweb.freebsd.org/changeset/base/301505 Log: In if_purgeaddrs() we cannot hold the lock over the entire loop due to called functions (as in other parts of the stack, leave a comment). Put around a lock the removal of the ifa from the list however to reduce the possible race with other places. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 6 13:04:22 2016 (r301504) +++ head/sys/net/if.c Mon Jun 6 13:17:25 2016 (r301505) @@ -848,6 +848,7 @@ if_purgeaddrs(struct ifnet *ifp) { struct ifaddr *ifa, *next; + /* XXX cannot hold IF_ADDR_WLOCK over called functions. */ TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) { if (ifa->ifa_addr->sa_family == AF_LINK) continue; @@ -872,7 +873,9 @@ if_purgeaddrs(struct ifnet *ifp) continue; } #endif /* INET6 */ + IF_ADDR_WLOCK(ifp); TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); + IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); } } From owner-svn-src-all@freebsd.org Mon Jun 6 13:31:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFA2B6B1DF; Mon, 6 Jun 2016 13:31:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA45319FB; Mon, 6 Jun 2016 13:31:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56DVTIb045196; Mon, 6 Jun 2016 13:31:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56DVTj2045195; Mon, 6 Jun 2016 13:31:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606061331.u56DVTj2045195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 6 Jun 2016 13:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301506 - stable/10/sbin/dhclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 13:31:30 -0000 Author: pfg Date: Mon Jun 6 13:31:28 2016 New Revision: 301506 URL: https://svnweb.freebsd.org/changeset/base/301506 Log: MFC r301235: dhclient(1): correct obvious mismatch in get_char(). Correct switch between current and previous line buffers when encountering a carriage return in the input. CID: 1305719 Obtained from: OpenBSD (CVS rev. 1.30) Modified: stable/10/sbin/dhclient/conflex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dhclient/conflex.c ============================================================================== --- stable/10/sbin/dhclient/conflex.c Mon Jun 6 13:17:25 2016 (r301505) +++ stable/10/sbin/dhclient/conflex.c Mon Jun 6 13:31:28 2016 (r301506) @@ -97,8 +97,8 @@ get_char(FILE *cfile) cur_line = line2; prev_line = line1; } else { - cur_line = line2; - prev_line = line1; + cur_line = line1; + prev_line = line2; } line++; lpos = 1; From owner-svn-src-all@freebsd.org Mon Jun 6 13:32:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6417B6B3D9; Mon, 6 Jun 2016 13:32:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BEDE1C8B; Mon, 6 Jun 2016 13:32:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56DWFtN047235; Mon, 6 Jun 2016 13:32:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56DWFpK047234; Mon, 6 Jun 2016 13:32:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606061332.u56DWFpK047234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 6 Jun 2016 13:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301507 - stable/9/sbin/dhclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 13:32:16 -0000 Author: pfg Date: Mon Jun 6 13:32:15 2016 New Revision: 301507 URL: https://svnweb.freebsd.org/changeset/base/301507 Log: MFC r301235: dhclient(1): correct obvious mismatch in get_char(). Correct switch between current and previous line buffers when encountering a carriage return in the input. CID: 1305719 Obtained from: OpenBSD (CVS rev. 1.30) Modified: stable/9/sbin/dhclient/conflex.c Directory Properties: stable/9/sbin/dhclient/ (props changed) Modified: stable/9/sbin/dhclient/conflex.c ============================================================================== --- stable/9/sbin/dhclient/conflex.c Mon Jun 6 13:31:28 2016 (r301506) +++ stable/9/sbin/dhclient/conflex.c Mon Jun 6 13:32:15 2016 (r301507) @@ -97,8 +97,8 @@ get_char(FILE *cfile) cur_line = line2; prev_line = line1; } else { - cur_line = line2; - prev_line = line1; + cur_line = line1; + prev_line = line2; } line++; lpos = 1; From owner-svn-src-all@freebsd.org Mon Jun 6 13:43:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38135B6B706 for ; Mon, 6 Jun 2016 13:43:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm9-vm0.bullet.mail.bf1.yahoo.com (nm9-vm0.bullet.mail.bf1.yahoo.com [98.139.213.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB1D61292 for ; Mon, 6 Jun 2016 13:43:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465220605; bh=aznCmVeQYA522gz8SZTRhk3WysQKsxPEbWPz8753bso=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=j5UFZ1BVvanEwnm4ttws7yskVtbliZ0CibQOO3PXZX6SBsetHETgL+5TNrLXWlnaZ+cYbvDwWsDCs3CFygdY1J2PqmK7YyYMMG0TUPe+2FcG+VC/JEv3nbSyT6OlWT9YZ5Wyr9JmXGGBYyKwVvCTOpNXTimIwwZO7pPnlB7tyVhOqpni2iRUeZ7DaPYPpazSdchhZj4EUfIjfms2jVCDtxwYjnTOAFbagm3/gMlK53G0lIHsqzlsJccZgZ2oj1V6pOtjG7BhMLaaS7XIEHKuGSgEc5TFCdrANwNG5l/Wa3HcEkyYRGpAIQiLwMYTRdHxmrfV4dQvStKy2IZlRdcujA== Received: from [66.196.81.170] by nm9.bullet.mail.bf1.yahoo.com with NNFMP; 06 Jun 2016 13:43:25 -0000 Received: from [98.139.213.15] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 06 Jun 2016 13:43:25 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 06 Jun 2016 13:43:25 -0000 X-Yahoo-Newman-Id: 130390.503.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 3hbHIqoVM1lRsPFxqNT00pbL5BBvvAL9cYmvZwk9MVfmAu6 0uKhQ8jcUjpCIACUGnwBsPF4PZDAhOzv.YcuSHTScbYtysVQFgzDUJMYw.UM h1uSsMCu1uiBlnmPYTIIWNqtxOrSlRWH74.YoGr3SvGe18qwQPwVvwEGt5z_ 468kwSGXh2OEmJfojHTL_tndQz4wCXwpOJlpHsozEU5vIMQJSH2i_IfgXLSr YkoumzNAmyrtrn65tVPnEC1hDPXboyNXeUXolEE4nKwYkCO_eVLejiPZL__R aEiFa63Y78O0K_JvOLoG.cglZ41zq9F4siZ.a1jIcFMNGmcCH5PM.0niUpba ebOqGzRPsUmIvx85sWbxF4PJ0TLIcP16UVaNsMstPS49FwzmYnqUOKHTL11v GfWOsd9ywlwa2wVB6xoE5_wpe7Ylg6SAV8guSvZLXufRCGhPnC2WBMcyF_C4 O0hPGGlBlwDEoL.VfNsRgdcNDJ4B8dYECbsfbodKQtDhO4j.B6BxeNPyisqp TYkuELnsCC7JD2vkNv5ZWsduyf0sCDr5s X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r301461 - in head/lib/libc: gen locale regex To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606051912.u55JCqdR036458@repo.freebsd.org> <40c481fe-5585-45d2-d4e3-b9988a8198f3@freebsd.org> From: Pedro Giffuni Message-ID: Date: Mon, 6 Jun 2016 08:43:12 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <40c481fe-5585-45d2-d4e3-b9988a8198f3@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 13:43:27 -0000 On 06/05/16 14:49, Andrey Chernov wrote: > On 05.06.2016 22:12, Pedro F. Giffuni wrote: >> --- head/lib/libc/regex/regcomp.c Sun Jun 5 18:16:33 2016 (r301460) >> +++ head/lib/libc/regex/regcomp.c Sun Jun 5 19:12:52 2016 (r301461) >> @@ -821,10 +821,10 @@ p_b_term(struct parse *p, cset *cs) >> (void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE); >> CHaddrange(p, cs, start, finish); >> } else { >> - (void)REQUIRE(__collate_range_cmp(table, start, finish) <= 0, REG_ERANGE); >> + (void)REQUIRE(__wcollate_range_cmp(table, start, finish) <= 0, REG_ERANGE); >> for (i = 0; i <= UCHAR_MAX; i++) { >> - if ( __collate_range_cmp(table, start, i) <= 0 >> - && __collate_range_cmp(table, i, finish) <= 0 >> + if ( __wcollate_range_cmp(table, start, i) <= 0 >> + && __wcollate_range_cmp(table, i, finish) <= 0 >> ) >> CHadd(p, cs, i); >> } >> > > As I already mention in PR, we have broken regcomp after someone adds > wchar_t support there. Now regcomp ranges works only for the first 256 > wchars of the current locale, notice that loop upper limit: > for (i = 0; i <= UCHAR_MAX; i++) { > In general, ranges are either broken in regcomp now or are memory > eating. We have bitmask only for the first 256 wchars, all other added > to the range literally. Imagine what happens if someone specify full > Unicode range in regexp. > > Proper fix will be adding bitmask for the whole Unicode range, and even > in that case regcomp attempting to use collation in ranges will be > _very_slow_ since needs to check all Unicode chars in its > for (i = 0; i <= Max_Unicode_wchar; i++) { > loop. > > Better stop pretending that we are able to do collation support in the > ranges, since POSIX cares about its own locale only here: > "In the POSIX locale, a range expression represents the set of collating > elements that fall between two elements in the collation sequence, > inclusive. In other locales, a range expression has unspecified > behavior: strictly conforming applications shall not rely on whether the > range expression is valid, or on the set of collating elements matched." > > Until whole Unicode range bitmask will be implemented (if ever), better > stop pretending to honor collation order, we just can't do it with > wchars now and do what NetBSD/OpenBSD does (using wchar_t) instead. It > does not prevent memory eating on big ranges (bitmask is needed, see > above), but at least fix the thing that only first 256 wchars are > considered. > Sadly regex is one part of the system that could use a maintainer :(, I have been forced to look at it more than I'd like to but I don't really use the collation support at all. Pedro. From owner-svn-src-all@freebsd.org Mon Jun 6 14:01:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADA7FB6BD45; Mon, 6 Jun 2016 14:01:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDD91C1A; Mon, 6 Jun 2016 14:01:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56E19nD055670; Mon, 6 Jun 2016 14:01:09 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56E19Ec055669; Mon, 6 Jun 2016 14:01:09 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606061401.u56E19Ec055669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 14:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301508 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 14:01:10 -0000 Author: bz Date: Mon Jun 6 14:01:09 2016 New Revision: 301508 URL: https://svnweb.freebsd.org/changeset/base/301508 Log: Move the callout_reset() to the end of the work not having it stick before we do anything. Obtained from: projects/vnet MFC after: 2 week Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 6 13:32:15 2016 (r301507) +++ head/sys/netinet6/nd6.c Mon Jun 6 14:01:09 2016 (r301508) @@ -896,9 +896,6 @@ nd6_timer(void *arg) struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; - callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, - nd6_timer, curvnet); - TAILQ_INIT(&drq); /* expire default router list */ @@ -1025,6 +1022,10 @@ nd6_timer(void *arg) prelist_remove(pr); } } + + callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, + nd6_timer, curvnet); + CURVNET_RESTORE(); } From owner-svn-src-all@freebsd.org Mon Jun 6 14:55:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BDDFB6DE81; Mon, 6 Jun 2016 14:55:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3E613AD; Mon, 6 Jun 2016 14:55:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56Etkfo077856; Mon, 6 Jun 2016 14:55:46 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56Etkkg077855; Mon, 6 Jun 2016 14:55:46 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606061455.u56Etkkg077855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 6 Jun 2016 14:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301511 - head/sys/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 14:55:47 -0000 Author: royger Date: Mon Jun 6 14:55:46 2016 New Revision: 301511 URL: https://svnweb.freebsd.org/changeset/base/301511 Log: xen: Correct typo in #undef for symbol NBPL Submitted by: Akshay Jaggi Reviewed by: royger Modified: head/sys/xen/xen-os.h Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Mon Jun 6 14:24:01 2016 (r301510) +++ head/sys/xen/xen-os.h Mon Jun 6 14:55:46 2016 (r301511) @@ -118,7 +118,7 @@ xen_clear_bit(int bit, volatile long *ad atomic_clear_long(&addr[bit / NBPL], 1UL << (bit % NBPL)); } -#undef NPBL +#undef NBPL /* * Functions to allocate/free unused memory in order From owner-svn-src-all@freebsd.org Mon Jun 6 15:01:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65904B6D0D2; Mon, 6 Jun 2016 15:01:25 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E0EF1A59; Mon, 6 Jun 2016 15:01:25 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56F1Otw078807; Mon, 6 Jun 2016 15:01:24 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56F1OUT078806; Mon, 6 Jun 2016 15:01:24 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606061501.u56F1OUT078806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 6 Jun 2016 15:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301512 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 15:01:25 -0000 Author: royger Date: Mon Jun 6 15:01:24 2016 New Revision: 301512 URL: https://svnweb.freebsd.org/changeset/base/301512 Log: xen-netfront: fix initialization A couple of mostly cosmetic fixes for the final initialization of netfront: - Switch to "connected" state before starting to kick the rings. - Correctly use "rxq" in the initialization loop (previously rxq was not updated in the loop, and netfront would kick np->rxq[N] several times). - Declare and define xn_connect as static, it's not used outside of this file. Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6657 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Mon Jun 6 14:55:46 2016 (r301511) +++ head/sys/dev/xen/netfront/netfront.c Mon Jun 6 15:01:24 2016 (r301512) @@ -146,7 +146,8 @@ static int setup_device(device_t dev, st static int xn_ifmedia_upd(struct ifnet *ifp); static void xn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); -int xn_connect(struct netfront_info *); +static int xn_connect(struct netfront_info *); +static void xn_kick_rings(struct netfront_info *); static int xn_get_responses(struct netfront_rxq *, struct netfront_rx_info *, RING_IDX, RING_IDX *, @@ -976,7 +977,9 @@ netfront_backend_changed(device_t dev, X break; if (xn_connect(sc) != 0) break; - xenbus_set_state(dev, XenbusStateConnected); + /* Switch to connected state before kicking the rings. */ + xenbus_set_state(sc->xbdev, XenbusStateConnected); + xn_kick_rings(sc); break; case XenbusStateClosing: xenbus_set_state(dev, XenbusStateClosed); @@ -1924,7 +1927,7 @@ xn_rebuild_rx_bufs(struct netfront_rxq * } /* START of Xenolinux helper functions adapted to FreeBSD */ -int +static int xn_connect(struct netfront_info *np) { int i, error; @@ -1968,8 +1971,20 @@ xn_connect(struct netfront_info *np) * packets. */ netfront_carrier_on(np); + + return (0); +} + +static void +xn_kick_rings(struct netfront_info *np) +{ + struct netfront_rxq *rxq; + struct netfront_txq *txq; + int i; + for (i = 0; i < np->num_queues; i++) { txq = &np->txq[i]; + rxq = &np->rxq[i]; xen_intr_signal(txq->xen_intr_handle); XN_TX_LOCK(txq); xn_txeof(txq); @@ -1978,8 +1993,6 @@ xn_connect(struct netfront_info *np) xn_alloc_rx_buffers(rxq); XN_RX_UNLOCK(rxq); } - - return (0); } static void From owner-svn-src-all@freebsd.org Mon Jun 6 16:10:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B0DB6B2BB; Mon, 6 Jun 2016 16:10:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A546E1E97; Mon, 6 Jun 2016 16:10:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56GAquV004981; Mon, 6 Jun 2016 16:10:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56GAqE3004980; Mon, 6 Jun 2016 16:10:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606061610.u56GAqE3004980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 6 Jun 2016 16:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301513 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 16:10:53 -0000 Author: pfg Date: Mon Jun 6 16:10:52 2016 New Revision: 301513 URL: https://svnweb.freebsd.org/changeset/base/301513 Log: indent(1): Fix typo. It's typedef, not typdef. Obtained from: OpenBSD (CVS rev. 1.20) MFC after: 3 days Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Mon Jun 6 15:01:24 2016 (r301512) +++ head/usr.bin/indent/lexi.c Mon Jun 6 16:10:52 2016 (r301513) @@ -79,7 +79,7 @@ struct templ specials[1000] = {"double", 4}, {"long", 4}, {"short", 4}, - {"typdef", 4}, + {"typedef", 4}, {"unsigned", 4}, {"register", 4}, {"static", 4}, From owner-svn-src-all@freebsd.org Mon Jun 6 16:23:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B23F0B6B626; Mon, 6 Jun 2016 16:23:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D7031783; Mon, 6 Jun 2016 16:23:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56GN2Hl012347; Mon, 6 Jun 2016 16:23:02 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56GN2SQ012346; Mon, 6 Jun 2016 16:23:02 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606061623.u56GN2SQ012346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 16:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301514 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 16:23:03 -0000 Author: bz Date: Mon Jun 6 16:23:02 2016 New Revision: 301514 URL: https://svnweb.freebsd.org/changeset/base/301514 Log: Similarly to r301505 protect the removal of the ifa from the if_addrhead by a lock (as well as the check that the list is not empty). Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 6 16:10:52 2016 (r301513) +++ head/sys/net/if.c Mon Jun 6 16:23:02 2016 (r301514) @@ -1007,11 +1007,14 @@ if_detach_internal(struct ifnet *ifp, in ifp->if_addr = NULL; /* We can now free link ifaddr. */ + IF_ADDR_WLOCK(ifp); if (!TAILQ_EMPTY(&ifp->if_addrhead)) { ifa = TAILQ_FIRST(&ifp->if_addrhead); TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link); + IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); - } + } else + IF_ADDR_WUNLOCK(ifp); } rt_flushifroutes(ifp); From owner-svn-src-all@freebsd.org Mon Jun 6 16:32:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78593B6B942; Mon, 6 Jun 2016 16:32:11 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484141CA1; Mon, 6 Jun 2016 16:32:11 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id u67so2185481pfu.0; Mon, 06 Jun 2016 09:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=kzomo431CIaqSCCWFywFDwRFmtyt3c7O671X9Rnqb30=; b=uUVTFlhS4LcVTBml8jMElNvRUZ2jAJK4pSsejvN5VpQkLQndQUXRjOJ9f3aj6NkpLt WZZWrZ6ut+Kxvm3g4XO8Vwl5TX2Z0rdgzmMDfPLlLNXZzLuXFPK/goxk0gr6Y3rqDyrw 0gBhKUIuMsw8iAA5fls/IY4+cAInmY9WUA1W54mPl2iE7sj5ug++PklQsx+5HMRJOiSd S5EgfJUWLp443mpC5X07je7OyxXsa5oKZnIfGG1tUgxlWo/FQ7a4xazLba1iF3lLgGOW IVwSTwpTrIqDCBOEui0u2wo/x6kFw1jMQbDnSA+LbSA4Du3sGulz3Qvg5DzYVi7T83Bz LVqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=kzomo431CIaqSCCWFywFDwRFmtyt3c7O671X9Rnqb30=; b=dsaGvefl2S5XL3QX4qTsOAyJIzr898vc6nmd2ERiDFutmVRcMHe3sdiKUbwHKLpoZ0 mQccFXky15GE4ZIt96j26yXtySLK4w1YbMqNDQ9EwSQx1UgDrm2tFecqcPWgDqHdNnq8 pAIZpTQUk7Ft/5Gp0YTP89q1piu5lBQDDtM1lxsMbQeLDiEZPljJyEuGKU9V1+XUKkkD 9HcKUNF49iSCVF1Vo2b8HOYca3fBkqNmI97w5v6ttPAGuw0kRwXLIiyTtKONEDa++i6N hbcy3kSDMGR41IGLZ+euzDrXZ/AeopcwBeaug93oqMMQ1h1nsL7x3FfVCUASoKYnq8BO kR9w== X-Gm-Message-State: ALyK8tKMoSNcL9M3ltm85RVxfPQPJ8Zks+6k6mciB2C8VBlhoV2i9hxApKlZWrp6bnOfjA== X-Received: by 10.98.65.209 with SMTP id g78mr26041428pfd.163.1465230730878; Mon, 06 Jun 2016 09:32:10 -0700 (PDT) Received: from Spirit (dsl081-051-141.sfo1.dsl.speakeasy.net. [64.81.51.141]) by smtp.gmail.com with ESMTPSA id c16sm28915554pfb.33.2016.06.06.09.32.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jun 2016 09:32:10 -0700 (PDT) From: "Qing" To: , Cc: , , , References: <201606021751.u52HpTrH090384@repo.freebsd.org> <3448221465067132@web17h.yandex.ru> <3505271465193212@web29h.yandex.ru> In-Reply-To: <3505271465193212@web29h.yandex.ru> Subject: RE: svn commit: r301217 - in head/sys: net netinet netinet6 Date: Mon, 6 Jun 2016 09:32:08 -0700 Message-ID: <000001d1c010$f8d603c0$ea820b40$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHlai0SVLpjmg1ru461iLTBWDNtEwFUZxBSAak1TRwA5ZA64J+WMCqQ Content-Language: en-us X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 16:32:11 -0000 -----Original Message----- From: owner-src-committers@freebsd.org = [mailto:owner-src-committers@freebsd.org] On Behalf Of Alexander V. = Chernikov Sent: Sunday, June 05, 2016 11:07 PM To: George Neville-Neil Cc: Mike Karels ; src-committers = ; svn-src-all ; = svn-src-head Subject: Re: svn commit: r301217 - in head/sys: net netinet netinet6 06.06.2016, 04:40, "George Neville-Neil" : > On 4 Jun 2016, at 15:05, Alexander V. Chernikov wrote: > >> 02.06.2016, 20:51, "George V. Neville-Neil" : >>> Author: gnn >>> Date: Thu Jun 2 17:51:29 2016 >>> New Revision: 301217 >>> URL: https://svnweb.freebsd.org/changeset/base/301217 >>> >>> Log: >>> This change re-adds L2 caching for TCP and UDP, as originally >>> added in D4306 >>> but removed due to other changes in the system. Restore the >>> llentry pointer >>> to the "struct route", and use it to cache the L2 lookup (ARP or >>> ND6) as >>> appropriate. >> >> I have several comments regarding this commit. >> >> 1 Architecturally, there was quite a lot of efforts to eliminate >> layering violation between lltable and other places in network = stack. >> It ended by committing D4102, which allowed both to cleanup lower >> level, provide abstract =E2=80=9Cprepend=E2=80=9D framework which = could be used to >> provide cached data to _otuput() functions. >> This change brings these violations back in a really invasive way. >> >> Additionally, implementing L2 PCB caching at the other subsystem >> expense is really a bad idea. >> If one wants caching in some subsystem, it should be implemented in >> that subsystem not polluting other things. >> Current implementation permits this by filling in = =E2=80=9Cro_prepend=E2=80=9D / >> ro_plen fields. >> >> In general, this change looks more like a local hack and not like=20 >> the >> code that should be included in the tree. >> >> 2 There was no benchmarks proving the effectiveness of this change. >> (For example, it is not obvious if it could significantly improve=20 >> TCP >> since we still have per-session TCP wlock + (typically) per-ring >> mutex, so removing lltable rock might not help things here). Given >> that the patch complicates existing code, there should be adequate >> benefits to consider whether this change is worth implementing. >> >> 3 The =E2=80=9Cnetwork=E2=80=9D group was not included to the review = despite the >> fact that most of the changes were related to the L2 layer which is >> not =E2=80=9Ctransport=E2=80=9D, so some people might have missed = this review. >> >> 4 This change DOES NOT WORK. really. >> (which raises questions on both review and benchmarking process). >> >> The reason is that =E2=80=9Cplle=E2=80=9D argument is filled only in = =E2=80=9Cheavy=E2=80=9D >> lltable lookup functions (e.g. when we don=E2=80=99t have neighbour >> adjacency). 99.9% of the time arpresolve/nd6_resolve() returns the >> result w/o calling their heavy versions, and the returned = =E2=80=9Cplle=E2=80=9D >> is NULL. >> >> This can be easily verified by calling something like >> dtrace -n 'fbt:kernel:ether_output:entry /arg3!=3DNULL&&((struct = route >> *)arg3)->ro_lle !=3D NULL/ { stack(); }' >> >> Given that, I kindly ask you to backout this change. > > Hi, > > I'm going to limit the scope of this reply to just you, me and Mike=20 > Karels, from whom this originated. >>No, please keep the discussion open. The decision on having that = particular L2 caching=20 >>implementation (and L2 caching in general) is quite important, so it = would be great if=20 >>all technical arguments were saved so other people can=20 >>(now or later) understand the decision details. >>Thanks for understanding. This commit does seem to undo the non-trivial layer separation efforts = invested previously.=20 The flow-table construction was meant to help accelerate TCP/UDP route = lookups. The various aspects of the routing code took flow-table into consideration, and = those code are still present even after this change. --Qing From owner-svn-src-all@freebsd.org Mon Jun 6 16:38:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90A09B6BB95; Mon, 6 Jun 2016 16:38:11 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies, LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 451E5107B; Mon, 6 Jun 2016 16:38:11 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from torb.pix.net (torb.pix.net [192.168.16.32]) (authenticated bits=0) by hydra.pix.net (8.15.2/8.15.2) with ESMTPA id u56Gc9FR062665; Mon, 6 Jun 2016 12:38:10 -0400 (EDT) (envelope-from lidl@FreeBSD.org) Reply-To: lidl@FreeBSD.org Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... References: <201606021906.u52J649H019481@repo.freebsd.org> To: Matteo Riondato Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kurt Lidl Message-ID: <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> Date: Mon, 6 Jun 2016 12:38:09 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 16:38:11 -0000 On 6/5/16 2:39 PM, Matteo Riondato wrote: > >> On Jun 2, 2016, at 3:06 PM, Kurt Lidl wrote: >> >> Author: lidl >> Date: Thu Jun 2 19:06:04 2016 >> New Revision: 301226 >> URL: https://svnweb.freebsd.org/changeset/base/301226 >> >> Log: >> Add basic blacklist build support >> > [snip] >> Modified: head/etc/defaults/rc.conf >> ============================================================================== >> --- head/etc/defaults/rc.conf Thu Jun 2 18:41:33 2016 (r301225) >> +++ head/etc/defaults/rc.conf Thu Jun 2 19:06:04 2016 (r301226) >> @@ -270,6 +270,8 @@ hastd_program="/sbin/hastd" # path to ha >> hastd_flags="" # Optional flags to hastd. >> ctld_enable="NO" # CAM Target Layer / iSCSI target daemon. >> local_unbound_enable="NO" # local caching resolver >> +blacklistd_enable="YES" # Run blacklistd daemon (YES/NO). >> +blacklistd_flags="" # Optional flags for blacklistd(8). > > What is the rationale for having this enabled by default? Well, from a certain standpoint, it will encourage more people to enable the packet filtering it in their pf.conf and get the benefit of having a system-wide blacklist notification system running. Without a one-line change to enable the blocking in the pf.conf file, it won't do any blocking. > Is any of the services that use it (in their default config) enabled by default? I suppose, technically speaking, no there are no daemons with blacklist support enabled by default. I am planning to commit the sshd support tomorrow morning, and even *that* daemon isn't enabled by default. I am happy enough to turn off the blacklist daemon by default. You are the first person to question this since I posted the review back near the beginning of April. -Kurt From owner-svn-src-all@freebsd.org Mon Jun 6 16:54:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96ADCB6D1F6; Mon, 6 Jun 2016 16:54:34 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 360BD1D10; Mon, 6 Jun 2016 16:54:34 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1b9xnL-00043l-FA; Mon, 06 Jun 2016 19:54:31 +0300 Date: Mon, 6 Jun 2016 19:54:31 +0300 From: Slawa Olhovchenkov To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys Message-ID: <20160606165431.GF75625@zxy.spb.ru> References: <201606060951.u569pwOI063390@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606060951.u569pwOI063390@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 16:54:34 -0000 On Mon, Jun 06, 2016 at 09:51:58AM +0000, Marcelo Araujo wrote: > Author: araujo > Date: Mon Jun 6 09:51:58 2016 > New Revision: 301496 > URL: https://svnweb.freebsd.org/changeset/base/301496 > > Log: > Add support to priority code point (PCP) that is an 3-bit field > which refers to IEEE 802.1p class of service and maps to the frame > priority level. > > Values in order of priority are: 1 (Background (lowest)), > 0 (Best effort (default)), 2 (Excellent effort), > 3 (Critical applications), 4 (Video, < 100ms latency), > 5 (Video, < 10ms latency), 6 (Internetwork control) and > 7 (Network control (highest)). What purpose to use 4 for video? http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus1000/sw/4_0/qos/configuration/guide/nexus1000v_qos/qos_6dscp_val.pdf point video is 3. > Example of usage: > root# ifconfig em0.1 create > root# ifconfig em0.1 vlanpcp 3 > > Note: > The review D801 includes the pf(4) part, but as discussed with kristof, > we won't commit the pf(4) bits for now. > The credits of the original code is from rwatson. > > Differential Revision: https://reviews.freebsd.org/D801 > Reviewed by: gnn, adrian, loos > Discussed with: rwatson, glebius, kristof > Tested by: many including Matthew Grooms > Obtained from: pfSense > Relnotes: Yes > > Modified: > head/sbin/ifconfig/ifconfig.8 > head/sbin/ifconfig/ifvlan.c > head/share/man/man4/vlan.4 > head/sys/net/if.h > head/sys/net/if_vlan.c > head/sys/net/if_vlan_var.h > head/sys/sys/priv.h > > Modified: head/sbin/ifconfig/ifconfig.8 > ============================================================================== > --- head/sbin/ifconfig/ifconfig.8 Mon Jun 6 09:30:31 2016 (r301495) > +++ head/sbin/ifconfig/ifconfig.8 Mon Jun 6 09:51:58 2016 (r301496) > @@ -2614,6 +2614,29 @@ Note that > and > .Cm vlandev > must both be set at the same time. > +.It Cm vlanpcp Ar priority_code_point > +Priority code point > +.Pq Dv PCP > +is an 3-bit field which refers to the IEEE 802.1p > +class of service and maps to the frame priority level. > +.Pp > +Values in order of priority are: > +.Cm 1 > +.Pq Dv Background (lowest) , > +.Cm 0 > +.Pq Dv Best effort (default) , > +.Cm 2 > +.Pq Dv Excellent effort , > +.Cm 3 > +.Pq Dv Critical applications , > +.Cm 4 > +.Pq Dv Video, < 100ms latency , > +.Cm 5 > +.Pq Dv Video, < 10ms latency , > +.Cm 6 > +.Pq Dv Internetwork control , > +.Cm 7 > +.Pq Dv Network control (highest) . > .It Cm vlandev Ar iface > Associate the physical interface > .Ar iface > > Modified: head/sbin/ifconfig/ifvlan.c > ============================================================================== > --- head/sbin/ifconfig/ifvlan.c Mon Jun 6 09:30:31 2016 (r301495) > +++ head/sbin/ifconfig/ifvlan.c Mon Jun 6 09:51:58 2016 (r301496) > @@ -1,6 +1,10 @@ > /* > - * Copyright (c) 1999 > - * Bill Paul . All rights reserved. > + * Copyright (c) 1999 Bill Paul > + * Copyright (c) 2012 ADARA Networks, Inc. > + * All rights reserved. > + * > + * Portions of this software were developed by Robert N. M. Watson under > + * contract to ADARA Networks, Inc. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -78,10 +82,14 @@ vlan_status(int s) > { > struct vlanreq vreq; > > - if (getvlan(s, &ifr, &vreq) != -1) > - printf("\tvlan: %d parent interface: %s\n", > - vreq.vlr_tag, vreq.vlr_parent[0] == '\0' ? > - "" : vreq.vlr_parent); > + if (getvlan(s, &ifr, &vreq) == -1) > + return; > + printf("\tvlan: %d", vreq.vlr_tag); > + if (ioctl(s, SIOCGVLANPCP, (caddr_t)&ifr) != -1) > + printf(" vlanpcp: %u", ifr.ifr_vlan_pcp); > + printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ? > + "" : vreq.vlr_parent); > + printf("\n"); > } > > static void > @@ -149,6 +157,22 @@ DECL_CMD_FUNC(setvlandev, val, d) > } > > static > +DECL_CMD_FUNC(setvlanpcp, val, d) > +{ > + u_long ul; > + char *endp; > + > + ul = strtoul(val, &endp, 0); > + if (*endp != '\0') > + errx(1, "invalid value for vlanpcp"); > + if (ul > 7) > + errx(1, "value for vlanpcp out of range"); > + ifr.ifr_vlan_pcp = ul; > + if (ioctl(s, SIOCSVLANPCP, (caddr_t)&ifr) == -1) > + err(1, "SIOCSVLANPCP"); > +} > + > +static > DECL_CMD_FUNC(unsetvlandev, val, d) > { > struct vlanreq vreq; > @@ -169,6 +193,7 @@ DECL_CMD_FUNC(unsetvlandev, val, d) > static struct cmd vlan_cmds[] = { > DEF_CLONE_CMD_ARG("vlan", setvlantag), > DEF_CLONE_CMD_ARG("vlandev", setvlandev), > + DEF_CMD_ARG("vlanpcp", setvlanpcp), > /* NB: non-clone cmds */ > DEF_CMD_ARG("vlan", setvlantag), > DEF_CMD_ARG("vlandev", setvlandev), > > Modified: head/share/man/man4/vlan.4 > ============================================================================== > --- head/share/man/man4/vlan.4 Mon Jun 6 09:30:31 2016 (r301495) > +++ head/share/man/man4/vlan.4 Mon Jun 6 09:51:58 2016 (r301496) > @@ -203,5 +203,3 @@ can be corrected manually if used in con > .Sh SEE ALSO > .Xr ifconfig 8 , > .Xr sysctl 8 > -.Sh BUGS > -No 802.1Q features except VLAN tagging are implemented. > > Modified: head/sys/net/if.h > ============================================================================== > --- head/sys/net/if.h Mon Jun 6 09:30:31 2016 (r301495) > +++ head/sys/net/if.h Mon Jun 6 09:51:58 2016 (r301496) > @@ -393,6 +393,7 @@ struct ifreq { > caddr_t ifru_data; > int ifru_cap[2]; > u_int ifru_fib; > + u_char ifru_vlan_pcp; > } ifr_ifru; > #define ifr_addr ifr_ifru.ifru_addr /* address */ > #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ > @@ -410,6 +411,7 @@ struct ifreq { > #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ > #define ifr_index ifr_ifru.ifru_index /* interface index */ > #define ifr_fib ifr_ifru.ifru_fib /* interface fib */ > +#define ifr_vlan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */ > }; > > #define _SIZEOF_ADDR_IFREQ(ifr) \ > > Modified: head/sys/net/if_vlan.c > ============================================================================== > --- head/sys/net/if_vlan.c Mon Jun 6 09:30:31 2016 (r301495) > +++ head/sys/net/if_vlan.c Mon Jun 6 09:51:58 2016 (r301496) > @@ -1,5 +1,9 @@ > /*- > * Copyright 1998 Massachusetts Institute of Technology > + * Copyright 2012 ADARA Networks, Inc. > + * > + * Portions of this software were developed by Robert N. M. Watson under > + * contract to ADARA Networks, Inc. > * > * Permission to use, copy, modify, and distribute this software and > * its documentation for any purpose and without fee is hereby > @@ -29,8 +33,7 @@ > > /* > * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. > - * Might be extended some day to also handle IEEE 802.1p priority > - * tagging. This is sort of sneaky in the implementation, since > + * This is sort of sneaky in the implementation, since > * we need to pretend to be enough of an Ethernet implementation > * to make arp work. The way we do this is by telling everyone > * that we are an Ethernet, and then catch the packets that > @@ -52,6 +55,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -114,6 +118,8 @@ struct ifvlan { > int ifvm_mintu; /* min transmission unit */ > uint16_t ifvm_proto; /* encapsulation ethertype */ > uint16_t ifvm_tag; /* tag to apply on packets leaving if */ > + uint16_t ifvm_vid; /* VLAN ID */ > + uint8_t ifvm_pcp; /* Priority Code Point (PCP). */ > } ifv_mib; > SLIST_HEAD(, vlan_mc_entry) vlan_mc_listhead; > #ifndef VLAN_ARRAY > @@ -121,7 +127,9 @@ struct ifvlan { > #endif > }; > #define ifv_proto ifv_mib.ifvm_proto > -#define ifv_vid ifv_mib.ifvm_tag > +#define ifv_tag ifv_mib.ifvm_tag > +#define ifv_vid ifv_mib.ifvm_vid > +#define ifv_pcp ifv_mib.ifvm_pcp > #define ifv_encaplen ifv_mib.ifvm_encaplen > #define ifv_mtufudge ifv_mib.ifvm_mtufudge > #define ifv_mintu ifv_mib.ifvm_mintu > @@ -147,6 +155,15 @@ static VNET_DEFINE(int, soft_pad); > SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET, > &VNET_NAME(soft_pad), 0, "pad short frames before tagging"); > > +/* > + * For now, make preserving PCP via an mbuf tag optional, as it increases > + * per-packet memory allocations and frees. In the future, it would be > + * preferable to reuse ether_vtag for this, or similar. > + */ > +static int vlan_mtag_pcp = 0; > +SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW, &vlan_mtag_pcp, 0, > + "Retain VLAN PCP information as packets are passed up the stack"); > + > static const char vlanname[] = "vlan"; > static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface"); > > @@ -697,6 +714,16 @@ vlan_devat(struct ifnet *ifp, uint16_t v > } > > /* > + * Recalculate the cached VLAN tag exposed via the MIB. > + */ > +static void > +vlan_tag_recalculate(struct ifvlan *ifv) > +{ > + > + ifv->ifv_tag = EVL_MAKETAG(ifv->ifv_vid, ifv->ifv_pcp, 0); > +} > + > +/* > * VLAN support can be loaded as a module. The only place in the > * system that's intimately aware of this is ether_input. We hook > * into this code through vlan_input_p which is defined there and > @@ -1009,6 +1036,8 @@ vlan_transmit(struct ifnet *ifp, struct > { > struct ifvlan *ifv; > struct ifnet *p; > + struct m_tag *mtag; > + uint16_t tag; > int error, len, mcast; > > ifv = ifp->if_softc; > @@ -1064,11 +1093,16 @@ vlan_transmit(struct ifnet *ifp, struct > * knows how to find the VLAN tag to use, so we attach a > * packet tag that holds it. > */ > + if (vlan_mtag_pcp && (mtag = m_tag_locate(m, MTAG_8021Q, > + MTAG_8021Q_PCP_OUT, NULL)) != NULL) > + tag = EVL_MAKETAG(ifv->ifv_vid, *(uint8_t *)(mtag + 1), 0); > + else > + tag = ifv->ifv_tag; > if (p->if_capenable & IFCAP_VLAN_HWTAGGING) { > - m->m_pkthdr.ether_vtag = ifv->ifv_vid; > + m->m_pkthdr.ether_vtag = tag; > m->m_flags |= M_VLANTAG; > } else { > - m = ether_vlanencap(m, ifv->ifv_vid); > + m = ether_vlanencap(m, tag); > if (m == NULL) { > if_printf(ifp, "unable to prepend VLAN header\n"); > if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); > @@ -1103,7 +1137,8 @@ vlan_input(struct ifnet *ifp, struct mbu > struct ifvlantrunk *trunk = ifp->if_vlantrunk; > struct ifvlan *ifv; > TRUNK_LOCK_READER; > - uint16_t vid; > + struct m_tag *mtag; > + uint16_t vid, tag; > > KASSERT(trunk != NULL, ("%s: no trunk", __func__)); > > @@ -1112,7 +1147,7 @@ vlan_input(struct ifnet *ifp, struct mbu > * Packet is tagged, but m contains a normal > * Ethernet frame; the tag is stored out-of-band. > */ > - vid = EVL_VLANOFTAG(m->m_pkthdr.ether_vtag); > + tag = m->m_pkthdr.ether_vtag; > m->m_flags &= ~M_VLANTAG; > } else { > struct ether_vlan_header *evl; > @@ -1128,7 +1163,7 @@ vlan_input(struct ifnet *ifp, struct mbu > return; > } > evl = mtod(m, struct ether_vlan_header *); > - vid = EVL_VLANOFTAG(ntohs(evl->evl_tag)); > + tag = ntohs(evl->evl_tag); > > /* > * Remove the 802.1q header by copying the Ethernet > @@ -1152,6 +1187,8 @@ vlan_input(struct ifnet *ifp, struct mbu > } > } > > + vid = EVL_VLANOFTAG(tag); > + > TRUNK_RLOCK(trunk); > ifv = vlan_gethash(trunk, vid); > if (ifv == NULL || !UP_AND_RUNNING(ifv->ifv_ifp)) { > @@ -1162,6 +1199,28 @@ vlan_input(struct ifnet *ifp, struct mbu > } > TRUNK_RUNLOCK(trunk); > > + if (vlan_mtag_pcp) { > + /* > + * While uncommon, it is possible that we will find a 802.1q > + * packet encapsulated inside another packet that also had an > + * 802.1q header. For example, ethernet tunneled over IPSEC > + * arriving over ethernet. In that case, we replace the > + * existing 802.1q PCP m_tag value. > + */ > + mtag = m_tag_locate(m, MTAG_8021Q, MTAG_8021Q_PCP_IN, NULL); > + if (mtag == NULL) { > + mtag = m_tag_alloc(MTAG_8021Q, MTAG_8021Q_PCP_IN, > + sizeof(uint8_t), M_NOWAIT); > + if (mtag == NULL) { > + m_freem(m); > + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); > + return; > + } > + m_tag_prepend(m, mtag); > + } > + *(uint8_t *)(mtag + 1) = EVL_PRIOFTAG(tag); > + } > + > m->m_pkthdr.rcvif = ifv->ifv_ifp; > if_inc_counter(ifv->ifv_ifp, IFCOUNTER_IPACKETS, 1); > > @@ -1201,7 +1260,7 @@ vlan_config(struct ifvlan *ifv, struct i > vlan_inithash(trunk); > VLAN_LOCK(); > if (p->if_vlantrunk != NULL) { > - /* A race that that is very unlikely to be hit. */ > + /* A race that is very unlikely to be hit. */ > vlan_freehash(trunk); > free(trunk, M_VLAN); > goto exists; > @@ -1218,6 +1277,8 @@ exists: > } > > ifv->ifv_vid = vid; /* must set this before vlan_inshash() */ > + ifv->ifv_pcp = 0; /* Default: best effort delivery. */ > + vlan_tag_recalculate(ifv); > error = vlan_inshash(trunk, ifv); > if (error) > goto done; > @@ -1705,6 +1766,34 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd > } > break; > > + case SIOCGVLANPCP: > +#ifdef VIMAGE > + if (ifp->if_vnet != ifp->if_home_vnet) { > + error = EPERM; > + break; > + } > +#endif > + ifr->ifr_vlan_pcp = ifv->ifv_pcp; > + break; > + > + case SIOCSVLANPCP: > +#ifdef VIMAGE > + if (ifp->if_vnet != ifp->if_home_vnet) { > + error = EPERM; > + break; > + } > +#endif > + error = priv_check(curthread, PRIV_NET_SETVLANPCP); > + if (error) > + break; > + if (ifr->ifr_vlan_pcp > 7) { > + error = EINVAL; > + break; > + } > + ifv->ifv_pcp = ifr->ifr_vlan_pcp; > + vlan_tag_recalculate(ifv); > + break; > + > default: > error = EINVAL; > break; > > Modified: head/sys/net/if_vlan_var.h > ============================================================================== > --- head/sys/net/if_vlan_var.h Mon Jun 6 09:30:31 2016 (r301495) > +++ head/sys/net/if_vlan_var.h Mon Jun 6 09:51:58 2016 (r301496) > @@ -73,6 +73,23 @@ struct vlanreq { > #define SIOCSETVLAN SIOCSIFGENERIC > #define SIOCGETVLAN SIOCGIFGENERIC > > +#define SIOCGVLANPCP _IOWR('i', 152, struct ifreq) /* Get VLAN PCP */ > +#define SIOCSVLANPCP _IOW('i', 153, struct ifreq) /* Set VLAN PCP */ > + > +/* > + * Names for 802.1q priorities ("802.1p"). Notice that in this scheme, > + * (0 < 1), allowing default 0-tagged traffic to take priority over background > + * tagged traffic. > + */ > +#define IEEE8021Q_PCP_BK 1 /* Background (lowest) */ > +#define IEEE8021Q_PCP_BE 0 /* Best effort (default) */ > +#define IEEE8021Q_PCP_EE 2 /* Excellent effort */ > +#define IEEE8021Q_PCP_CA 3 /* Critical applications */ > +#define IEEE8021Q_PCP_VI 4 /* Video, < 100ms latency */ > +#define IEEE8021Q_PCP_VO 5 /* Video, < 10ms latency */ > +#define IEEE8021Q_PCP_IC 6 /* Internetwork control */ > +#define IEEE8021Q_PCP_NC 7 /* Network control (highest) */ > + > #ifdef _KERNEL > /* > * Drivers that are capable of adding and removing the VLAN header > @@ -110,6 +127,16 @@ struct vlanreq { > * if_capabilities. > */ > > +/* > + * The 802.1q code may also tag mbufs with the PCP (priority) field for use in > + * other layers of the stack, in which case an m_tag will be used. This is > + * semantically quite different from use of the ether_vtag field, which is > + * defined only between the device driver and VLAN layer. > + */ > +#define MTAG_8021Q 1326104895 > +#define MTAG_8021Q_PCP_IN 0 /* Input priority. */ > +#define MTAG_8021Q_PCP_OUT 1 /* Output priority. */ > + > #define VLAN_CAPABILITIES(_ifp) do { \ > if ((_ifp)->if_vlantrunk != NULL) \ > (*vlan_trunk_cap_p)(_ifp); \ > > Modified: head/sys/sys/priv.h > ============================================================================== > --- head/sys/sys/priv.h Mon Jun 6 09:30:31 2016 (r301495) > +++ head/sys/sys/priv.h Mon Jun 6 09:51:58 2016 (r301496) > @@ -342,6 +342,7 @@ > #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ > #define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ > #define PRIV_NET_VXLAN 420 /* Administer vxlan. */ > +#define PRIV_NET_SETVLANPCP 421 /* Set VLAN priority. */ > > /* > * 802.11-related privileges. > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Mon Jun 6 16:58:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DE0EB6D2B4; Mon, 6 Jun 2016 16:58:23 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37F7A1FF1; Mon, 6 Jun 2016 16:58:23 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: by mail-oi0-x232.google.com with SMTP id p204so40113826oih.3; Mon, 06 Jun 2016 09:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=R0Hxekaxp3MCMg93BwRpV8cex7I+wnXrUBsY+wliC/Y=; b=E2gl/k4AL4ktuULTvV/9P10+Yt9AoTUhR1nAvkZQX15rWLYc/TvgWLbySVQVOn8ZqB 5emTz62T0n5W1WBE2yz8hmpkIke5cVJkTEz0fO7RgK/zaIPFYTQ7JY75fHY64k1pVhH6 CYjtJyqxkbutT4dZAdfvrwZAE8TO1xOG1figYgzv/LP4WDZkfMTAb1lPRuIbjwybs9gm v3TmtboKEMfT7PvHVVqkjlDtDqThtZpddT+zfzMxm/bq8rjEz4IQKudTcZl3iiYP7Nsn LjKTo89a2lCcO0mBxOLvrQZffP+ZClM0y+HPSGFDyfl8Ev5OuiFnq9LFOo4ADsME9vAd 4NIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=R0Hxekaxp3MCMg93BwRpV8cex7I+wnXrUBsY+wliC/Y=; b=j60BJvHMzioVXDRAqpTQuNJNglu2pZf6RMY9TLkgvNlUgap2n4S1eTsFd8Y76HCygd m9iems+zmsrwPqDLPPiwnrjQI0iDz62T8hqnSr1IzTDCh2T0Q1wjzNnPGp0UfBcdEsJP g0xpRJUkWnWgYkWn9TURPV8TbnQPhRBVoSZhVHW7R4eux8ezx3cfwNbMdPKyNli5I0e7 BcR/xdlLjOc/x2iuF1qG5WozpbRLKPw1X6b9nYxxQNlQDIHk0Tdn2Dbj+jWhyScxUbAm /6uRx5UVsCNd2gTr2oyf8CZbjxeS7/0Njq7EbMXmHMUCmQ9HFFv51I10/BNRLyzb5NjD TsKQ== X-Gm-Message-State: ALyK8tLdSmjBXuZgUmoEAFui2krcs3gSpMsFhYi2YuBON2j34W+pZaRHPL7Lq+64VlgIE08m4jpaEubPGKVoXg== X-Received: by 10.157.56.38 with SMTP id i35mr5589032otc.26.1465232302383; Mon, 06 Jun 2016 09:58:22 -0700 (PDT) MIME-Version: 1.0 Sender: tomelite82@gmail.com Received: by 10.182.86.35 with HTTP; Mon, 6 Jun 2016 09:58:21 -0700 (PDT) In-Reply-To: <3505271465193212@web29h.yandex.ru> References: <201606021751.u52HpTrH090384@repo.freebsd.org> <3448221465067132@web17h.yandex.ru> <3505271465193212@web29h.yandex.ru> From: Qing Li Date: Mon, 6 Jun 2016 09:58:21 -0700 X-Google-Sender-Auth: rbPTP-dd0H9_WLb8Z0snqsh43oA Message-ID: Subject: Re: svn commit: r301217 - in head/sys: net netinet netinet6 To: "Alexander V. Chernikov" Cc: George Neville-Neil , Mike Karels , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 16:58:23 -0000 On Sun, Jun 5, 2016 at 11:06 PM, Alexander V. Chernikov < melifaro@freebsd.org> wrote: > 06.06.2016, 04:40, "George Neville-Neil" : > > On 4 Jun 2016, at 15:05, Alexander V. Chernikov wrote: > > > >> 02.06.2016, 20:51, "George V. Neville-Neil" : > >>> Author: gnn > >>> Date: Thu Jun 2 17:51:29 2016 > >>> New Revision: 301217 > >>> URL: https://svnweb.freebsd.org/changeset/base/301217 > >>> > >>> Log: > >>> This change re-adds L2 caching for TCP and UDP, as originally > >>> added in D4306 > >>> but removed due to other changes in the system. Restore the > >>> llentry pointer > >>> to the "struct route", and use it to cache the L2 lookup (ARP or > >>> ND6) as > >>> appropriate. > >> > >> I have several comments regarding this commit. > >> > >> 1 Architecturally, there was quite a lot of efforts to eliminate > >> layering violation between lltable and other places in network stack. > >> It ended by committing D4102, which allowed both to cleanup lower > >> level, provide abstract =E2=80=9Cprepend=E2=80=9D framework which cou= ld be used to > >> provide cached data to _otuput() functions. > >> This change brings these violations back in a really invasive way. > >> > >> Additionally, implementing L2 PCB caching at the other subsystem > >> expense is really a bad idea. > >> If one wants caching in some subsystem, it should be implemented in > >> that subsystem not polluting other things. > >> Current implementation permits this by filling in =E2=80=9Cro_prepend= =E2=80=9D / > >> ro_plen fields. > >> > >> In general, this change looks more like a local hack and not like the > >> code that should be included in the tree. > >> > >> 2 There was no benchmarks proving the effectiveness of this change. > >> (For example, it is not obvious if it could significantly improve TCP > >> since we still have per-session TCP wlock + (typically) per-ring > >> mutex, so removing lltable rock might not help things here). Given > >> that the patch complicates existing code, there should be adequate > >> benefits to consider whether this change is worth implementing. > >> > >> 3 The =E2=80=9Cnetwork=E2=80=9D group was not included to the review = despite the > >> fact that most of the changes were related to the L2 layer which is > >> not =E2=80=9Ctransport=E2=80=9D, so some people might have missed thi= s review. > >> > >> 4 This change DOES NOT WORK. really. > >> (which raises questions on both review and benchmarking process). > >> > >> The reason is that =E2=80=9Cplle=E2=80=9D argument is filled only in = =E2=80=9Cheavy=E2=80=9D > >> lltable lookup functions (e.g. when we don=E2=80=99t have neighbour > >> adjacency). 99.9% of the time arpresolve/nd6_resolve() returns the > >> result w/o calling their heavy versions, and the returned =E2=80=9Cpl= le=E2=80=9D > >> is NULL. > >> > >> This can be easily verified by calling something like > >> dtrace -n 'fbt:kernel:ether_output:entry /arg3!=3DNULL&&((struct rout= e > >> *)arg3)->ro_lle !=3D NULL/ { stack(); }' > >> > >> Given that, I kindly ask you to backout this change. > > > > Hi, > > > > I'm going to limit the scope of this reply to just you, me and Mike > > Karels, from whom this originated. > No, please keep the discussion open. The decision on having that > particular L2 caching implementation (and L2 caching in general) is quite > important, so it would be great if all technical arguments were saved so > other people can (now or later) understand the decision details. > > Thanks for understanding. > > > > Best, > > George > > This commit does seem to undo the non-trivial layer separation efforts invested previously. The flow-table construction was meant to help accelerate TCP/UDP route lookups. The various aspects of the routing code took flow-table into consideration, and those code are still present even after this change. --Qing From owner-svn-src-all@freebsd.org Mon Jun 6 17:00:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84387B6D33F for ; Mon, 6 Jun 2016 17:00:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0397B11BD for ; Mon, 6 Jun 2016 17:00:17 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 21d12382-2c08-11e6-ac92-3142cfe117f2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.eu.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 6 Jun 2016 17:00:11 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u56H04hm006425; Mon, 6 Jun 2016 11:00:04 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1465232404.1188.5.camel@freebsd.org> Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... From: Ian Lepore To: lidl@FreeBSD.org, Matteo Riondato Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 06 Jun 2016 11:00:04 -0600 In-Reply-To: <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:00:18 -0000 On Mon, 2016-06-06 at 12:38 -0400, Kurt Lidl wrote: > On 6/5/16 2:39 PM, Matteo Riondato wrote: > > > > > On Jun 2, 2016, at 3:06 PM, Kurt Lidl wrote: > > > > > > Author: lidl > > > Date: Thu Jun 2 19:06:04 2016 > > > New Revision: 301226 > > > URL: https://svnweb.freebsd.org/changeset/base/301226 > > > > > > Log: > > > Add basic blacklist build support > > > > > [snip] > > > Modified: head/etc/defaults/rc.conf > > > ================================================================= > > > ============= > > > --- head/etc/defaults/rc.conf Thu Jun 2 18:41:33 2016 > > > (r301225) > > > +++ head/etc/defaults/rc.conf Thu Jun 2 19:06:04 2016 > > > (r301226) > > > @@ -270,6 +270,8 @@ hastd_program="/sbin/hastd" # path to > > > ha > > > hastd_flags="" # Optional flags to hastd. > > > ctld_enable="NO" # CAM Target Layer / iSCSI target > > > daemon. > > > local_unbound_enable="NO" # local caching resolver > > > +blacklistd_enable="YES" # Run blacklistd daemon > > > (YES/NO). > > > +blacklistd_flags="" # Optional flags for > > > blacklistd(8). > > > > What is the rationale for having this enabled by default? > > Well, from a certain standpoint, it will encourage more people to > enable > the packet filtering it in their pf.conf and get the benefit of > having > a system-wide blacklist notification system running. > > Without a one-line change to enable the blocking in the pf.conf file, > it won't do any blocking. > > > Is any of the services that use it (in their default config) > > enabled by default? > > I suppose, technically speaking, no there are no daemons with > blacklist > support enabled by default. I am planning to commit the sshd support > tomorrow morning, and even *that* daemon isn't enabled by default. > > I am happy enough to turn off the blacklist daemon by default. You > are > the first person to question this since I posted the review back near > the beginning of April. > > -Kurt Probably everyone assumed (like I did) that it would be disabled by default, and didn't notice that wasn't the case. Your response indicates the problem with "default enabled"... you mention enabling packet filtering in pf.conf, my response is: WTF is pf.conf and why are you assuming I do any kind of packet filtering? I have literally dozens of systems here running freebsd, only one of them runs ipfw, and most of them are systems with small memory and wimpy processors, so why would I want extra do-nothing network daemons running on them by default? -- Ian From owner-svn-src-all@freebsd.org Mon Jun 6 17:01:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02424B6D4FF; Mon, 6 Jun 2016 17:01:37 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7AFD168C; Mon, 6 Jun 2016 17:01:36 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56H1agG025894; Mon, 6 Jun 2016 17:01:36 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56H1aG5025893; Mon, 6 Jun 2016 17:01:36 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606061701.u56H1aG5025893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Mon, 6 Jun 2016 17:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301515 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:01:37 -0000 Author: lidl Date: Mon Jun 6 17:01:35 2016 New Revision: 301515 URL: https://svnweb.freebsd.org/changeset/base/301515 Log: Turn off blacklistd daemon in defaults Reported by: Matteo Riondato ( matteo @ FreeBSD.org ) Reviewed by: rpaulo Approved by: rpaulo Relnotes: YES Sponsored by: The FreeBSD Foundation Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Jun 6 16:23:02 2016 (r301514) +++ head/etc/defaults/rc.conf Mon Jun 6 17:01:35 2016 (r301515) @@ -270,7 +270,7 @@ hastd_program="/sbin/hastd" # path to ha hastd_flags="" # Optional flags to hastd. ctld_enable="NO" # CAM Target Layer / iSCSI target daemon. local_unbound_enable="NO" # local caching resolver -blacklistd_enable="YES" # Run blacklistd daemon (YES/NO). +blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). blacklistd_flags="" # Optional flags for blacklistd(8). # From owner-svn-src-all@freebsd.org Mon Jun 6 17:04:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACEDFB6D744; Mon, 6 Jun 2016 17:04:24 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 673401A1B; Mon, 6 Jun 2016 17:04:24 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by mail-qg0-x22a.google.com with SMTP id 93so45428056qgx.2; Mon, 06 Jun 2016 10:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:from:in-reply-to:date:cc:message-id :references:to; bh=JiF0KnxqDg8cWHHq0elZXsAPcZAVUsT/Zhfsut/wac8=; b=G1Oo8bYnqY2BKSn4IjkR9XOj6fUOehCHYwwsh7/jQBIVu6pEJ8EH4lwl85tAN0oHUE XlPaj/6dxJMU5xB0CKe7jF/TmoQSZvGiAuzibKAu0akSExO9P2lPZvmBR7vdMZbvSMFS EQj7TG1/VC1lV5l1S4ivO83vDHJdVfA3eDKHVYAjRkzv2R8eBM6bCubJ7X9HiZBR3cUs ke96zpmruCXWAvUJ20j5WstzgFYEzV9Epj5riD/2nfLbLQV83lp5r3aTi7WeziuZ4VKS gmUnwFLCyEnKXdCRzajA5QWDFZIUZydmEDdOQ2rGBtiz6UhEcvDPKG1NdLbw22DQQEWC L9fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:from:in-reply-to :date:cc:message-id:references:to; bh=JiF0KnxqDg8cWHHq0elZXsAPcZAVUsT/Zhfsut/wac8=; b=O2pIFEULSSU6Bwn63nSP+JKQJw+s8gNxo5PlhRDUU1H4xdwbIoEbKf4EhJoRQ671FN G89R9bHul/f7NDgcTuFWz4Ew58kiNxInH3ySojJkpmzIvREzXOV3/JGarNDle08R7cYV hOvB/ofgzzayZShigFRRkMin6eKRZMWwcfu9ofpdFNi2+4CIChe3AKqLb0ekl+dYTmXw S1JQsC4bKyJbWZwc4rPyeTEheKLl6ha5IC+DkaYXaQWXLD7rpDQbKChXMwc4YcTJPSf1 mUZTwaq5bFCoX0eofydX3ws3HvAXETzBAB4oaO61OGsE/xLC5bKmRpYHgSmaBFHJ3XhR 6n7Q== X-Gm-Message-State: ALyK8tKB5Gzo63HPDwgHzR2U/f6qr2nMSZ8H/sTJUu8ndodX8PfVdqSUDhIe6Vn6YACDsQ== X-Received: by 10.140.166.3 with SMTP id m3mr16969571qhm.100.1465232663500; Mon, 06 Jun 2016 10:04:23 -0700 (PDT) Received: from [172.31.22.154] (gzac12-mdf2-1.aoa.twosigma.com. [208.77.215.155]) by smtp.gmail.com with ESMTPSA id x107sm5417216qgx.6.2016.06.06.10.04.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 10:04:22 -0700 (PDT) Sender: Matteo Riondato Subject: Re: svn commit: r301515 - head/etc/defaults Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_99CA0085-68C3-45D5-943F-75BA91A49966"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Pgp-Agent: GPGMail 2.6b2 From: Matteo Riondato In-Reply-To: <201606061701.u56H1aG5025893@repo.freebsd.org> Date: Mon, 6 Jun 2016 13:04:21 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201606061701.u56H1aG5025893@repo.freebsd.org> To: Kurt Lidl X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:04:24 -0000 --Apple-Mail=_99CA0085-68C3-45D5-943F-75BA91A49966 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jun 6, 2016, at 1:01 PM, Kurt Lidl wrote: > > Author: lidl > Date: Mon Jun 6 17:01:35 2016 > New Revision: 301515 > URL: https://svnweb.freebsd.org/changeset/base/301515 > > Log: > Turn off blacklistd daemon in defaults Thanks, Matteo --Apple-Mail=_99CA0085-68C3-45D5-943F-75BA91A49966 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJXVa0VAAoJEJ/Xw+PLA1GfzMkQAI/8Cz/8r3RJONxlz+qvWqa4 r49rIkUHXSit+6SAzqQKlKyEgN77uJ6QcvdlESWUGeZ9V3tHj8kh3sYHo6bBfgtd IPaczYkPFnQoE1aIM6offqTdAwEgmTu9aOEF3Trd+jxlMSk067HTGeWiwB+G39jK xRfxp3UZ49qo6irUhBRB6zO+UBXre01Up5QTI+Sm4tdszbhb73nANEJWLkLsy9ar 5JZwpolvskJI1cs3UIduHXml+M72YN3adzFwVMFm/3H4rGRFr+oTgd0lMRv/xgzP r+ukKgHmdap8pb23COzEuzz6pwX1AJRUyoUyqTaUh7mocQOOOAdIgOKqpasiErQy 19Zv1jW/Q8VVoxI6i/Xkjat5J1snWTyGj9YYwRIcdmh4V8sPELiqDi/N1nqqjVYc EouZsuNQpkM2bm3FVKV5SSPWBq372imWeO2Tq1G34lK5FjWI6FOfPPi2X37Vvy/q 9EWWr7sQHNL7oGXJBZFsWjp0DXqDfTMDfnB7QLchmxrHMSZJC2ixN7WJsZSawZVq ahi/NXLAPLTe8B3eIVTHFACe1rAPfrJFkhlW84cFThGuh91G7Prv+G0sbAxIq5Zq oB2GKD1cl/d52FWXUzO9GPDZjju9yBARxNCNuDwJsa9lyXw3c5M9GZBlpFdlxS03 wnz3ahwGobGQLlE9Ygol =d9zR -----END PGP SIGNATURE----- --Apple-Mail=_99CA0085-68C3-45D5-943F-75BA91A49966-- From owner-svn-src-all@freebsd.org Mon Jun 6 17:06:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DB82B6D816 for ; Mon, 6 Jun 2016 17:06:39 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA7821C0C for ; Mon, 6 Jun 2016 17:06:38 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f46.google.com with SMTP id s64so98916436lfe.0 for ; Mon, 06 Jun 2016 10:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=aiThh3IgYt7zw8DRHreJ8b24E4ujvzOHfcvlHRYkNlk=; b=MDn4krqigC6opkJEmRyc5XedZOKEklX4KYUVOFVIKsQr7B0QsHiF7NxKvvKInVw97v PyZ8mBsQOoFLWxl0hGn1pRn52ShuGbxeecBwQUBTOpeT0bf1/jKTb5MML4V3GSs+sfWF xk7CAmwlNQ7Th2PlDWhbC1zYq2gEzYYF723fxJle2NH2yJdGHggppbLt9dmAlOSZvUuj HNzT/5vTKtaprsz4nOWf4v5cTlTJHBndw3ItJHqeVd/crT5TlxPlbQGjdPyN7wmHOZwK Gn/TZbtohnlg/Q0Fs0pOfbASclpBoi4K/k1QBClhxuerF4PJpC3eQlvpCj4y5SZWXN+j ftWg== X-Gm-Message-State: ALyK8tIW4LsbzCIKM7Rl/P6/Zf5z7VZsuiRTYa5Tp/0+QMdWhO07QmDjIMkdnPsMcZ4MoQ== X-Received: by 10.25.206.147 with SMTP id e141mr1346769lfg.138.1465232791472; Mon, 06 Jun 2016 10:06:31 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id m8sm1969157lfe.15.2016.06.06.10.06.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 10:06:30 -0700 (PDT) Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... To: Ian Lepore , lidl@FreeBSD.org, Matteo Riondato References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> Date: Mon, 6 Jun 2016 20:06:30 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1465232404.1188.5.camel@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:06:39 -0000 On 06.06.2016 20:00, Ian Lepore wrote: > Probably everyone assumed (like I did) that it would be disabled by > default, and didn't notice that wasn't the case. Your response > indicates the problem with "default enabled"... you mention enabling > packet filtering in pf.conf, my response is: WTF is pf.conf and why > are you assuming I do any kind of packet filtering? > > I have literally dozens of systems here running freebsd, only one of > them runs ipfw, and most of them are systems with small memory and > wimpy processors, so why would I want extra do-nothing network daemons > running on them by default? As variant, I keep hope blacklist sh helper will teach about ipfw soon, it looks possible. Then it can be re-enabled by default. From owner-svn-src-all@freebsd.org Mon Jun 6 17:22:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E73B6DCDE for ; Mon, 6 Jun 2016 17:22:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA6501797 for ; Mon, 6 Jun 2016 17:22:51 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 4cc98b95-2c0b-11e6-ac92-3142cfe117f2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.eu.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 6 Jun 2016 17:22:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u56HMivE006457; Mon, 6 Jun 2016 11:22:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1465233764.1188.9.camel@freebsd.org> Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... From: Ian Lepore To: Andrey Chernov , lidl@FreeBSD.org, Matteo Riondato Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 06 Jun 2016 11:22:44 -0600 In-Reply-To: <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:22:52 -0000 On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote: > On 06.06.2016 20:00, Ian Lepore wrote: > > Probably everyone assumed (like I did) that it would be disabled by > > default, and didn't notice that wasn't the case. Your response > > indicates the problem with "default enabled"... you mention > > enabling > > packet filtering in pf.conf, my response is: WTF is pf.conf and > > why > > are you assuming I do any kind of packet filtering? > > > > I have literally dozens of systems here running freebsd, only one > > of > > them runs ipfw, and most of them are systems with small memory and > > wimpy processors, so why would I want extra do-nothing network > > daemons > > running on them by default? > > As variant, I keep hope blacklist sh helper will teach about ipfw > soon, > it looks possible. Then it can be re-enabled by default. No, it should still not be enabled by default. Maybe it should be enabled in response to some question in the installer, or maybe even better, enabled only if some firewall software that understands it is also enabled. But afaik, all the available firewalls are disabled by default in defaults/rc.conf, and this should be too. -- Ian From owner-svn-src-all@freebsd.org Mon Jun 6 17:24:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11E96B6DD68; Mon, 6 Jun 2016 17:24:15 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies, LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D1C1719D2; Mon, 6 Jun 2016 17:24:14 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from torb.pix.net (torb.pix.net [192.168.16.32]) (authenticated bits=0) by hydra.pix.net (8.15.2/8.15.2) with ESMTPA id u56HOD7N065872; Mon, 6 Jun 2016 13:24:13 -0400 (EDT) (envelope-from lidl@FreeBSD.org) Reply-To: lidl@FreeBSD.org Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> To: Ian Lepore , Andrey Chernov , Matteo Riondato Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kurt Lidl Message-ID: <6e7969d9-47e2-cf79-907a-4a67c1a5b019@FreeBSD.org> Date: Mon, 6 Jun 2016 13:24:13 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1465233764.1188.9.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:24:15 -0000 On 6/6/16 1:22 PM, Ian Lepore wrote: > No, it should still not be enabled by default. Maybe it should be > enabled in response to some question in the installer, or maybe even > better, enabled only if some firewall software that understands it is > also enabled. But afaik, all the available firewalls are disabled by > default in defaults/rc.conf, and this should be too. I have already committed a change to turn it off by default. -Kurt From owner-svn-src-all@freebsd.org Mon Jun 6 17:25:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FBDB6DDCB for ; Mon, 6 Jun 2016 17:25:05 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 894081B5E for ; Mon, 6 Jun 2016 17:25:04 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id w16so99051745lfd.2 for ; Mon, 06 Jun 2016 10:25:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=wCFoE9UQB3b4Proop3jetUqMH+Os1VYRsTtAKMUnlfI=; b=XPmTAi7X/J+zzeXVMZJ/Tgty57eaRDVMkcePLLQeVbTmfz7ZNvbhbSKmOrDTrcm0KU 8Xsa7f5oUtn32WGVTTmk/7guSDI+6tqCHIEDEM7tWKC/7tFUWKjMDIiFN2YMVbbqTJ8w /UMoIO6yOnYqyWOdDrVDIBpSQ1R+p7sqT2Vje2lIy9qBDUDZrEujd20eJnsov8CxCt1Y RdKL+cf1so8Ks0UbUpq9xrkxq91V/kflfgdyBELKyzG5Tu9L/KAx1UkGiIL14Bh76ywM 6UfxefTPJvQ6XzJkK/Df/JnQ9O8V9Fex/hj1TZp9uTRisRiQBE/KqjqwcXeXBnjCEe6c EIgQ== X-Gm-Message-State: ALyK8tKZN7+RyH+sWgwq1UcbYx0ugnPSUQJ7D2S/ZjYA3FBfBcFBpYFK1A+r0pQWUQ93DA== X-Received: by 10.25.22.170 with SMTP id 42mr1377392lfw.117.1465233902388; Mon, 06 Jun 2016 10:25:02 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id o184sm355610lfo.44.2016.06.06.10.25.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 10:25:01 -0700 (PDT) Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... To: Ian Lepore , lidl@FreeBSD.org, Matteo Riondato References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Mon, 6 Jun 2016 20:25:01 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1465233764.1188.9.camel@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:25:05 -0000 On 06.06.2016 20:22, Ian Lepore wrote: > On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote: >> As variant, I keep hope blacklist sh helper will teach about ipfw >> soon, >> it looks possible. Then it can be re-enabled by default. > > No, it should still not be enabled by default. Maybe it should be > enabled in response to some question in the installer, or maybe even > better, enabled only if some firewall software that understands it is > also enabled. But afaik, all the available firewalls are disabled by > default in defaults/rc.conf, and this should be too. BTW, it is good idea: to check first, is supported firewall enabled, and only then enable blacklistd by default. From owner-svn-src-all@freebsd.org Mon Jun 6 17:25:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2C97B6DE31 for ; Mon, 6 Jun 2016 17:25:22 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17B6E1CF0 for ; Mon, 6 Jun 2016 17:25:21 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a67e3eed-2c0b-11e6-ac92-3142cfe117f2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.eu.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 6 Jun 2016 17:25:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u56HPF32006476; Mon, 6 Jun 2016 11:25:15 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1465233915.1188.10.camel@freebsd.org> Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... From: Ian Lepore To: lidl@FreeBSD.org, Andrey Chernov , Matteo Riondato Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 06 Jun 2016 11:25:15 -0600 In-Reply-To: <6e7969d9-47e2-cf79-907a-4a67c1a5b019@FreeBSD.org> References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> <6e7969d9-47e2-cf79-907a-4a67c1a5b019@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:25:22 -0000 On Mon, 2016-06-06 at 13:24 -0400, Kurt Lidl wrote: > On 6/6/16 1:22 PM, Ian Lepore wrote: > > No, it should still not be enabled by default. Maybe it should be > > enabled in response to some question in the installer, or maybe > > even > > better, enabled only if some firewall software that understands it > > is > > also enabled. But afaik, all the available firewalls are disabled > > by > > default in defaults/rc.conf, and this should be too. > > I have already committed a change to turn it off by default. > > -Kurt > Yeah, I saw that, thanks. I was just repsonding to the notion that it should be re-enabled by default some day. -- Ian From owner-svn-src-all@freebsd.org Mon Jun 6 17:32:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D99BB6D03C; Mon, 6 Jun 2016 17:32:12 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67AE91121; Mon, 6 Jun 2016 17:32:12 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: Content-Transfer-Encoding:Content-Type:MIME-Version:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qWtW/4NPR689GYX7fI9k1VxrXbLI2FgWiOHYQTfRjEI=; b=tHaiqM0+f6BjbpQJjypsx3LNEb KNy3HjIJ3MVFrNND/fmF+Tq/E834t/v9AVopDjuHuqTGV1+ZMM7e3ujquOl/VEEVFeniVH/aXpaoM 1v1s52j7QyijX+u4qf0ioOG77XdJzpz+TPeQhPoOloK2Aelfy6aPVgclRv5nHoUk6q2U=; Received: from thebighonker.lerctr.org ([2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]:64330 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1b9yNn-000N4Q-9K; Mon, 06 Jun 2016 12:32:11 -0500 Received: from proxy.na.alcatel-lucent.com ([135.245.48.71]) by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Mon, 06 Jun 2016 12:32:11 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 06 Jun 2016 12:32:11 -0500 From: Larry Rosenman To: Ian Lepore Cc: lidl@freebsd.org, Andrey Chernov , Matteo Riondato , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-svn-src-all@freebsd.org Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... In-Reply-To: <1465233915.1188.10.camel@freebsd.org> References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> <6e7969d9-47e2-cf79-907a-4a67c1a5b019@FreeBSD.org> <1465233915.1188.10.camel@freebsd.org> Message-ID: <3347bd4e6b46a796a848128b8898bc6f@thebighonker.lerctr.org> X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/1.1.5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:32:12 -0000 On 2016-06-06 12:25, Ian Lepore wrote: > On Mon, 2016-06-06 at 13:24 -0400, Kurt Lidl wrote: >> On 6/6/16 1:22 PM, Ian Lepore wrote: >> > No, it should still not be enabled by default. Maybe it should be >> > enabled in response to some question in the installer, or maybe >> > even >> > better, enabled only if some firewall software that understands it >> > is >> > also enabled. But afaik, all the available firewalls are disabled >> > by >> > default in defaults/rc.conf, and this should be too. >> >> I have already committed a change to turn it off by default. >> >> -Kurt >> > > Yeah, I saw that, thanks. I was just repsonding to the notion that it > should be re-enabled by default some day. > > -- Ian > as an example adding to Ian, my Firewall is a pfSense box NOT on the same physical box. I do NOT need nor want blacklistd running, as NOTHING local can be done. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281 From owner-svn-src-all@freebsd.org Mon Jun 6 17:50:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F24EB6D288; Mon, 6 Jun 2016 17:50:22 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5ED618CE; Mon, 6 Jun 2016 17:50:21 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from aurora.physics.berkeley.edu (aurora.physics.berkeley.edu [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u56HoEfo024566 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 6 Jun 2016 10:50:14 -0700 Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... To: Andrey Chernov , Ian Lepore , lidl@freebsd.org, Matteo Riondato References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: Date: Mon, 6 Jun 2016 10:50:14 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZVU4Aac47XoTcThYsjHxiSHDZlmPWFPwQsM3LjoWVgtf0eezmA8VzrBmSgQ/U2AI+KsXjNRtFcNUt7UIXevhBP9jlgy79GAWc= X-Sonic-ID: C;IDuPHw8s5hGkBbsdzAjavA== M;5Fq6Hw8s5hGkBbsdzAjavA== X-Spam-Flag: No X-Sonic-Spam-Details: 2.5/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:50:22 -0000 On 06/06/16 10:25, Andrey Chernov wrote: > On 06.06.2016 20:22, Ian Lepore wrote: >> On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote: >>> As variant, I keep hope blacklist sh helper will teach about ipfw >>> soon, >>> it looks possible. Then it can be re-enabled by default. >> No, it should still not be enabled by default. Maybe it should be >> enabled in response to some question in the installer, or maybe even >> better, enabled only if some firewall software that understands it is >> also enabled. But afaik, all the available firewalls are disabled by >> default in defaults/rc.conf, and this should be too. > BTW, it is good idea: to check first, is supported firewall enabled, and > only then enable blacklistd by default. > > Like many others, I think it shouldn't be enabled by default ever, even though it is a useful thing and a service that should be in the small checklist in the installer. FreeBSD has *no* daemons enabled by default except devd and a local sendmail and, since this particular feature is one that many people don't want, this is the wrong time for an expansion of that list. (Thanks for adding this to the system, though, and thanks for changing the setting!) -Nathan From owner-svn-src-all@freebsd.org Mon Jun 6 17:52:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19AD3B6D3A2; Mon, 6 Jun 2016 17:52:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE0E01CB2; Mon, 6 Jun 2016 17:52:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1b9yhW-0005Wl-Gt; Mon, 06 Jun 2016 20:52:34 +0300 Date: Mon, 6 Jun 2016 20:52:34 +0300 From: Slawa Olhovchenkov To: Andrey Chernov Cc: Ian Lepore , lidl@FreeBSD.org, Matteo Riondato , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... Message-ID: <20160606175234.GG75625@zxy.spb.ru> References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 17:52:38 -0000 On Mon, Jun 06, 2016 at 08:25:01PM +0300, Andrey Chernov wrote: > On 06.06.2016 20:22, Ian Lepore wrote: > > On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote: > >> As variant, I keep hope blacklist sh helper will teach about ipfw > >> soon, > >> it looks possible. Then it can be re-enabled by default. > > > > No, it should still not be enabled by default. Maybe it should be > > enabled in response to some question in the installer, or maybe even > > better, enabled only if some firewall software that understands it is > > also enabled. But afaik, all the available firewalls are disabled by > > default in defaults/rc.conf, and this should be too. > > BTW, it is good idea: to check first, is supported firewall enabled, and > only then enable blacklistd by default. What purpose? SUDDENLY lockout access to own host after some mistake in password? I am already touch issuse with default enforcing DNSSEC in unbound and broken date in CMOS -- inposible to do any DNS queries and imposible to automatic time sync. From owner-svn-src-all@freebsd.org Mon Jun 6 18:03:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE26EB6D60A; Mon, 6 Jun 2016 18:03:34 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id BEA77139B; Mon, 6 Jun 2016 18:03:34 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id CF694D374; Mon, 6 Jun 2016 18:03:32 +0000 (UTC) Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... To: Nathan Whitehorn , lidl@freebsd.org References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: Date: Mon, 6 Jun 2016 14:03:32 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 18:03:35 -0000 On 2016-06-06 13:50, Nathan Whitehorn wrote: > > > On 06/06/16 10:25, Andrey Chernov wrote: >> On 06.06.2016 20:22, Ian Lepore wrote: >>> On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote: >>>> As variant, I keep hope blacklist sh helper will teach about ipfw >>>> soon, >>>> it looks possible. Then it can be re-enabled by default. >>> No, it should still not be enabled by default. Maybe it should be >>> enabled in response to some question in the installer, or maybe even >>> better, enabled only if some firewall software that understands it is >>> also enabled. But afaik, all the available firewalls are disabled by >>> default in defaults/rc.conf, and this should be too. >> BTW, it is good idea: to check first, is supported firewall enabled, and >> only then enable blacklistd by default. >> >> > > Like many others, I think it shouldn't be enabled by default ever, even > though it is a useful thing and a service that should be in the small > checklist in the installer. FreeBSD has *no* daemons enabled by default > except devd and a local sendmail and, since this particular feature is > one that many people don't want, this is the wrong time for an expansion > of that list. > > (Thanks for adding this to the system, though, and thanks for changing > the setting!) > -Nathan > I will add it to the list of services in the installer @ BSDCan. -- Allan Jude From owner-svn-src-all@freebsd.org Mon Jun 6 18:45:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52188B6D17F; Mon, 6 Jun 2016 18:45:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3BA1DED; Mon, 6 Jun 2016 18:45:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56Ij959065142; Mon, 6 Jun 2016 18:45:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56Ij9nh065141; Mon, 6 Jun 2016 18:45:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606061845.u56Ij9nh065141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Jun 2016 18:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301516 - head/tools/tools/cxgbetool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 18:45:10 -0000 Author: np Date: Mon Jun 6 18:45:09 2016 New Revision: 301516 URL: https://svnweb.freebsd.org/changeset/base/301516 Log: cxgbetool: Allow max-rate > 10Gbps for rate-limited traffic. Sponsored by: Chelsio Communications Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Mon Jun 6 17:01:35 2016 (r301515) +++ head/tools/tools/cxgbetool/cxgbetool.c Mon Jun 6 18:45:09 2016 (r301516) @@ -2526,9 +2526,9 @@ sched_class(int argc, const char *argv[] errs++; } if (op.u.params.ratemode == SCHED_CLASS_RATEMODE_ABS && - !in_range(op.u.params.maxrate, 1, 10000000)) { + !in_range(op.u.params.maxrate, 1, 100000000)) { warnx("sched params \"max-rate\" takes " - "value(1-10000000) for rate-mode absolute"); + "value(1-100000000) for rate-mode absolute"); errs++; } if (op.u.params.maxrate > 0 && From owner-svn-src-all@freebsd.org Mon Jun 6 19:11:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B291AB6D677; Mon, 6 Jun 2016 19:11:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8361AF6; Mon, 6 Jun 2016 19:11:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5B94AB9B0; Mon, 6 Jun 2016 15:02:48 -0400 (EDT) From: John Baldwin To: Svatopluk Kraus Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301451 - in head/sys: kern sys Date: Mon, 06 Jun 2016 11:47:19 -0700 Message-ID: <3626355.rfEWHPgmKy@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201606051607.u55G7vUg062390@repo.freebsd.org> References: <201606051607.u55G7vUg062390@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Jun 2016 15:02:48 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 19:11:46 -0000 On Sunday, June 05, 2016 04:07:57 PM Svatopluk Kraus wrote: > Author: skra > Date: Sun Jun 5 16:07:57 2016 > New Revision: 301451 > URL: https://svnweb.freebsd.org/changeset/base/301451 > > Log: > (1) Add a new bus method to get a mapping data for an interrupt. > > BUS_MAP_INTR() is used to get an interrupt mapping data according > to provided hints. The hints could be modified afterwards, but only > if mapping data was allocated. This method is intended to be called > before BUS_ALLOC_RESOURCE(). > > An interrupt mapping data describes an interrupt - hardware number, > type, configuration, cpu binding, and whatever is needed to setup it. > > (2) Introduce a method which allows storing of an additional data > in struct resource to be available for bus drivers. This method is > convenient in two ways: > - there is no need to rework existing bus drivers as they can simply > be extended to provide an additional data, > - there is no need to modify any existing bus methods as struct > resource is already passed to them as argument and thus stored data > is simply accessible by other bus drivers. > For now, implement this method only for INTRNG. > > This is motivated by needs of modern SOCs where hardware initialization > is not straightforward and resources descriptions are complex, opaque > for everyone but provider, and may vary from SOC to SOC. Typical > situation is that one bus driver can fetch a resource description for > its child device, but it's opaque for this driver. Another bus driver > knows a provider for this kind of resource and can pass this resource > description to it. In fact, something like device IVARS would be > perfect for that if implemented generally enough. Unfortunatelly, IVARS > are usable only by their owners now. Only owner knows its IVARS layout, > thus other bus drivers are not able to use them. > > Differential Revision: https://reviews.freebsd.org/D6632 Does anything need to query this data besides the "nexus" or similar driver at the top of bus_alloc_resource()? If so, I'd much rather do this by having an optional args structure passed to bus_alloc_resource that is extensible ala make_dev_s() and bus_map_resource(). Previously I had mentioned passing this as part of bus_setup_intr() rather than bus_alloc_resource(), but it would actually work better for ACPI if we did it for bus_alloc_resource() instead. I guess my question is do you need access to this beyond the lifetime of the call to bus_alloc_resource(). On x86 for example the state that would needed to be passed up from ACPI (currently via bus_config_intr()) is stored in the interrupt source structure, so it doesn't need to be attached to the resource directly, it just needs to be passed up with it so it can be saved in the interrupt source structure. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jun 6 19:11:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6004B6D678; Mon, 6 Jun 2016 19:11:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8811AF7; Mon, 6 Jun 2016 19:11:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CE486B9B8; Mon, 6 Jun 2016 15:02:49 -0400 (EDT) From: John Baldwin To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301418 - head/sys/dev/acpica Date: Mon, 06 Jun 2016 11:40:13 -0700 Message-ID: <8356745.ppeTABNDIP@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201606050202.u5522pKu051460@repo.freebsd.org> References: <201606050202.u5522pKu051460@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Jun 2016 15:02:49 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 19:11:46 -0000 On Sunday, June 05, 2016 02:02:51 AM Adrian Chadd wrote: > Author: adrian > Date: Sun Jun 5 02:02:51 2016 > New Revision: 301418 > URL: https://svnweb.freebsd.org/changeset/base/301418 > > Log: > [acpi] graphics drivers want access to acpi lid handle > > the graphics drivers can benefit from access to the lid handle for querying and getting notifications > > Submitted by: kmacy > Differential Revision: https://reviews.freebsd.org/D6643 One could have done this without exposing a global variable: device_t dev; dev = devclass_get_device(devclass_find("acpi_lid"), 0); handle = acpi_get_handle(dev); Alternatively, we could provide a function locate an ACPI handle by _HID similar to pci_get_class(). -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jun 6 19:26:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B72DCB6DC67 for ; Mon, 6 Jun 2016 19:26:11 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE26167C for ; Mon, 6 Jun 2016 19:26:11 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f49.google.com with SMTP id j198so647612lfe.2 for ; Mon, 06 Jun 2016 12:26:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=OGd6+9APxTqbEwVPde8TV/n5AhswlqKFG2VUTrAe5es=; b=US+SwumRDXe705Z1mIlbjpmx/a28zr1JT3L9bVHGJ1MbotRgGGg5cgg9m3scr6pvCs 6WjJIyPF6XciFGNYNA0U9yed73r9H01vdB5Trp/hqyOxnWxGslBq3lZH9/K5C4CWzKm2 0Mre/JuHeQ66CKom3fNGeZJxNQd7YTVTUOVDjW/HrprpGH8CBXNTc1xpKKq/zQ3D+ctU pLMo2PQjcq7aeAWpZzf3Hrmb5XIakMCiScQP+dUub2lJnHD5mlY9WmE7MvTvnEddU7MH 76iw25LGfLggNg1olSrjJYI+6WIRd2hW7rU9XwcWNe9h6DefY2WRyUIUp/oWEtDdB8lP sjRw== X-Gm-Message-State: ALyK8tKNz+le+oWijO720gBWqH7B2xvxoedMYs1PcZ5zvZ+0+QV4O/tVPH3tgZfo0Ltelg== X-Received: by 10.25.89.68 with SMTP id n65mr1919248lfb.29.1465241169418; Mon, 06 Jun 2016 12:26:09 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id y5sm1917090lba.17.2016.06.06.12.26.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 12:26:08 -0700 (PDT) Subject: Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbin... To: Slawa Olhovchenkov References: <201606021906.u52J649H019481@repo.freebsd.org> <90df7c5b-7680-3de0-68ba-ab9bd1c9d73e@FreeBSD.org> <1465232404.1188.5.camel@freebsd.org> <9aafd3b8-ebe2-5ac8-e91b-31ffed34eff1@freebsd.org> <1465233764.1188.9.camel@freebsd.org> <20160606175234.GG75625@zxy.spb.ru> Cc: Ian Lepore , lidl@FreeBSD.org, Matteo Riondato , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Andrey Chernov Message-ID: <8d160780-470e-f1e4-3eb5-bd460a70d1a7@freebsd.org> Date: Mon, 6 Jun 2016 22:26:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160606175234.GG75625@zxy.spb.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 19:26:11 -0000 On 06.06.2016 20:52, Slawa Olhovchenkov wrote: >> BTW, it is good idea: to check first, is supported firewall enabled, and >> only then enable blacklistd by default. > > What purpose? SUDDENLY lockout access to own host after some mistake > in password? I agree that default 1 day locking is too restricting. I prefer floating scale of fail2ban which have several 15min locks (which is not big lockout for yourself) before one big lock after them, but currently blacklistd can't do that. From owner-svn-src-all@freebsd.org Mon Jun 6 20:00:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF93EB6D39A; Mon, 6 Jun 2016 20:00:14 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC4E81650; Mon, 6 Jun 2016 20:00:14 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56K0Dim091789; Mon, 6 Jun 2016 20:00:13 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56K0D3S091787; Mon, 6 Jun 2016 20:00:13 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606062000.u56K0D3S091787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Mon, 6 Jun 2016 20:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301517 - head/libexec/ftpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 20:00:15 -0000 Author: lidl Date: Mon Jun 6 20:00:13 2016 New Revision: 301517 URL: https://svnweb.freebsd.org/changeset/base/301517 Log: Update blacklist support in ftpd to clarify fd usage The ftp daemon dups the control socket to stdin and uses that fd throughout the code. Clarify this usage slightly by changing from explicit use of "0" for the fd to a variable, to make it clear what the zero represents in the non-blacklist code. Make the blacklist_notify routine use STDIN_FILENO so as to have less of a "magic number" feel to the code. Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6716 Modified: head/libexec/ftpd/blacklist.c head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/blacklist.c ============================================================================== --- head/libexec/ftpd/blacklist.c Mon Jun 6 18:45:09 2016 (r301516) +++ head/libexec/ftpd/blacklist.c Mon Jun 6 20:00:13 2016 (r301517) @@ -48,8 +48,6 @@ void blacklist_notify(int action, int fd, char *msg) { if (blstate == NULL) - blacklist_init(); - if (blstate == NULL) return; (void)blacklist_r(blstate, action, fd, msg); } Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Mon Jun 6 18:45:09 2016 (r301516) +++ head/libexec/ftpd/ftpd.c Mon Jun 6 20:00:13 2016 (r301517) @@ -268,7 +268,7 @@ int main(int argc, char *argv[], char **envp) { socklen_t addrlen; - int ch, on = 1, tos; + int ch, on = 1, tos, s = STDIN_FILENO; char *cp, line[LINE_MAX]; FILE *fd; char *bindname = NULL; @@ -504,8 +504,8 @@ main(int argc, char *argv[], char **envp switch (pid = fork()) { case 0: /* child */ - (void) dup2(fd, 0); - (void) dup2(fd, 1); + (void) dup2(fd, s); + (void) dup2(fd, STDOUT_FILENO); (void) close(fd); for (i = 1; i <= *ctl_sock; i++) close(ctl_sock[i]); @@ -522,7 +522,7 @@ main(int argc, char *argv[], char **envp } } else { addrlen = sizeof(his_addr); - if (getpeername(0, (struct sockaddr *)&his_addr, &addrlen) < 0) { + if (getpeername(s, (struct sockaddr *)&his_addr, &addrlen) < 0) { syslog(LOG_ERR, "getpeername (%s): %m",argv[0]); exit(1); } @@ -557,7 +557,7 @@ gotchild: (void)sigaction(SIGPIPE, &sa, NULL); addrlen = sizeof(ctrl_addr); - if (getsockname(0, (struct sockaddr *)&ctrl_addr, &addrlen) < 0) { + if (getsockname(s, (struct sockaddr *)&ctrl_addr, &addrlen) < 0) { syslog(LOG_ERR, "getsockname (%s): %m",argv[0]); exit(1); } @@ -570,7 +570,7 @@ gotchild: if (ctrl_addr.su_family == AF_INET) { tos = IPTOS_LOWDELAY; - if (setsockopt(0, IPPROTO_IP, IP_TOS, &tos, sizeof(int)) < 0) + if (setsockopt(s, IPPROTO_IP, IP_TOS, &tos, sizeof(int)) < 0) syslog(LOG_WARNING, "control setsockopt (IP_TOS): %m"); } #endif @@ -578,7 +578,7 @@ gotchild: * Disable Nagle on the control channel so that we don't have to wait * for peer's ACK before issuing our next reply. */ - if (setsockopt(0, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0) + if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0) syslog(LOG_WARNING, "control setsockopt (TCP_NODELAY): %m"); data_source.su_port = htons(ntohs(ctrl_addr.su_port) - 1); @@ -587,12 +587,12 @@ gotchild: /* Try to handle urgent data inline */ #ifdef SO_OOBINLINE - if (setsockopt(0, SOL_SOCKET, SO_OOBINLINE, &on, sizeof(on)) < 0) + if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &on, sizeof(on)) < 0) syslog(LOG_WARNING, "control setsockopt (SO_OOBINLINE): %m"); #endif #ifdef F_SETOWN - if (fcntl(fileno(stdin), F_SETOWN, getpid()) == -1) + if (fcntl(s, F_SETOWN, getpid()) == -1) syslog(LOG_ERR, "fcntl F_SETOWN: %m"); #endif dolog((struct sockaddr *)&his_addr); @@ -1423,7 +1423,7 @@ skip: if (rval) { reply(530, "Login incorrect."); #ifdef USE_BLACKLIST - blacklist_notify(1, 0, "Login incorrect"); + blacklist_notify(1, STDIN_FILENO, "Login incorrect"); #endif if (logging) { syslog(LOG_NOTICE, @@ -1444,7 +1444,7 @@ skip: } #ifdef USE_BLACKLIST else { - blacklist_notify(0, 0, "Login successful"); + blacklist_notify(0, STDIN_FILENO, "Login successful"); } #endif } From owner-svn-src-all@freebsd.org Mon Jun 6 20:28:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCC8BB6DD81; Mon, 6 Jun 2016 20:28:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B86291A52; Mon, 6 Jun 2016 20:28:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56KSrFK003611; Mon, 6 Jun 2016 20:28:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56KSrgM003610; Mon, 6 Jun 2016 20:28:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606062028.u56KSrgM003610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 6 Jun 2016 20:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301518 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 20:28:55 -0000 Author: jhb Date: Mon Jun 6 20:28:53 2016 New Revision: 301518 URL: https://svnweb.freebsd.org/changeset/base/301518 Log: Defer the creation of ACPI thermal kthreads to a startup sysinit. The SYSINIT runs at SI_SUB_KICK_SCHEDULER after the scheduler is fully initialized and timers are working. This fixes booting in the EARLY_AP_STARTUP case. Modified: head/sys/dev/acpica/acpi_thermal.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Mon Jun 6 20:00:13 2016 (r301517) +++ head/sys/dev/acpica/acpi_thermal.c Mon Jun 6 20:28:53 2016 (r301518) @@ -311,19 +311,40 @@ acpi_tz_attach(device_t dev) "thermal sampling period for passive cooling"); /* - * Create thread to service all of the thermal zones. Register - * our power profile event handler. + * Register our power profile event handler. */ sc->tz_event = EVENTHANDLER_REGISTER(power_profile_change, acpi_tz_power_profile, sc, 0); - if (acpi_tz_proc == NULL) { - error = kproc_create(acpi_tz_thread, NULL, &acpi_tz_proc, - RFHIGHPID, 0, "acpi_thermal"); - if (error != 0) { - device_printf(sc->tz_dev, "could not create thread - %d", error); - goto out; - } - } + + /* + * Flag the event handler for a manual invocation by our timeout. + * We defer it like this so that the rest of the subsystem has time + * to come up. Don't bother evaluating/printing the temperature at + * this point; on many systems it'll be bogus until the EC is running. + */ + sc->tz_flags |= TZ_FLAG_GETPROFILE; + + return_VALUE (0); +} + +static void +acpi_tz_startup(void *arg __unused) +{ + struct acpi_tz_softc *sc; + device_t *devs; + int devcount, error, i; + + devclass_get_devices(acpi_tz_devclass, &devs, &devcount); + if (devcount == 0) + return; + + /* + * Create thread to service all of the thermal zones. + */ + error = kproc_create(acpi_tz_thread, NULL, &acpi_tz_proc, RFHIGHPID, 0, + "acpi_thermal"); + if (error != 0) + printf("acpi_tz: could not create thread - %d", error); /* * Create a thread to handle passive cooling for 1st zone which @@ -335,34 +356,22 @@ acpi_tz_attach(device_t dev) * given frequency whereas it's possible for different thermal * zones to specify independent settings for multiple CPUs. */ - if (acpi_tz_cooling_unit < 0 && acpi_tz_cooling_is_available(sc)) - sc->tz_cooling_enabled = TRUE; - if (sc->tz_cooling_enabled) { - error = acpi_tz_cooling_thread_start(sc); - if (error != 0) { - sc->tz_cooling_enabled = FALSE; - goto out; + for (i = 0; i < devcount; i++) { + sc = device_get_softc(devs[i]); + if (acpi_tz_cooling_is_available(sc)) { + sc->tz_cooling_enabled = TRUE; + error = acpi_tz_cooling_thread_start(sc); + if (error != 0) { + sc->tz_cooling_enabled = FALSE; + break; + } + acpi_tz_cooling_unit = device_get_unit(devs[i]); + break; } - acpi_tz_cooling_unit = device_get_unit(dev); - } - - /* - * Flag the event handler for a manual invocation by our timeout. - * We defer it like this so that the rest of the subsystem has time - * to come up. Don't bother evaluating/printing the temperature at - * this point; on many systems it'll be bogus until the EC is running. - */ - sc->tz_flags |= TZ_FLAG_GETPROFILE; - -out: - if (error != 0) { - EVENTHANDLER_DEREGISTER(power_profile_change, sc->tz_event); - AcpiRemoveNotifyHandler(sc->tz_handle, ACPI_DEVICE_NOTIFY, - acpi_tz_notify_handler); - sysctl_ctx_free(&sc->tz_sysctl_ctx); } - return_VALUE (error); + free(devs, M_TEMP); } +SYSINIT(acpi_tz, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, acpi_tz_startup, NULL); /* * Parse the current state of this thermal zone and set up to use it. From owner-svn-src-all@freebsd.org Mon Jun 6 20:42:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB4CDB6D8CD; Mon, 6 Jun 2016 20:42:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86AA11A80; Mon, 6 Jun 2016 20:42:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56KgkoF011142; Mon, 6 Jun 2016 20:42:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56KgkpR011141; Mon, 6 Jun 2016 20:42:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606062042.u56KgkpR011141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Jun 2016 20:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301520 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 20:42:48 -0000 Author: np Date: Mon Jun 6 20:42:46 2016 New Revision: 301520 URL: https://svnweb.freebsd.org/changeset/base/301520 Log: cxgbe(4): Create a reusable struct type for scheduling class parameters. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_ioctl.h Modified: head/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- head/sys/dev/cxgbe/t4_ioctl.h Mon Jun 6 20:38:34 2016 (r301519) +++ head/sys/dev/cxgbe/t4_ioctl.h Mon Jun 6 20:42:46 2016 (r301520) @@ -215,6 +215,20 @@ struct t4_filter { struct t4_filter_specification fs; }; +/* Tx Scheduling Class parameters */ +struct t4_sched_class_params { + int8_t level; /* scheduler hierarchy level */ + int8_t mode; /* per-class or per-flow */ + int8_t rateunit; /* bit or packet rate */ + int8_t ratemode; /* %port relative or kbps absolute */ + int8_t channel; /* scheduler channel [0..N] */ + int8_t cl; /* scheduler class [0..N] */ + int32_t minrate; /* minimum rate */ + int32_t maxrate; /* maximum rate */ + int16_t weight; /* percent weight */ + int16_t pktsize; /* average packet size */ +}; + /* * Support for "sched-class" command to allow a TX Scheduling Class to be * programmed with various parameters. @@ -226,19 +240,7 @@ struct t4_sched_params { struct { /* sub-command SCHED_CLASS_CONFIG */ int8_t minmax; /* minmax enable */ } config; - struct { /* sub-command SCHED_CLASS_PARAMS */ - int8_t level; /* scheduler hierarchy level */ - int8_t mode; /* per-class or per-flow */ - int8_t rateunit; /* bit or packet rate */ - int8_t ratemode; /* %port relative or kbps - absolute */ - int8_t channel; /* scheduler channel [0..N] */ - int8_t cl; /* scheduler class [0..N] */ - int32_t minrate; /* minimum rate */ - int32_t maxrate; /* maximum rate */ - int16_t weight; /* percent weight */ - int16_t pktsize; /* average packet size */ - } params; + struct t4_sched_class_params params; uint8_t reserved[6 + 8 * 8]; } u; }; From owner-svn-src-all@freebsd.org Mon Jun 6 20:57:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1074B6DACA; Mon, 6 Jun 2016 20:57:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E5C31049; Mon, 6 Jun 2016 20:57:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56KvOXo015128; Mon, 6 Jun 2016 20:57:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56KvOMU015125; Mon, 6 Jun 2016 20:57:24 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606062057.u56KvOMU015125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 20:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301522 - in head: share/man/man4 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 20:57:25 -0000 Author: bz Date: Mon Jun 6 20:57:24 2016 New Revision: 301522 URL: https://svnweb.freebsd.org/changeset/base/301522 Log: Implement a `show panic` command to DDB which will helpfully print the panic string again if set, in case it scrolled out of the active window. This avoids having to remember the symbol name. Also add a show callout command to DDB in order to inspect some struct callout fields in case of panics in the callout code. This may help to see if there was memory corruption or to further ease debugging problems. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: jhb (comment only on the show panic initally) Differential Revision: https://reviews.freebsd.org/D4527 Modified: head/share/man/man4/ddb.4 head/sys/kern/kern_shutdown.c head/sys/kern/kern_timeout.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Mon Jun 6 20:42:54 2016 (r301521) +++ head/share/man/man4/ddb.4 Mon Jun 6 20:57:24 2016 (r301522) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2016 +.Dd June 6, 2016 .Dt DDB 4 .Os .Sh NAME @@ -599,6 +599,13 @@ See the header file for more details on the exact meaning of the structure fields. .\" .Pp +.It Ic show Cm callout Ar addr +Show information about the callout structure +.Vt struct callout +present at +.Ar addr . +.\" +.Pp .It Ic show Cm cbstat Show brief information about the TTY subsystem. .\" @@ -834,6 +841,10 @@ option is specified the complete object is printed. .\" .Pp +.It Ic show Cm panic +Print the panic message if set. +.\" +.Pp .It Ic show Cm page Show statistics on VM pages. .\" Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Jun 6 20:42:54 2016 (r301521) +++ head/sys/kern/kern_shutdown.c Mon Jun 6 20:57:24 2016 (r301522) @@ -929,3 +929,14 @@ mkdumpheader(struct kerneldumpheader *kd strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); kdh->parity = kerneldump_parity(kdh); } + +#ifdef DDB +DB_SHOW_COMMAND(panic, db_show_panic) +{ + + if (panicstr == NULL) + db_printf("panicstr not set\n"); + else + db_printf("panic: %s\n", panicstr); +} +#endif Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Jun 6 20:42:54 2016 (r301521) +++ head/sys/kern/kern_timeout.c Mon Jun 6 20:57:24 2016 (r301522) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_callout_profiling.h" +#include "opt_ddb.h" #if defined(__arm__) #include "opt_timer.h" #endif @@ -60,6 +61,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB +#include +#include +#endif + #ifdef SMP #include #endif @@ -1615,3 +1621,34 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_sta CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_callout_stat, "I", "Dump immediate statistic snapshot of the scheduled callouts"); + +#ifdef DDB +static void +_show_callout(struct callout *c) +{ + + db_printf("callout %p\n", c); +#define C_DB_PRINTF(f, e) db_printf(" %s = " f "\n", #e, c->e); + db_printf(" &c_links = %p\n", &(c->c_links)); + C_DB_PRINTF("%" PRId64, c_time); + C_DB_PRINTF("%" PRId64, c_precision); + C_DB_PRINTF("%p", c_arg); + C_DB_PRINTF("%p", c_func); + C_DB_PRINTF("%p", c_lock); + C_DB_PRINTF("%#x", c_flags); + C_DB_PRINTF("%#x", c_iflags); + C_DB_PRINTF("%d", c_cpu); +#undef C_DB_PRINTF +} + +DB_SHOW_COMMAND(callout, db_show_callout) +{ + + if (!have_addr) { + db_printf("usage: show callout \n"); + return; + } + + _show_callout((struct callout *)addr); +} +#endif /* DDB */ From owner-svn-src-all@freebsd.org Mon Jun 6 22:06:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B793B638DF; Mon, 6 Jun 2016 22:06:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8BA51EB5; Mon, 6 Jun 2016 22:06:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56M6jWs040694; Mon, 6 Jun 2016 22:06:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56M6jbC040693; Mon, 6 Jun 2016 22:06:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606062206.u56M6jbC040693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 6 Jun 2016 22:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301524 - vendor-sys/illumos/dist/uts/common/dtrace X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:06:47 -0000 Author: markj Date: Mon Jun 6 22:06:45 2016 New Revision: 301524 URL: https://svnweb.freebsd.org/changeset/base/301524 Log: 7034 negative record sizes should be rejected Reviewed by: Patrick Mooney Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@0b8049bfb0e291160e960697b554596289d7f0bc Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 21:04:29 2016 (r301523) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 22:06:45 2016 (r301524) @@ -10427,7 +10427,7 @@ dtrace_ecb_enable(dtrace_ecb_t *ecb) } } -static void +static int dtrace_ecb_resize(dtrace_ecb_t *ecb) { dtrace_action_t *act; @@ -10461,6 +10461,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); rec->dtrd_offset = curneeded; + if (curneeded + rec->dtrd_size < curneeded) + return (EINVAL); curneeded += rec->dtrd_size; ecb->dte_needed = MAX(ecb->dte_needed, curneeded); @@ -10485,6 +10487,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) } curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); rec->dtrd_offset = curneeded; + if (curneeded + rec->dtrd_size < curneeded) + return (EINVAL); curneeded += rec->dtrd_size; } else { /* tuples must be followed by an aggregation */ @@ -10494,6 +10498,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) ecb->dte_size = P2ROUNDUP(ecb->dte_size, rec->dtrd_alignment); rec->dtrd_offset = ecb->dte_size; + if (ecb->dte_size + rec->dtrd_size < ecb->dte_size) + return (EINVAL); ecb->dte_size += rec->dtrd_size; ecb->dte_needed = MAX(ecb->dte_needed, ecb->dte_size); } @@ -10513,6 +10519,7 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) ecb->dte_needed = P2ROUNDUP(ecb->dte_needed, (sizeof (dtrace_epid_t))); ecb->dte_state->dts_needed = MAX(ecb->dte_state->dts_needed, ecb->dte_needed); + return (0); } static dtrace_action_t * @@ -11180,7 +11187,10 @@ dtrace_ecb_create(dtrace_state_t *state, } } - dtrace_ecb_resize(ecb); + if ((enab->dten_error = dtrace_ecb_resize(ecb)) != 0) { + dtrace_ecb_destroy(ecb); + return (NULL); + } return (dtrace_ecb_create_cache = ecb); } From owner-svn-src-all@freebsd.org Mon Jun 6 22:07:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91606B639B4; Mon, 6 Jun 2016 22:07:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63975102F; Mon, 6 Jun 2016 22:07:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56M7tjd040777; Mon, 6 Jun 2016 22:07:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56M7taM040776; Mon, 6 Jun 2016 22:07:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606062207.u56M7taM040776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 6 Jun 2016 22:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301525 - vendor-sys/illumos/dist/uts/common/dtrace X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:07:56 -0000 Author: markj Date: Mon Jun 6 22:07:55 2016 New Revision: 301525 URL: https://svnweb.freebsd.org/changeset/base/301525 Log: 7033 ustack helper should fault on bad return values Reviewed by: Patrick Mooney Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@a2f72b65ebc430aaf277ad797e554bb4deba9b95 Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 22:06:45 2016 (r301524) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 22:07:55 2016 (r301525) @@ -6526,6 +6526,7 @@ dtrace_action_ustack(dtrace_mstate_t *ms uint64_t *pcs = &buf[1], *fps; char *str = (char *)&pcs[nframes]; int size, offs = 0, i, j; + size_t rem; uintptr_t old = mstate->dtms_scratch_ptr, saved; uint16_t *flags = &cpu_core[CPU->cpu_id].cpuc_dtrace_flags; char *sym; @@ -6597,12 +6598,18 @@ dtrace_action_ustack(dtrace_mstate_t *ms continue; } + if (!dtrace_strcanload((uintptr_t)sym, strsize, &rem, mstate, + &(state->dts_vstate))) { + str[offs++] = '\0'; + continue; + } + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); /* * Now copy in the string that the helper returned to us. */ - for (j = 0; offs + j < strsize; j++) { + for (j = 0; offs + j < strsize && j < rem; j++) { if ((str[offs + j] = sym[j]) == '\0') break; } From owner-svn-src-all@freebsd.org Mon Jun 6 22:09:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46374B63A2F; Mon, 6 Jun 2016 22:09:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7891199; Mon, 6 Jun 2016 22:09:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56M9MXH040869; Mon, 6 Jun 2016 22:09:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56M9McM040867; Mon, 6 Jun 2016 22:09:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606062209.u56M9McM040867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 6 Jun 2016 22:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301526 - in vendor-sys/illumos/dist/uts/common: dtrace sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:09:23 -0000 Author: markj Date: Mon Jun 6 22:09:22 2016 New Revision: 301526 URL: https://svnweb.freebsd.org/changeset/base/301526 Log: 7035 string-related subroutines should validate input earlier Reviewed by: Alex Wilson Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Patrick Mooney illumos/illumos-gate@771e39c3b1d6e2e0ba230442d782d83c60098296 Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 22:07:55 2016 (r301525) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Mon Jun 6 22:09:22 2016 (r301526) @@ -384,6 +384,14 @@ static kmutex_t dtrace_errlock; (testaddr) + (testsz) - (uintptr_t)(baseaddr) <= (basesz) && \ (testaddr) + (testsz) >= (testaddr)) +#define DTRACE_RANGE_REMAIN(remp, addr, baseaddr, basesz) \ +do { \ + if ((remp) != NULL) { \ + *(remp) = (uintptr_t)(baseaddr) + (basesz) - (addr); \ + } \ +_NOTE(CONSTCOND) } while (0) + + /* * Test whether alloc_sz bytes will fit in the scratch region. We isolate * alloc_sz on the righthand side of the comparison in order to avoid overflow @@ -484,6 +492,10 @@ static int dtrace_ecb_create_enable(dtra static void dtrace_helper_provider_destroy(dtrace_helper_provider_t *); static int dtrace_priv_proc(dtrace_state_t *, dtrace_mstate_t *); static void dtrace_getf_barrier(void); +static int dtrace_canload_remains(uint64_t, size_t, size_t *, + dtrace_mstate_t *, dtrace_vstate_t *); +static int dtrace_canstore_remains(uint64_t, size_t, size_t *, + dtrace_mstate_t *, dtrace_vstate_t *); /* * DTrace Probe Context Functions @@ -590,7 +602,7 @@ dtrace_inscratch(uintptr_t dest, size_t } static int -dtrace_canstore_statvar(uint64_t addr, size_t sz, +dtrace_canstore_statvar(uint64_t addr, size_t sz, size_t *remain, dtrace_statvar_t **svars, int nsvars) { int i; @@ -621,8 +633,12 @@ dtrace_canstore_statvar(uint64_t addr, s VERIFY((scope == DIFV_SCOPE_GLOBAL && size <= maxglobalsize) || (scope == DIFV_SCOPE_LOCAL && size <= maxlocalsize)); - if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, svar->dtsv_size)) + if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, + svar->dtsv_size)) { + DTRACE_RANGE_REMAIN(remain, addr, svar->dtsv_data, + svar->dtsv_size); return (1); + } } return (0); @@ -638,12 +654,26 @@ static int dtrace_canstore(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { + return (dtrace_canstore_remains(addr, sz, NULL, mstate, vstate)); +} + +/* + * Implementation of dtrace_canstore which communicates the upper bound of the + * allowed memory region. + */ +static int +dtrace_canstore_remains(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) +{ /* * First, check to see if the address is in scratch space... */ if (DTRACE_INRANGE(addr, sz, mstate->dtms_scratch_base, - mstate->dtms_scratch_size)) + mstate->dtms_scratch_size)) { + DTRACE_RANGE_REMAIN(remain, addr, mstate->dtms_scratch_base, + mstate->dtms_scratch_size); return (1); + } /* * Now check to see if it's a dynamic variable. This check will pick @@ -696,6 +726,7 @@ dtrace_canstore(uint64_t addr, size_t sz ((dvar->dtdv_tuple.dtt_nkeys - 1) * sizeof (dtrace_key_t))) return (0); + DTRACE_RANGE_REMAIN(remain, addr, dvar, dstate->dtds_chunksize); return (1); } @@ -703,11 +734,11 @@ dtrace_canstore(uint64_t addr, size_t sz * Finally, check the static local and global variables. These checks * take the longest, so we perform them last. */ - if (dtrace_canstore_statvar(addr, sz, + if (dtrace_canstore_statvar(addr, sz, remain, vstate->dtvs_locals, vstate->dtvs_nlocals)) return (1); - if (dtrace_canstore_statvar(addr, sz, + if (dtrace_canstore_statvar(addr, sz, remain, vstate->dtvs_globals, vstate->dtvs_nglobals)) return (1); @@ -728,6 +759,17 @@ static int dtrace_canload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { + return (dtrace_canload_remains(addr, sz, NULL, mstate, vstate)); +} + +/* + * Implementation of dtrace_canload which communicates the upper bound of the + * allowed memory region. + */ +static int +dtrace_canload_remains(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) +{ volatile uintptr_t *illval = &cpu_core[CPU->cpu_id].cpuc_dtrace_illval; file_t *fp; @@ -735,21 +777,27 @@ dtrace_canload(uint64_t addr, size_t sz, * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, addr, addr, sz); return (1); + } /* * You can obviously read that which you can store. */ - if (dtrace_canstore(addr, sz, mstate, vstate)) + if (dtrace_canstore_remains(addr, sz, remain, mstate, vstate)) return (1); /* * We're allowed to read from our own string table. */ if (DTRACE_INRANGE(addr, sz, mstate->dtms_difo->dtdo_strtab, - mstate->dtms_difo->dtdo_strlen)) + mstate->dtms_difo->dtdo_strlen)) { + DTRACE_RANGE_REMAIN(remain, addr, + mstate->dtms_difo->dtdo_strtab, + mstate->dtms_difo->dtdo_strlen); return (1); + } if (vstate->dtvs_state != NULL && dtrace_priv_proc(vstate->dtvs_state, mstate)) { @@ -771,26 +819,37 @@ dtrace_canload(uint64_t addr, size_t sz, * deallocated and reallocated as something else while it's * being operated upon. */ - if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t))) + if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread, + sizeof (kthread_t)); return (1); + } if ((p = curthread->t_procp) != NULL && DTRACE_INRANGE(addr, sz, curthread->t_procp, sizeof (proc_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_procp, + sizeof (proc_t)); return (1); } if (curthread->t_cred != NULL && DTRACE_INRANGE(addr, sz, curthread->t_cred, sizeof (cred_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_cred, + sizeof (cred_t)); return (1); } if (p != NULL && p->p_pidp != NULL && DTRACE_INRANGE(addr, sz, &(p->p_pidp->pid_id), sizeof (pid_t))) { + DTRACE_RANGE_REMAIN(remain, addr, &(p->p_pidp->pid_id), + sizeof (pid_t)); return (1); } if (curthread->t_cpu != NULL && DTRACE_INRANGE(addr, sz, curthread->t_cpu, offsetof(cpu_t, cpu_pause_thread))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_cpu, + offsetof(cpu_t, cpu_pause_thread)); return (1); } } @@ -812,29 +871,45 @@ dtrace_canload(uint64_t addr, size_t sz, * either dtms_getf itself or its f_vnode member to reference * freed memory). */ - if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t))) + if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t))) { + DTRACE_RANGE_REMAIN(remain, addr, fp, sizeof (file_t)); return (1); + } if ((vp = fp->f_vnode) != NULL) { - if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz)) + size_t slen; + + if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, &vp->v_path, + psz); return (1); + } - if (vp->v_path != NULL && DTRACE_INRANGE(addr, sz, - vp->v_path, strlen(vp->v_path) + 1)) { + slen = strlen(vp->v_path) + 1; + if (DTRACE_INRANGE(addr, sz, vp->v_path, slen)) { + DTRACE_RANGE_REMAIN(remain, addr, vp->v_path, + slen); return (1); } - if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz)) + if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, &vp->v_op, + psz); return (1); + } if ((op = vp->v_op) != NULL && DTRACE_INRANGE(addr, sz, &op->vnop_name, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, + &op->vnop_name, psz); return (1); } if (op != NULL && op->vnop_name != NULL && DTRACE_INRANGE(addr, sz, op->vnop_name, - strlen(op->vnop_name) + 1)) { + (slen = strlen(op->vnop_name) + 1))) { + DTRACE_RANGE_REMAIN(remain, addr, + op->vnop_name, slen); return (1); } } @@ -852,21 +927,41 @@ dtrace_canload(uint64_t addr, size_t sz, * calls in the event that the user has all privileges. */ static int -dtrace_strcanload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, - dtrace_vstate_t *vstate) +dtrace_strcanload(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { - size_t strsz; + size_t rsize; /* * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, addr, addr, sz); return (1); + } - strsz = 1 + dtrace_strlen((char *)(uintptr_t)addr, sz); - if (dtrace_canload(addr, strsz, mstate, vstate)) - return (1); + /* + * Even if the caller is uninterested in querying the remaining valid + * range, it is required to ensure that the access is allowed. + */ + if (remain == NULL) { + remain = &rsize; + } + if (dtrace_canload_remains(addr, 0, remain, mstate, vstate)) { + size_t strsz; + /* + * Perform the strlen after determining the length of the + * memory region which is accessible. This prevents timing + * information from being used to find NULs in memory which is + * not accessible to the caller. + */ + strsz = 1 + dtrace_strlen((char *)(uintptr_t)addr, + MIN(sz, *remain)); + if (strsz <= *remain) { + return (1); + } + } return (0); } @@ -876,26 +971,49 @@ dtrace_strcanload(uint64_t addr, size_t * region in which a load may be issued given the user's privilege level. */ static int -dtrace_vcanload(void *src, dtrace_diftype_t *type, dtrace_mstate_t *mstate, - dtrace_vstate_t *vstate) +dtrace_vcanload(void *src, dtrace_diftype_t *type, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { size_t sz; ASSERT(type->dtdt_flags & DIF_TF_BYREF); /* + * Calculate the max size before performing any checks since even + * DTRACE_ACCESS_KERNEL-credentialed callers expect that this function + * return the max length via 'remain'. + */ + if (type->dtdt_kind == DIF_TYPE_STRING) { + dtrace_state_t *state = vstate->dtvs_state; + + if (state != NULL) { + sz = state->dts_options[DTRACEOPT_STRSIZE]; + } else { + /* + * In helper context, we have a NULL state; fall back + * to using the system-wide default for the string size + * in this case. + */ + sz = dtrace_strsize_default; + } + } else { + sz = type->dtdt_size; + } + + /* * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, (uintptr_t)src, src, sz); return (1); + } - if (type->dtdt_kind == DIF_TYPE_STRING) - sz = dtrace_strlen(src, - vstate->dtvs_state->dts_options[DTRACEOPT_STRSIZE]) + 1; - else - sz = type->dtdt_size; - - return (dtrace_canload((uintptr_t)src, sz, mstate, vstate)); + if (type->dtdt_kind == DIF_TYPE_STRING) { + return (dtrace_strcanload((uintptr_t)src, sz, remain, mstate, + vstate)); + } + return (dtrace_canload_remains((uintptr_t)src, sz, remain, mstate, + vstate)); } /* @@ -1085,14 +1203,14 @@ dtrace_strcpy(const void *src, void *dst * specified type; we assume that we can store to directly. */ static void -dtrace_vcopy(void *src, void *dst, dtrace_diftype_t *type) +dtrace_vcopy(void *src, void *dst, dtrace_diftype_t *type, size_t limit) { ASSERT(type->dtdt_flags & DIF_TF_BYREF); if (type->dtdt_kind == DIF_TYPE_STRING) { - dtrace_strcpy(src, dst, type->dtdt_size); + dtrace_strcpy(src, dst, MIN(type->dtdt_size, limit)); } else { - dtrace_bcopy(src, dst, type->dtdt_size); + dtrace_bcopy(src, dst, MIN(type->dtdt_size, limit)); } } @@ -4212,30 +4330,29 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uintptr_t kaddr = tupregs[0].dttk_value; uintptr_t uaddr = tupregs[1].dttk_value; uint64_t size = tupregs[2].dttk_value; + size_t lim; if (!dtrace_destructive_disallow && dtrace_priv_proc_control(state, mstate) && !dtrace_istoxic(kaddr, size) && - dtrace_strcanload(kaddr, size, mstate, vstate)) { + dtrace_strcanload(kaddr, size, &lim, mstate, vstate)) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - dtrace_copyoutstr(kaddr, uaddr, size, flags); + dtrace_copyoutstr(kaddr, uaddr, lim, flags); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); } break; } case DIF_SUBR_STRLEN: { - size_t sz; + size_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t addr = (uintptr_t)tupregs[0].dttk_value; - sz = dtrace_strlen((char *)addr, - state->dts_options[DTRACEOPT_STRSIZE]); + size_t lim; - if (!dtrace_canload(addr, sz + 1, mstate, vstate)) { + if (!dtrace_strcanload(addr, size, &lim, mstate, vstate)) { regs[rd] = NULL; break; } - - regs[rd] = sz; + regs[rd] = dtrace_strlen((char *)addr, lim); break; } @@ -4249,28 +4366,29 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * is DIF_SUBR_STRRCHR, we will look for the last occurrence * of the specified character instead of the first. */ - uintptr_t saddr = tupregs[0].dttk_value; uintptr_t addr = tupregs[0].dttk_value; - uintptr_t limit = addr + state->dts_options[DTRACEOPT_STRSIZE]; + uintptr_t addr_limit; + uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; + size_t lim; char c, target = (char)tupregs[1].dttk_value; - for (regs[rd] = NULL; addr < limit; addr++) { + if (!dtrace_strcanload(addr, size, &lim, mstate, vstate)) { + regs[rd] = NULL; + break; + } + addr_limit = addr + lim; + + for (regs[rd] = NULL; addr < addr_limit; addr++) { if ((c = dtrace_load8(addr)) == target) { regs[rd] = addr; if (subr == DIF_SUBR_STRCHR) break; } - if (c == '\0') break; } - if (!dtrace_canload(saddr, addr - saddr, mstate, vstate)) { - regs[rd] = NULL; - break; - } - break; } @@ -4428,7 +4546,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uintptr_t addr = tupregs[0].dttk_value; uintptr_t tokaddr = tupregs[1].dttk_value; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; - uintptr_t limit, toklimit = tokaddr + size; + uintptr_t limit, toklimit; + size_t clim; uint8_t c, tokmap[32]; /* 256 / 8 */ char *dest = (char *)mstate->dtms_scratch_ptr; int i; @@ -4437,10 +4556,11 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * Check both the token buffer and (later) the input buffer, * since both could be non-scratch addresses. */ - if (!dtrace_strcanload(tokaddr, size, mstate, vstate)) { + if (!dtrace_strcanload(tokaddr, size, &clim, mstate, vstate)) { regs[rd] = NULL; break; } + toklimit = tokaddr + clim; if (!DTRACE_INSCRATCH(mstate, size)) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH); @@ -4457,6 +4577,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * it behaves like an implicit clause-local variable. */ addr = mstate->dtms_strtok; + limit = mstate->dtms_strtok_limit; } else { /* * If the user-specified address is non-NULL we must @@ -4466,10 +4587,12 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * (when we fetch addr from mstate->dtms_strtok) * would fail this access check. */ - if (!dtrace_strcanload(addr, size, mstate, vstate)) { + if (!dtrace_strcanload(addr, size, &clim, mstate, + vstate)) { regs[rd] = NULL; break; } + limit = addr + clim; } /* @@ -4488,10 +4611,10 @@ dtrace_dif_subr(uint_t subr, uint_t rd, tokmap[c >> 3] |= (1 << (c & 0x7)); } - for (limit = addr + size; addr < limit; addr++) { + for (; addr < limit; addr++) { /* - * We're looking for a character that is _not_ contained - * in the token string. + * We're looking for a character that is _not_ + * contained in the token string. */ if ((c = dtrace_load8(addr)) == '\0') break; @@ -4509,6 +4632,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, */ regs[rd] = NULL; mstate->dtms_strtok = NULL; + mstate->dtms_strtok_limit = NULL; break; } @@ -4531,6 +4655,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, regs[rd] = (uintptr_t)dest; mstate->dtms_scratch_ptr += size; mstate->dtms_strtok = addr; + mstate->dtms_strtok_limit = limit; break; } @@ -4906,10 +5031,12 @@ case DIF_SUBR_GETMAJOR: uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t s1 = tupregs[0].dttk_value; uintptr_t s2 = tupregs[1].dttk_value; - int i = 0; + int i = 0, j = 0; + size_t lim1, lim2; + char c; - if (!dtrace_strcanload(s1, size, mstate, vstate) || - !dtrace_strcanload(s2, size, mstate, vstate)) { + if (!dtrace_strcanload(s1, size, &lim1, mstate, vstate) || + !dtrace_strcanload(s2, size, &lim2, mstate, vstate)) { regs[rd] = NULL; break; } @@ -4926,8 +5053,8 @@ case DIF_SUBR_GETMAJOR: regs[rd] = NULL; break; } - - if ((d[i++] = dtrace_load8(s1++)) == '\0') { + c = (i >= lim1) ? '\0' : dtrace_load8(s1++); + if ((d[i++] = c) == '\0') { i--; break; } @@ -4940,7 +5067,8 @@ case DIF_SUBR_GETMAJOR: break; } - if ((d[i++] = dtrace_load8(s2++)) == '\0') + c = (j++ >= lim2) ? '\0' : dtrace_load8(s2++); + if ((d[i++] = c) == '\0') break; } @@ -4955,6 +5083,7 @@ case DIF_SUBR_GETMAJOR: case DIF_SUBR_STRTOLL: { uintptr_t s = tupregs[0].dttk_value; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; + size_t lim; int base = 10; if (nargs > 1) { @@ -4965,12 +5094,12 @@ case DIF_SUBR_GETMAJOR: } } - if (!dtrace_strcanload(s, size, mstate, vstate)) { + if (!dtrace_strcanload(s, size, &lim, mstate, vstate)) { regs[rd] = INT64_MIN; break; } - regs[rd] = dtrace_strtoll((char *)s, base, size); + regs[rd] = dtrace_strtoll((char *)s, base, lim); break; } @@ -5210,10 +5339,11 @@ case DIF_SUBR_GETMAJOR: char *dest = (char *)mstate->dtms_scratch_ptr, c; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t src = tupregs[0].dttk_value; + size_t lim; int i = 0, j = 0; zone_t *z; - if (!dtrace_strcanload(src, size, mstate, vstate)) { + if (!dtrace_strcanload(src, size, &lim, mstate, vstate)) { regs[rd] = NULL; break; } @@ -5228,7 +5358,7 @@ case DIF_SUBR_GETMAJOR: * Move forward, loading each character. */ do { - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); next: if (j + 5 >= size) /* 5 = strlen("/..c\0") */ break; @@ -5238,7 +5368,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c == '/') { /* @@ -5259,7 +5389,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c == '/') { /* @@ -5282,7 +5412,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c != '/' && c != '\0') { /* @@ -5830,15 +5960,17 @@ dtrace_dif_emulate(dtrace_difo_t *difo, size_t sz = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t s1 = regs[r1]; uintptr_t s2 = regs[r2]; + size_t lim1, lim2; if (s1 != NULL && - !dtrace_strcanload(s1, sz, mstate, vstate)) + !dtrace_strcanload(s1, sz, &lim1, mstate, vstate)) break; if (s2 != NULL && - !dtrace_strcanload(s2, sz, mstate, vstate)) + !dtrace_strcanload(s2, sz, &lim2, mstate, vstate)) break; - cc_r = dtrace_strncmp((char *)s1, (char *)s2, sz); + cc_r = dtrace_strncmp((char *)s1, (char *)s2, + MIN(lim1, lim2)); cc_n = cc_r < 0; cc_z = cc_r == 0; @@ -5897,6 +6029,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; + size_t lim; ASSERT(a != NULL); ASSERT(svar->dtsv_size != 0); @@ -5910,11 +6043,11 @@ dtrace_dif_emulate(dtrace_difo_t *difo, } if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - (void *)a, &v->dtdv_type); + (void *)a, &v->dtdv_type, lim); break; } @@ -5992,6 +6125,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; size_t sz = v->dtdv_type.dtdt_size; + size_t lim; sz += sizeof (uint64_t); ASSERT(svar->dtsv_size == NCPU * sz); @@ -6007,11 +6141,11 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - (void *)a, &v->dtdv_type); + (void *)a, &v->dtdv_type, lim); break; } @@ -6085,13 +6219,15 @@ dtrace_dif_emulate(dtrace_difo_t *difo, break; if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { + size_t lim; + if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], - &v->dtdv_type, mstate, vstate)) + &v->dtdv_type, &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - dvar->dtdv_data, &v->dtdv_type); + dvar->dtdv_data, &v->dtdv_type, lim); } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } @@ -6233,13 +6369,15 @@ dtrace_dif_emulate(dtrace_difo_t *difo, break; if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { + size_t lim; + if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - dvar->dtdv_data, &v->dtdv_type); + dvar->dtdv_data, &v->dtdv_type, lim); } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } @@ -7198,7 +7336,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t a if (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF && !dtrace_vcanload((void *)(uintptr_t)val, - &dp->dtdo_rtype, &mstate, vstate)) + &dp->dtdo_rtype, NULL, &mstate, vstate)) continue; dtrace_store_by_ref(dp, tomax, size, &valoffs, Modified: vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Mon Jun 6 22:07:55 2016 (r301525) +++ vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Mon Jun 6 22:09:22 2016 (r301526) @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright 2016 Joyent, Inc. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -922,6 +922,7 @@ typedef struct dtrace_mstate { int dtms_ipl; /* cached interrupt pri lev */ int dtms_fltoffs; /* faulting DIFO offset */ uintptr_t dtms_strtok; /* saved strtok() pointer */ + uintptr_t dtms_strtok_limit; /* upper bound of strtok ptr */ uint32_t dtms_access; /* memory access rights */ dtrace_difo_t *dtms_difo; /* current dif object */ file_t *dtms_getf; /* cached rval of getf() */ From owner-svn-src-all@freebsd.org Mon Jun 6 22:26:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EED9B63E66; Mon, 6 Jun 2016 22:26:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C101B35; Mon, 6 Jun 2016 22:26:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56MQJoo047908; Mon, 6 Jun 2016 22:26:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56MQJeN047906; Mon, 6 Jun 2016 22:26:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606062226.u56MQJeN047906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 22:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301527 - in head: share/man/man4 sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:26:20 -0000 Author: bz Date: Mon Jun 6 22:26:18 2016 New Revision: 301527 URL: https://svnweb.freebsd.org/changeset/base/301527 Log: Add a `show igi_list` command to DDB to debug IGMP state. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/ddb.4 head/sys/netinet/igmp.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Mon Jun 6 22:09:22 2016 (r301526) +++ head/share/man/man4/ddb.4 Mon Jun 6 22:26:18 2016 (r301527) @@ -688,6 +688,13 @@ The second one is the name of the interr Those functions are machine dependent. .\" .Pp +.It Ic show Cm igi_list Ar addr +Show information about the IGMP structure +.Vt struct igmp_ifsoftc +present at +.Ar addr . +.\" +.Pp .It Ic show Cm inodedeps Op Ar addr Show brief information about each inodedep structure. If Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Mon Jun 6 22:09:22 2016 (r301526) +++ head/sys/netinet/igmp.c Mon Jun 6 22:26:18 2016 (r301527) @@ -50,6 +50,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include @@ -64,6 +66,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB +#include +#endif + #include #include #include @@ -3641,6 +3647,37 @@ vnet_igmp_uninit(const void *unused __un VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_igmp_uninit, NULL); +#ifdef DDB +DB_SHOW_COMMAND(igi_list, db_show_igi_list) +{ + struct igmp_ifsoftc *igi, *tigi; + LIST_HEAD(_igi_list, igmp_ifsoftc) *igi_head; + + if (!have_addr) { + db_printf("usage: show igi_list \n"); + return; + } + igi_head = (struct _igi_list *)addr; + + LIST_FOREACH_SAFE(igi, igi_head, igi_link, tigi) { + db_printf("igmp_ifsoftc %p:\n", igi); + db_printf(" ifp %p\n", igi->igi_ifp); + db_printf(" version %u\n", igi->igi_version); + db_printf(" v1_timer %u\n", igi->igi_v1_timer); + db_printf(" v2_timer %u\n", igi->igi_v2_timer); + db_printf(" v3_timer %u\n", igi->igi_v3_timer); + db_printf(" flags %#x\n", igi->igi_flags); + db_printf(" rv %u\n", igi->igi_rv); + db_printf(" qi %u\n", igi->igi_qi); + db_printf(" qri %u\n", igi->igi_qri); + db_printf(" uri %u\n", igi->igi_uri); + /* SLIST_HEAD(,in_multi) igi_relinmhead */ + /* struct mbufq igi_gq; */ + db_printf("\n"); + } +} +#endif + static int igmp_modevent(module_t mod, int type, void *unused __unused) { From owner-svn-src-all@freebsd.org Mon Jun 6 22:34:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A92E6B6D08F; Mon, 6 Jun 2016 22:34:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7611310B1; Mon, 6 Jun 2016 22:34:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56MYCrN051686; Mon, 6 Jun 2016 22:34:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56MYCNI051685; Mon, 6 Jun 2016 22:34:12 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606062234.u56MYCNI051685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 22:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301528 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:34:13 -0000 Author: bz Date: Mon Jun 6 22:34:12 2016 New Revision: 301528 URL: https://svnweb.freebsd.org/changeset/base/301528 Log: Make KASSERT message more useful by printing the variables on which we assert. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Mon Jun 6 22:26:18 2016 (r301527) +++ head/sys/netinet6/mld6.c Mon Jun 6 22:34:12 2016 (r301528) @@ -300,7 +300,8 @@ mld_restore_context(struct mbuf *m) #if defined(VIMAGE) && defined(INVARIANTS) KASSERT(curvnet == m->m_pkthdr.PH_loc.ptr, - ("%s: called when curvnet was not restored", __func__)); + ("%s: called when curvnet was not restored: cuvnet %p m ptr %p", + __func__, curvnet, m->m_pkthdr.PH_loc.ptr)); #endif return (m->m_pkthdr.flowid); } From owner-svn-src-all@freebsd.org Mon Jun 6 22:51:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57403B6D43F; Mon, 6 Jun 2016 22:51:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ABC21BD0; Mon, 6 Jun 2016 22:51:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56MpiFj056318; Mon, 6 Jun 2016 22:51:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56MpimV056317; Mon, 6 Jun 2016 22:51:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606062251.u56MpimV056317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Jun 2016 22:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301531 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:51:45 -0000 Author: np Date: Mon Jun 6 22:51:44 2016 New Revision: 301531 URL: https://svnweb.freebsd.org/changeset/base/301531 Log: cxgbe(4): Break up set_sched_class. Validate the channel number and min/max rates against their actual limits (which are chip and port specific) instead of hardcoded constants. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jun 6 22:39:32 2016 (r301530) +++ head/sys/dev/cxgbe/t4_main.c Mon Jun 6 22:51:44 2016 (r301531) @@ -8297,152 +8297,132 @@ in_range(int val, int lo, int hi) } static int -set_sched_class(struct adapter *sc, struct t4_sched_params *p) +set_sched_class_config(struct adapter *sc, int minmax) { - int fw_subcmd, fw_type, rc; + int rc; - rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setsc"); + if (minmax < 0) + return (EINVAL); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4sscc"); if (rc) return (rc); + rc = -t4_sched_config(sc, FW_SCHED_TYPE_PKTSCHED, minmax, 1); + end_synchronized_op(sc, 0); - if (!(sc->flags & FULL_INIT_DONE)) { - rc = EAGAIN; - goto done; - } + return (rc); +} + +static int +set_sched_class_params(struct adapter *sc, struct t4_sched_class_params *p, + int sleep_ok) +{ + int rc, top_speed, fw_level, fw_mode, fw_rateunit, fw_ratemode; + struct port_info *pi; + + if (p->level == SCHED_CLASS_LEVEL_CL_RL) + fw_level = FW_SCHED_PARAMS_LEVEL_CL_RL; + else if (p->level == SCHED_CLASS_LEVEL_CL_WRR) + fw_level = FW_SCHED_PARAMS_LEVEL_CL_WRR; + else if (p->level == SCHED_CLASS_LEVEL_CH_RL) + fw_level = FW_SCHED_PARAMS_LEVEL_CH_RL; + else + return (EINVAL); + + if (p->mode == SCHED_CLASS_MODE_CLASS) + fw_mode = FW_SCHED_PARAMS_MODE_CLASS; + else if (p->mode == SCHED_CLASS_MODE_FLOW) + fw_mode = FW_SCHED_PARAMS_MODE_FLOW; + else + return (EINVAL); + + if (p->rateunit == SCHED_CLASS_RATEUNIT_BITS) + fw_rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; + else if (p->rateunit == SCHED_CLASS_RATEUNIT_PKTS) + fw_rateunit = FW_SCHED_PARAMS_UNIT_PKTRATE; + else + return (EINVAL); + + if (p->ratemode == SCHED_CLASS_RATEMODE_REL) + fw_ratemode = FW_SCHED_PARAMS_RATE_REL; + else if (p->ratemode == SCHED_CLASS_RATEMODE_ABS) + fw_ratemode = FW_SCHED_PARAMS_RATE_ABS; + else + return (EINVAL); + + /* Vet our parameters ... */ + if (!in_range(p->channel, 0, sc->chip_params->nchan - 1)) + return (ERANGE); + + pi = sc->port[sc->chan_map[p->channel]]; + if (pi == NULL) + return (ENXIO); + MPASS(pi->tx_chan == p->channel); + top_speed = port_top_speed(pi) * 1000000; /* Gbps -> Kbps */ + + if (!in_range(p->cl, 0, sc->chip_params->nsched_cls) || + !in_range(p->minrate, 0, top_speed) || + !in_range(p->maxrate, 0, top_speed) || + !in_range(p->weight, 0, 100)) + return (ERANGE); /* - * Translate the cxgbetool parameters into T4 firmware parameters. (The - * sub-command and type are in common locations.) + * Translate any unset parameters into the firmware's + * nomenclature and/or fail the call if the parameters + * are required ... */ - if (p->subcmd == SCHED_CLASS_SUBCMD_CONFIG) - fw_subcmd = FW_SCHED_SC_CONFIG; - else if (p->subcmd == SCHED_CLASS_SUBCMD_PARAMS) - fw_subcmd = FW_SCHED_SC_PARAMS; - else { - rc = EINVAL; - goto done; + if (p->rateunit < 0 || p->ratemode < 0 || p->channel < 0 || p->cl < 0) + return (EINVAL); + + if (p->minrate < 0) + p->minrate = 0; + if (p->maxrate < 0) { + if (p->level == SCHED_CLASS_LEVEL_CL_RL || + p->level == SCHED_CLASS_LEVEL_CH_RL) + return (EINVAL); + else + p->maxrate = 0; } - if (p->type == SCHED_CLASS_TYPE_PACKET) - fw_type = FW_SCHED_TYPE_PKTSCHED; - else { - rc = EINVAL; - goto done; + if (p->weight < 0) { + if (p->level == SCHED_CLASS_LEVEL_CL_WRR) + return (EINVAL); + else + p->weight = 0; } - - if (fw_subcmd == FW_SCHED_SC_CONFIG) { - /* Vet our parameters ..*/ - if (p->u.config.minmax < 0) { - rc = EINVAL; - goto done; - } - - /* And pass the request to the firmware ...*/ - rc = -t4_sched_config(sc, fw_type, p->u.config.minmax, 1); - goto done; + if (p->pktsize < 0) { + if (p->level == SCHED_CLASS_LEVEL_CL_RL || + p->level == SCHED_CLASS_LEVEL_CH_RL) + return (EINVAL); + else + p->pktsize = 0; } - if (fw_subcmd == FW_SCHED_SC_PARAMS) { - int fw_level; - int fw_mode; - int fw_rateunit; - int fw_ratemode; - - if (p->u.params.level == SCHED_CLASS_LEVEL_CL_RL) - fw_level = FW_SCHED_PARAMS_LEVEL_CL_RL; - else if (p->u.params.level == SCHED_CLASS_LEVEL_CL_WRR) - fw_level = FW_SCHED_PARAMS_LEVEL_CL_WRR; - else if (p->u.params.level == SCHED_CLASS_LEVEL_CH_RL) - fw_level = FW_SCHED_PARAMS_LEVEL_CH_RL; - else { - rc = EINVAL; - goto done; - } - - if (p->u.params.mode == SCHED_CLASS_MODE_CLASS) - fw_mode = FW_SCHED_PARAMS_MODE_CLASS; - else if (p->u.params.mode == SCHED_CLASS_MODE_FLOW) - fw_mode = FW_SCHED_PARAMS_MODE_FLOW; - else { - rc = EINVAL; - goto done; - } + rc = begin_synchronized_op(sc, NULL, + sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); + if (rc) + return (rc); + rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode, + fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate, + p->weight, p->pktsize, sleep_ok); + end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD); - if (p->u.params.rateunit == SCHED_CLASS_RATEUNIT_BITS) - fw_rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; - else if (p->u.params.rateunit == SCHED_CLASS_RATEUNIT_PKTS) - fw_rateunit = FW_SCHED_PARAMS_UNIT_PKTRATE; - else { - rc = EINVAL; - goto done; - } + return (rc); +} - if (p->u.params.ratemode == SCHED_CLASS_RATEMODE_REL) - fw_ratemode = FW_SCHED_PARAMS_RATE_REL; - else if (p->u.params.ratemode == SCHED_CLASS_RATEMODE_ABS) - fw_ratemode = FW_SCHED_PARAMS_RATE_ABS; - else { - rc = EINVAL; - goto done; - } +static int +set_sched_class(struct adapter *sc, struct t4_sched_params *p) +{ - /* Vet our parameters ... */ - if (!in_range(p->u.params.channel, 0, 3) || - !in_range(p->u.params.cl, 0, sc->chip_params->nsched_cls) || - !in_range(p->u.params.minrate, 0, 10000000) || - !in_range(p->u.params.maxrate, 0, 10000000) || - !in_range(p->u.params.weight, 0, 100)) { - rc = ERANGE; - goto done; - } + if (p->type != SCHED_CLASS_TYPE_PACKET) + return (EINVAL); - /* - * Translate any unset parameters into the firmware's - * nomenclature and/or fail the call if the parameters - * are required ... - */ - if (p->u.params.rateunit < 0 || p->u.params.ratemode < 0 || - p->u.params.channel < 0 || p->u.params.cl < 0) { - rc = EINVAL; - goto done; - } - if (p->u.params.minrate < 0) - p->u.params.minrate = 0; - if (p->u.params.maxrate < 0) { - if (p->u.params.level == SCHED_CLASS_LEVEL_CL_RL || - p->u.params.level == SCHED_CLASS_LEVEL_CH_RL) { - rc = EINVAL; - goto done; - } else - p->u.params.maxrate = 0; - } - if (p->u.params.weight < 0) { - if (p->u.params.level == SCHED_CLASS_LEVEL_CL_WRR) { - rc = EINVAL; - goto done; - } else - p->u.params.weight = 0; - } - if (p->u.params.pktsize < 0) { - if (p->u.params.level == SCHED_CLASS_LEVEL_CL_RL || - p->u.params.level == SCHED_CLASS_LEVEL_CH_RL) { - rc = EINVAL; - goto done; - } else - p->u.params.pktsize = 0; - } + if (p->subcmd == SCHED_CLASS_SUBCMD_CONFIG) + return (set_sched_class_config(sc, p->u.config.minmax)); - /* See what the firmware thinks of the request ... */ - rc = -t4_sched_params(sc, fw_type, fw_level, fw_mode, - fw_rateunit, fw_ratemode, p->u.params.channel, - p->u.params.cl, p->u.params.minrate, p->u.params.maxrate, - p->u.params.weight, p->u.params.pktsize, 1); - goto done; - } + if (p->subcmd == SCHED_CLASS_SUBCMD_PARAMS) + return (set_sched_class_params(sc, &p->u.params, 1)); - rc = EINVAL; -done: - end_synchronized_op(sc, 0); - return (rc); + return (EINVAL); } static int From owner-svn-src-all@freebsd.org Mon Jun 6 22:54:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C3FDB6D4D2; Mon, 6 Jun 2016 22:54:09 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D72D1E1B; Mon, 6 Jun 2016 22:54:09 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56Ms8wa059044; Mon, 6 Jun 2016 22:54:08 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56Ms8MK059043; Mon, 6 Jun 2016 22:54:08 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201606062254.u56Ms8MK059043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 6 Jun 2016 22:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301532 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:54:09 -0000 Author: vangyzen Date: Mon Jun 6 22:54:08 2016 New Revision: 301532 URL: https://svnweb.freebsd.org/changeset/base/301532 Log: newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified After going through the signal work list, during which do_sigwork() is called and essentially does nothing because -s and -R were specified on the command line, newsyslog will sleep for 10 seconds as the (verbose) code says: "Pause 10 seconds to allow daemon(s) to close log file(s)". However, the man page verbiage for -R (and -s) seems quite clear that this sleep() is unnecessary because the daemon was expected to have already closed the log file before calling newsyslog. PR: 210020 Submitted by: David A. Bright MFC after: 1 week Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6727 Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Mon Jun 6 22:51:44 2016 (r301531) +++ head/usr.sbin/newsyslog/newsyslog.c Mon Jun 6 22:54:08 2016 (r301532) @@ -333,13 +333,15 @@ main(int argc, char **argv) printf("Signal all daemon process(es)...\n"); SLIST_FOREACH(stmp, &swhead, sw_nextp) do_sigwork(stmp); - if (noaction) - printf("\tsleep 10\n"); - else { - if (verbose) - printf("Pause 10 seconds to allow daemon(s)" - " to close log file(s)\n"); - sleep(10); + if (!(rotatereq && nosignal)) { + if (noaction) + printf("\tsleep 10\n"); + else { + if (verbose) + printf("Pause 10 seconds to allow " + "daemon(s) to close log file(s)\n"); + sleep(10); + } } } /* From owner-svn-src-all@freebsd.org Mon Jun 6 23:00:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03CFDB6D5E4; Mon, 6 Jun 2016 23:00:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C97CE1023; Mon, 6 Jun 2016 22:59:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56MxxZN059297; Mon, 6 Jun 2016 22:59:59 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56MxxMx059296; Mon, 6 Jun 2016 22:59:59 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606062259.u56MxxMx059296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 22:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301533 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 23:00:00 -0000 Author: bz Date: Mon Jun 6 22:59:58 2016 New Revision: 301533 URL: https://svnweb.freebsd.org/changeset/base/301533 Log: After tearing down the interface per-"domain" bits, set the data area to NULL to avoid it being mis-treated on a possible re-attach but also to get a clean NULL pointer derefence in case of errors due to unexpected race conditions elsewhere in the code, e.g., callouts. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 6 22:54:08 2016 (r301532) +++ head/sys/net/if.c Mon Jun 6 22:59:58 2016 (r301533) @@ -1030,9 +1030,11 @@ if_detach_internal(struct ifnet *ifp, in ifp->if_afdata_initialized = 0; IF_AFDATA_UNLOCK(ifp); for (dp = domains; i > 0 && dp; dp = dp->dom_next) { - if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) + if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) { (*dp->dom_ifdetach)(ifp, ifp->if_afdata[dp->dom_family]); + ifp->if_afdata[dp->dom_family] = NULL; + } } return (0); From owner-svn-src-all@freebsd.org Tue Jun 7 00:27:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D027CB6E9DE; Tue, 7 Jun 2016 00:27:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7A11C85; Tue, 7 Jun 2016 00:27:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u570Rtj9091720; Tue, 7 Jun 2016 00:27:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u570RtBu091718; Tue, 7 Jun 2016 00:27:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606070027.u570RtBu091718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 7 Jun 2016 00:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301535 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 00:27:56 -0000 Author: np Date: Tue Jun 7 00:27:55 2016 New Revision: 301535 URL: https://svnweb.freebsd.org/changeset/base/301535 Log: cxgbe(4): Track the state of the hardware traffic schedulers in the driver. This works as long as everyone uses set_sched_class_params to program them. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Jun 6 23:00:42 2016 (r301534) +++ head/sys/dev/cxgbe/adapter.h Tue Jun 7 00:27:55 2016 (r301535) @@ -54,6 +54,7 @@ #include #include "offload.h" +#include "t4_ioctl.h" #include "common/t4_msg.h" #include "firmware/t4fw_interface.h" @@ -264,6 +265,17 @@ struct vi_info { uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ }; +enum { + /* tx_sched_class flags */ + TX_SC_OK = (1 << 0), /* Set up in hardware, active. */ +}; + +struct tx_sched_class { + int refcount; + int flags; + struct t4_sched_class_params params; +}; + struct port_info { device_t dev; struct adapter *adapter; @@ -273,6 +285,8 @@ struct port_info { int up_vis; int uld_vis; + struct tx_sched_class *tc; /* traffic classes for this channel */ + struct mtx pi_lock; char lockname[16]; unsigned long flags; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jun 6 23:00:42 2016 (r301534) +++ head/sys/dev/cxgbe/t4_main.c Tue Jun 7 00:27:55 2016 (r301535) @@ -875,6 +875,9 @@ t4_attach(device_t dev) mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); sc->chan_map[pi->tx_chan] = i; + pi->tc = malloc(sizeof(struct tx_sched_class) * + sc->chip_params->nsched_cls, M_CXGBE, M_ZERO | M_WAITOK); + if (is_10G_port(pi) || is_40G_port(pi)) { n10g++; for_each_vi(pi, j, vi) { @@ -1131,6 +1134,7 @@ t4_detach(device_t dev) mtx_destroy(&pi->pi_lock); free(pi->vi, M_CXGBE); + free(pi->tc, M_CXGBE); free(pi, M_CXGBE); } } @@ -8319,6 +8323,7 @@ set_sched_class_params(struct adapter *s { int rc, top_speed, fw_level, fw_mode, fw_rateunit, fw_ratemode; struct port_info *pi; + struct tx_sched_class *tc; if (p->level == SCHED_CLASS_LEVEL_CL_RL) fw_level = FW_SCHED_PARAMS_LEVEL_CL_RL; @@ -8401,9 +8406,20 @@ set_sched_class_params(struct adapter *s sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); if (rc) return (rc); + tc = &pi->tc[p->cl]; + tc->params = *p; rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate, p->weight, p->pktsize, sleep_ok); + if (rc == 0) + tc->flags |= TX_SC_OK; + else { + /* + * Unknown state at this point, see tc->params for what was + * attempted. + */ + tc->flags &= ~TX_SC_OK; + } end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD); return (rc); From owner-svn-src-all@freebsd.org Tue Jun 7 01:00:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5C2DB6EE55; Tue, 7 Jun 2016 01:00:09 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7EE9184A; Tue, 7 Jun 2016 01:00:09 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57108ra002584; Tue, 7 Jun 2016 01:00:08 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57108CH002582; Tue, 7 Jun 2016 01:00:08 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606070100.u57108CH002582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 7 Jun 2016 01:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301536 - in head: share/man/man5 usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 01:00:10 -0000 Author: araujo Date: Tue Jun 7 01:00:08 2016 New Revision: 301536 URL: https://svnweb.freebsd.org/changeset/base/301536 Log: Add an entry on rc.conf(5) explaining the new options nis_ypldap_enable and nis_ypldap_flags. Also add an entry on ypldap(8) that it is a feature ready and appears on FreeBSD 11.0. Requested by: rodrigc Relnotes: Yes Modified: head/share/man/man5/rc.conf.5 head/usr.sbin/ypldap/ypldap.8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Jun 7 00:27:55 2016 (r301535) +++ head/share/man/man5/rc.conf.5 Tue Jun 7 01:00:08 2016 (r301536) @@ -2559,6 +2559,22 @@ is set to these are the flags to pass to the .Xr ypbind 8 service. +.It Va nis_ypldap_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr ypldap 8 +daemon at system boot time. +.It Va nis_ypldap_flags +.Pq Vt str +If +.Va nis.ypldap_enable +is set to +.Dq Li YES , +these are the flags to pass to the +.Xr ypldap 8 +daemon. .It Va nis_ypset_enable .Pq Vt bool If set to Modified: head/usr.sbin/ypldap/ypldap.8 ============================================================================== --- head/usr.sbin/ypldap/ypldap.8 Tue Jun 7 00:27:55 2016 (r301535) +++ head/usr.sbin/ypldap/ypldap.8 Tue Jun 7 01:00:08 2016 (r301536) @@ -74,7 +74,9 @@ configuration file. The .Nm program first appeared in -.Ox 4.4 . +.Ox 4.4 +and then +.Fx 11.0 . .Sh AUTHORS The .Nm From owner-svn-src-all@freebsd.org Tue Jun 7 01:15:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 924BCB6D207; Tue, 7 Jun 2016 01:15:33 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 363BA103B; Tue, 7 Jun 2016 01:15:33 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22f.google.com with SMTP id c127so156519608ywb.1; Mon, 06 Jun 2016 18:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/vScabCbJBC6XyH+RXTt9ceNbXbE0IFppLN5BSrLT/w=; b=rUWa/qTbzhISfHgFxgmqgzhH5vPbuxwWlciY4Neoa4i2Z2963vhkH4oaQWq2poLK52 3bjtX6pwWaMnK9Oq+zVcuhmRpW7x6z9oH1TAIsB62QZTlJzCXOt0G9g/rQrnXc61uuXY eErqOsG0N2lSWDXL/4yAk7v0F1tDpiOP5DCGrO47Ez5NYS1r6chGXmsMtXNnxcdVRadC OssL9H1zCRAWl1n0Bl4jCWUtjgOlENwixl/2jzZV6qjCKTSvIqF0y67xt4JLpVXLZXc/ Xi/GDUVDk7zwlhHJ2a03xJTAwuyCoeU0jZrgsia5LELnsAIPUvLMGT4kvm+qXZCqScb1 rsPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=/vScabCbJBC6XyH+RXTt9ceNbXbE0IFppLN5BSrLT/w=; b=iQNLYML94WBo8LYFUimhz7Od7ixSdrSivFhtRQ3FDGA2Euk9NThQkTb7cylGCJ/92o NDl2vUL882Lpr7w7cbTNSbNtb1sIkG9lTgHi83pvQ7ThTBa61qHPtqXGmZ/9BcE/N7zu uqj4JJ6rF545e8NgMfnCYJS/iEzI8ji3Z41LFYyxBgnJjdmjU/4cxLQnZTP6GOqiP1wj XzHb6IIwagd0N8p/0a9op3fAIvG6XzCn8DSFEXaepnLvMVbhx2HsWPqtLOuxCUw7kBnn ZVdH1OrFmyK5iLtj2YycmEbr3we3IHVkmr/y4U7RQuGJjsKFKVmfvWB/f2PKpDC6rgCT eMWA== X-Gm-Message-State: ALyK8tLJLhrclGgOJJa977fdLxwitl/kOFrRbyjkOWjzOC7rQvvfgDG6C7QWsW/F3wRRpILMwT7k6sK7xs8N2w== X-Received: by 10.13.253.131 with SMTP id n125mr13099545ywf.133.1465262131763; Mon, 06 Jun 2016 18:15:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.10.212 with HTTP; Mon, 6 Jun 2016 18:15:31 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <20160606165431.GF75625@zxy.spb.ru> References: <201606060951.u569pwOI063390@repo.freebsd.org> <20160606165431.GF75625@zxy.spb.ru> From: Marcelo Araujo Date: Tue, 7 Jun 2016 09:15:31 +0800 Message-ID: Subject: Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys To: Slawa Olhovchenkov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 01:15:33 -0000 Hi, Because 802.1p is Layer 2 and on its specification it sets video to 4, what DSCP does is convert those 3-bits to use on Layer 3 and try to do the CoS as close as possible with 802.1p. Best, 2016-06-07 0:54 GMT+08:00 Slawa Olhovchenkov : > On Mon, Jun 06, 2016 at 09:51:58AM +0000, Marcelo Araujo wrote: > > > Author: araujo > > Date: Mon Jun 6 09:51:58 2016 > > New Revision: 301496 > > URL: https://svnweb.freebsd.org/changeset/base/301496 > > > > Log: > > Add support to priority code point (PCP) that is an 3-bit field > > which refers to IEEE 802.1p class of service and maps to the frame > > priority level. > > > > Values in order of priority are: 1 (Background (lowest)), > > 0 (Best effort (default)), 2 (Excellent effort), > > 3 (Critical applications), 4 (Video, < 100ms latency), > > 5 (Video, < 10ms latency), 6 (Internetwork control) and > > 7 (Network control (highest)). > > What purpose to use 4 for video? > > http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus1000/sw/4_0/qos/configuration/guide/nexus1000v_qos/qos_6dscp_val.pdf > point video is 3. > > > Example of usage: > > root# ifconfig em0.1 create > > root# ifconfig em0.1 vlanpcp 3 > > > > Note: > > The review D801 includes the pf(4) part, but as discussed with kristof, > > we won't commit the pf(4) bits for now. > > The credits of the original code is from rwatson. > > > > Differential Revision: https://reviews.freebsd.org/D801 > > Reviewed by: gnn, adrian, loos > > Discussed with: rwatson, glebius, kristof > > Tested by: many including Matthew Grooms > > Obtained from: pfSense > > Relnotes: Yes > > > > Modified: > > head/sbin/ifconfig/ifconfig.8 > > head/sbin/ifconfig/ifvlan.c > > head/share/man/man4/vlan.4 > > head/sys/net/if.h > > head/sys/net/if_vlan.c > > head/sys/net/if_vlan_var.h > > head/sys/sys/priv.h > > > > Modified: head/sbin/ifconfig/ifconfig.8 > > > ============================================================================== > > --- head/sbin/ifconfig/ifconfig.8 Mon Jun 6 09:30:31 2016 > (r301495) > > +++ head/sbin/ifconfig/ifconfig.8 Mon Jun 6 09:51:58 2016 > (r301496) > > @@ -2614,6 +2614,29 @@ Note that > > and > > .Cm vlandev > > must both be set at the same time. > > +.It Cm vlanpcp Ar priority_code_point > > +Priority code point > > +.Pq Dv PCP > > +is an 3-bit field which refers to the IEEE 802.1p > > +class of service and maps to the frame priority level. > > +.Pp > > +Values in order of priority are: > > +.Cm 1 > > +.Pq Dv Background (lowest) , > > +.Cm 0 > > +.Pq Dv Best effort (default) , > > +.Cm 2 > > +.Pq Dv Excellent effort , > > +.Cm 3 > > +.Pq Dv Critical applications , > > +.Cm 4 > > +.Pq Dv Video, < 100ms latency , > > +.Cm 5 > > +.Pq Dv Video, < 10ms latency , > > +.Cm 6 > > +.Pq Dv Internetwork control , > > +.Cm 7 > > +.Pq Dv Network control (highest) . > > .It Cm vlandev Ar iface > > Associate the physical interface > > .Ar iface > > > > Modified: head/sbin/ifconfig/ifvlan.c > > > ============================================================================== > > --- head/sbin/ifconfig/ifvlan.c Mon Jun 6 09:30:31 2016 > (r301495) > > +++ head/sbin/ifconfig/ifvlan.c Mon Jun 6 09:51:58 2016 > (r301496) > > @@ -1,6 +1,10 @@ > > /* > > - * Copyright (c) 1999 > > - * Bill Paul . All rights reserved. > > + * Copyright (c) 1999 Bill Paul > > + * Copyright (c) 2012 ADARA Networks, Inc. > > + * All rights reserved. > > + * > > + * Portions of this software were developed by Robert N. M. Watson under > > + * contract to ADARA Networks, Inc. > > * > > * Redistribution and use in source and binary forms, with or without > > * modification, are permitted provided that the following conditions > > @@ -78,10 +82,14 @@ vlan_status(int s) > > { > > struct vlanreq vreq; > > > > - if (getvlan(s, &ifr, &vreq) != -1) > > - printf("\tvlan: %d parent interface: %s\n", > > - vreq.vlr_tag, vreq.vlr_parent[0] == '\0' ? > > - "" : vreq.vlr_parent); > > + if (getvlan(s, &ifr, &vreq) == -1) > > + return; > > + printf("\tvlan: %d", vreq.vlr_tag); > > + if (ioctl(s, SIOCGVLANPCP, (caddr_t)&ifr) != -1) > > + printf(" vlanpcp: %u", ifr.ifr_vlan_pcp); > > + printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ? > > + "" : vreq.vlr_parent); > > + printf("\n"); > > } > > > > static void > > @@ -149,6 +157,22 @@ DECL_CMD_FUNC(setvlandev, val, d) > > } > > > > static > > +DECL_CMD_FUNC(setvlanpcp, val, d) > > +{ > > + u_long ul; > > + char *endp; > > + > > + ul = strtoul(val, &endp, 0); > > + if (*endp != '\0') > > + errx(1, "invalid value for vlanpcp"); > > + if (ul > 7) > > + errx(1, "value for vlanpcp out of range"); > > + ifr.ifr_vlan_pcp = ul; > > + if (ioctl(s, SIOCSVLANPCP, (caddr_t)&ifr) == -1) > > + err(1, "SIOCSVLANPCP"); > > +} > > + > > +static > > DECL_CMD_FUNC(unsetvlandev, val, d) > > { > > struct vlanreq vreq; > > @@ -169,6 +193,7 @@ DECL_CMD_FUNC(unsetvlandev, val, d) > > static struct cmd vlan_cmds[] = { > > DEF_CLONE_CMD_ARG("vlan", setvlantag), > > DEF_CLONE_CMD_ARG("vlandev", setvlandev), > > + DEF_CMD_ARG("vlanpcp", setvlanpcp), > > /* NB: non-clone cmds */ > > DEF_CMD_ARG("vlan", setvlantag), > > DEF_CMD_ARG("vlandev", setvlandev), > > > > Modified: head/share/man/man4/vlan.4 > > > ============================================================================== > > --- head/share/man/man4/vlan.4 Mon Jun 6 09:30:31 2016 > (r301495) > > +++ head/share/man/man4/vlan.4 Mon Jun 6 09:51:58 2016 > (r301496) > > @@ -203,5 +203,3 @@ can be corrected manually if used in con > > .Sh SEE ALSO > > .Xr ifconfig 8 , > > .Xr sysctl 8 > > -.Sh BUGS > > -No 802.1Q features except VLAN tagging are implemented. > > > > Modified: head/sys/net/if.h > > > ============================================================================== > > --- head/sys/net/if.h Mon Jun 6 09:30:31 2016 (r301495) > > +++ head/sys/net/if.h Mon Jun 6 09:51:58 2016 (r301496) > > @@ -393,6 +393,7 @@ struct ifreq { > > caddr_t ifru_data; > > int ifru_cap[2]; > > u_int ifru_fib; > > + u_char ifru_vlan_pcp; > > } ifr_ifru; > > #define ifr_addr ifr_ifru.ifru_addr /* address */ > > #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of > p-to-p link */ > > @@ -410,6 +411,7 @@ struct ifreq { > > #define ifr_curcap ifr_ifru.ifru_cap[1] /* current > capabilities */ > > #define ifr_index ifr_ifru.ifru_index /* interface index > */ > > #define ifr_fib ifr_ifru.ifru_fib /* interface fib */ > > +#define ifr_vlan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */ > > }; > > > > #define _SIZEOF_ADDR_IFREQ(ifr) \ > > > > Modified: head/sys/net/if_vlan.c > > > ============================================================================== > > --- head/sys/net/if_vlan.c Mon Jun 6 09:30:31 2016 (r301495) > > +++ head/sys/net/if_vlan.c Mon Jun 6 09:51:58 2016 (r301496) > > @@ -1,5 +1,9 @@ > > /*- > > * Copyright 1998 Massachusetts Institute of Technology > > + * Copyright 2012 ADARA Networks, Inc. > > + * > > + * Portions of this software were developed by Robert N. M. Watson under > > + * contract to ADARA Networks, Inc. > > * > > * Permission to use, copy, modify, and distribute this software and > > * its documentation for any purpose and without fee is hereby > > @@ -29,8 +33,7 @@ > > > > /* > > * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. > > - * Might be extended some day to also handle IEEE 802.1p priority > > - * tagging. This is sort of sneaky in the implementation, since > > + * This is sort of sneaky in the implementation, since > > * we need to pretend to be enough of an Ethernet implementation > > * to make arp work. The way we do this is by telling everyone > > * that we are an Ethernet, and then catch the packets that > > @@ -52,6 +55,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -114,6 +118,8 @@ struct ifvlan { > > int ifvm_mintu; /* min transmission unit */ > > uint16_t ifvm_proto; /* encapsulation ethertype */ > > uint16_t ifvm_tag; /* tag to apply on packets leaving > if */ > > + uint16_t ifvm_vid; /* VLAN ID */ > > + uint8_t ifvm_pcp; /* Priority Code Point (PCP). */ > > } ifv_mib; > > SLIST_HEAD(, vlan_mc_entry) vlan_mc_listhead; > > #ifndef VLAN_ARRAY > > @@ -121,7 +127,9 @@ struct ifvlan { > > #endif > > }; > > #define ifv_proto ifv_mib.ifvm_proto > > -#define ifv_vid ifv_mib.ifvm_tag > > +#define ifv_tag ifv_mib.ifvm_tag > > +#define ifv_vid ifv_mib.ifvm_vid > > +#define ifv_pcp ifv_mib.ifvm_pcp > > #define ifv_encaplen ifv_mib.ifvm_encaplen > > #define ifv_mtufudge ifv_mib.ifvm_mtufudge > > #define ifv_mintu ifv_mib.ifvm_mintu > > @@ -147,6 +155,15 @@ static VNET_DEFINE(int, soft_pad); > > SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | > CTLFLAG_VNET, > > &VNET_NAME(soft_pad), 0, "pad short frames before tagging"); > > > > +/* > > + * For now, make preserving PCP via an mbuf tag optional, as it > increases > > + * per-packet memory allocations and frees. In the future, it would be > > + * preferable to reuse ether_vtag for this, or similar. > > + */ > > +static int vlan_mtag_pcp = 0; > > +SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW, > &vlan_mtag_pcp, 0, > > + "Retain VLAN PCP information as packets are passed up the stack"); > > + > > static const char vlanname[] = "vlan"; > > static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface"); > > > > @@ -697,6 +714,16 @@ vlan_devat(struct ifnet *ifp, uint16_t v > > } > > > > /* > > + * Recalculate the cached VLAN tag exposed via the MIB. > > + */ > > +static void > > +vlan_tag_recalculate(struct ifvlan *ifv) > > +{ > > + > > + ifv->ifv_tag = EVL_MAKETAG(ifv->ifv_vid, ifv->ifv_pcp, 0); > > +} > > + > > +/* > > * VLAN support can be loaded as a module. The only place in the > > * system that's intimately aware of this is ether_input. We hook > > * into this code through vlan_input_p which is defined there and > > @@ -1009,6 +1036,8 @@ vlan_transmit(struct ifnet *ifp, struct > > { > > struct ifvlan *ifv; > > struct ifnet *p; > > + struct m_tag *mtag; > > + uint16_t tag; > > int error, len, mcast; > > > > ifv = ifp->if_softc; > > @@ -1064,11 +1093,16 @@ vlan_transmit(struct ifnet *ifp, struct > > * knows how to find the VLAN tag to use, so we attach a > > * packet tag that holds it. > > */ > > + if (vlan_mtag_pcp && (mtag = m_tag_locate(m, MTAG_8021Q, > > + MTAG_8021Q_PCP_OUT, NULL)) != NULL) > > + tag = EVL_MAKETAG(ifv->ifv_vid, *(uint8_t *)(mtag + 1), 0); > > + else > > + tag = ifv->ifv_tag; > > if (p->if_capenable & IFCAP_VLAN_HWTAGGING) { > > - m->m_pkthdr.ether_vtag = ifv->ifv_vid; > > + m->m_pkthdr.ether_vtag = tag; > > m->m_flags |= M_VLANTAG; > > } else { > > - m = ether_vlanencap(m, ifv->ifv_vid); > > + m = ether_vlanencap(m, tag); > > if (m == NULL) { > > if_printf(ifp, "unable to prepend VLAN header\n"); > > if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); > > @@ -1103,7 +1137,8 @@ vlan_input(struct ifnet *ifp, struct mbu > > struct ifvlantrunk *trunk = ifp->if_vlantrunk; > > struct ifvlan *ifv; > > TRUNK_LOCK_READER; > > - uint16_t vid; > > + struct m_tag *mtag; > > + uint16_t vid, tag; > > > > KASSERT(trunk != NULL, ("%s: no trunk", __func__)); > > > > @@ -1112,7 +1147,7 @@ vlan_input(struct ifnet *ifp, struct mbu > > * Packet is tagged, but m contains a normal > > * Ethernet frame; the tag is stored out-of-band. > > */ > > - vid = EVL_VLANOFTAG(m->m_pkthdr.ether_vtag); > > + tag = m->m_pkthdr.ether_vtag; > > m->m_flags &= ~M_VLANTAG; > > } else { > > struct ether_vlan_header *evl; > > @@ -1128,7 +1163,7 @@ vlan_input(struct ifnet *ifp, struct mbu > > return; > > } > > evl = mtod(m, struct ether_vlan_header *); > > - vid = EVL_VLANOFTAG(ntohs(evl->evl_tag)); > > + tag = ntohs(evl->evl_tag); > > > > /* > > * Remove the 802.1q header by copying the Ethernet > > @@ -1152,6 +1187,8 @@ vlan_input(struct ifnet *ifp, struct mbu > > } > > } > > > > + vid = EVL_VLANOFTAG(tag); > > + > > TRUNK_RLOCK(trunk); > > ifv = vlan_gethash(trunk, vid); > > if (ifv == NULL || !UP_AND_RUNNING(ifv->ifv_ifp)) { > > @@ -1162,6 +1199,28 @@ vlan_input(struct ifnet *ifp, struct mbu > > } > > TRUNK_RUNLOCK(trunk); > > > > + if (vlan_mtag_pcp) { > > + /* > > + * While uncommon, it is possible that we will find a > 802.1q > > + * packet encapsulated inside another packet that also had > an > > + * 802.1q header. For example, ethernet tunneled over > IPSEC > > + * arriving over ethernet. In that case, we replace the > > + * existing 802.1q PCP m_tag value. > > + */ > > + mtag = m_tag_locate(m, MTAG_8021Q, MTAG_8021Q_PCP_IN, > NULL); > > + if (mtag == NULL) { > > + mtag = m_tag_alloc(MTAG_8021Q, MTAG_8021Q_PCP_IN, > > + sizeof(uint8_t), M_NOWAIT); > > + if (mtag == NULL) { > > + m_freem(m); > > + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); > > + return; > > + } > > + m_tag_prepend(m, mtag); > > + } > > + *(uint8_t *)(mtag + 1) = EVL_PRIOFTAG(tag); > > + } > > + > > m->m_pkthdr.rcvif = ifv->ifv_ifp; > > if_inc_counter(ifv->ifv_ifp, IFCOUNTER_IPACKETS, 1); > > > > @@ -1201,7 +1260,7 @@ vlan_config(struct ifvlan *ifv, struct i > > vlan_inithash(trunk); > > VLAN_LOCK(); > > if (p->if_vlantrunk != NULL) { > > - /* A race that that is very unlikely to be hit. */ > > + /* A race that is very unlikely to be hit. */ > > vlan_freehash(trunk); > > free(trunk, M_VLAN); > > goto exists; > > @@ -1218,6 +1277,8 @@ exists: > > } > > > > ifv->ifv_vid = vid; /* must set this before vlan_inshash() */ > > + ifv->ifv_pcp = 0; /* Default: best effort delivery. */ > > + vlan_tag_recalculate(ifv); > > error = vlan_inshash(trunk, ifv); > > if (error) > > goto done; > > @@ -1705,6 +1766,34 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd > > } > > break; > > > > + case SIOCGVLANPCP: > > +#ifdef VIMAGE > > + if (ifp->if_vnet != ifp->if_home_vnet) { > > + error = EPERM; > > + break; > > + } > > +#endif > > + ifr->ifr_vlan_pcp = ifv->ifv_pcp; > > + break; > > + > > + case SIOCSVLANPCP: > > +#ifdef VIMAGE > > + if (ifp->if_vnet != ifp->if_home_vnet) { > > + error = EPERM; > > + break; > > + } > > +#endif > > + error = priv_check(curthread, PRIV_NET_SETVLANPCP); > > + if (error) > > + break; > > + if (ifr->ifr_vlan_pcp > 7) { > > + error = EINVAL; > > + break; > > + } > > + ifv->ifv_pcp = ifr->ifr_vlan_pcp; > > + vlan_tag_recalculate(ifv); > > + break; > > + > > default: > > error = EINVAL; > > break; > > > > Modified: head/sys/net/if_vlan_var.h > > > ============================================================================== > > --- head/sys/net/if_vlan_var.h Mon Jun 6 09:30:31 2016 > (r301495) > > +++ head/sys/net/if_vlan_var.h Mon Jun 6 09:51:58 2016 > (r301496) > > @@ -73,6 +73,23 @@ struct vlanreq { > > #define SIOCSETVLAN SIOCSIFGENERIC > > #define SIOCGETVLAN SIOCGIFGENERIC > > > > +#define SIOCGVLANPCP _IOWR('i', 152, struct ifreq) /* Get > VLAN PCP */ > > +#define SIOCSVLANPCP _IOW('i', 153, struct ifreq) /* Set > VLAN PCP */ > > + > > +/* > > + * Names for 802.1q priorities ("802.1p"). Notice that in this scheme, > > + * (0 < 1), allowing default 0-tagged traffic to take priority over > background > > + * tagged traffic. > > + */ > > +#define IEEE8021Q_PCP_BK 1 /* Background (lowest) */ > > +#define IEEE8021Q_PCP_BE 0 /* Best effort (default) */ > > +#define IEEE8021Q_PCP_EE 2 /* Excellent effort */ > > +#define IEEE8021Q_PCP_CA 3 /* Critical applications */ > > +#define IEEE8021Q_PCP_VI 4 /* Video, < 100ms latency > */ > > +#define IEEE8021Q_PCP_VO 5 /* Video, < 10ms latency */ > > +#define IEEE8021Q_PCP_IC 6 /* Internetwork control */ > > +#define IEEE8021Q_PCP_NC 7 /* Network control > (highest) */ > > + > > #ifdef _KERNEL > > /* > > * Drivers that are capable of adding and removing the VLAN header > > @@ -110,6 +127,16 @@ struct vlanreq { > > * if_capabilities. > > */ > > > > +/* > > + * The 802.1q code may also tag mbufs with the PCP (priority) field for > use in > > + * other layers of the stack, in which case an m_tag will be used. > This is > > + * semantically quite different from use of the ether_vtag field, which > is > > + * defined only between the device driver and VLAN layer. > > + */ > > +#define MTAG_8021Q 1326104895 > > +#define MTAG_8021Q_PCP_IN 0 /* Input priority. > */ > > +#define MTAG_8021Q_PCP_OUT 1 /* Output > priority. */ > > + > > #define VLAN_CAPABILITIES(_ifp) do { \ > > if ((_ifp)->if_vlantrunk != NULL) \ > > (*vlan_trunk_cap_p)(_ifp); \ > > > > Modified: head/sys/sys/priv.h > > > ============================================================================== > > --- head/sys/sys/priv.h Mon Jun 6 09:30:31 2016 (r301495) > > +++ head/sys/sys/priv.h Mon Jun 6 09:51:58 2016 (r301496) > > @@ -342,6 +342,7 @@ > > #define PRIV_NET_SETIFDESCR 418 /* Set interface > description. */ > > #define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ > > #define PRIV_NET_VXLAN 420 /* Administer vxlan. */ > > +#define PRIV_NET_SETVLANPCP 421 /* Set VLAN priority. */ > > > > /* > > * 802.11-related privileges. > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Tue Jun 7 01:42:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32FF7B6D75F; Tue, 7 Jun 2016 01:42:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFA961C65; Tue, 7 Jun 2016 01:42:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id z187so18247073pfz.3; Mon, 06 Jun 2016 18:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/lov09hw3B1OKjyNBKRtld6GouwYOBzc1ZBHmTf06yA=; b=Uh8sz4lHp0LKZWhrRKuCYxuKwXNZYXWwN4jM4bZ13mjSXO96AarSV9Rt174b7SSMaC ffhsgdwnCMoAP0jQHqbfBs7yoWHg3q2tqNoRhE1Sb/iItIoeC33QeNesKcAY3AswDDFj Pj2YVMpu3QQpL631kOM6QkW7yZhtLzRewPujkS3gUtEg/oANjKvmscDzeKOulsqUjJPe sPkMNNsZeK6Ww0uAcbzV+kY4EnGU1qvXIyv0tZQB5urMIui/LXKrPhuFRsirEqEn/KIG wHCxVa/0qg00ZRxHeuvao29p+w3RB7gJcu+AnhvwlLSae/gfvSvHX8bfwpfsAumP3NDE wB1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/lov09hw3B1OKjyNBKRtld6GouwYOBzc1ZBHmTf06yA=; b=AUAntGzhPutZr1ZB+2aj51c76fKcMt5FFWVTuJH91WdxAfssV75i5yMWWIim2gYvWx OX+0Vt7UzeiTGKl8FTPPrfLwiiAm3Lz6t1x1eHURzdUHz59BoDFaXTztQVkrsDx6UPke xFPr6C0b4/4jooFm8DeSaJi3PfwpqRywiqMNISZDPyjEtYppCLqy+9CCaeBwqYiw+eRp QGBNOya0jHD02ckVw04x0LHsY25/nbxw+WTMVWYgdOVl3Kx5KsWAl8//azZnpO2P7nhT FvvaMlvvTKdn+ppIp+DaIQD3UECZgi1NfJrTJn25Zs6zg14pf9avShCJOCivFfi2hHQc fcSQ== X-Gm-Message-State: ALyK8tLDv3llhRsXyxFb91ySiEH7Gn8U6v3lwNVgulXMYyouTmYG0m3zYtka7KPaJUnO2w== X-Received: by 10.98.54.194 with SMTP id d185mr28793173pfa.34.1465263747192; Mon, 06 Jun 2016 18:42:27 -0700 (PDT) Received: from [192.168.20.14] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id ty10sm22407869pab.27.2016.06.06.18.42.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 18:42:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r301522 - in head: share/man/man4 sys/kern From: Ngie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: <201606062057.u56KvOMU015125@repo.freebsd.org> Date: Mon, 6 Jun 2016 18:42:22 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <379A4F79-F631-4696-8C09-0822610C04D4@gmail.com> References: <201606062057.u56KvOMU015125@repo.freebsd.org> To: "Bjoern A. Zeeb" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 01:42:28 -0000 > On Jun 6, 2016, at 13:57, Bjoern A. Zeeb wrote: >=20 > Author: bz > Date: Mon Jun 6 20:57:24 2016 > New Revision: 301522 > URL: https://svnweb.freebsd.org/changeset/base/301522 Awesome -- thanks bz!!! > Log: > Implement a `show panic` command to DDB which will helpfully print the > panic string again if set, in case it scrolled out of the active > window. This avoids having to remember the symbol name. >=20 > Also add a show callout command to DDB in order to inspect > some struct callout fields in case of panics in the callout code. > This may help to see if there was memory corruption or to further > ease debugging problems. >=20 > Obtained from: projects/vnet > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Reviewed by: jhb (comment only on the show panic initally) > Differential Revision: https://reviews.freebsd.org/D4527 >=20 > Modified: > head/share/man/man4/ddb.4 > head/sys/kern/kern_shutdown.c > head/sys/kern/kern_timeout.c >=20 > Modified: head/share/man/man4/ddb.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/share/man/man4/ddb.4 Mon Jun 6 20:42:54 2016 (r301521) > +++ head/share/man/man4/ddb.4 Mon Jun 6 20:57:24 2016 (r301522) > @@ -60,7 +60,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 18, 2016 > +.Dd June 6, 2016 > .Dt DDB 4 > .Os > .Sh NAME > @@ -599,6 +599,13 @@ See the > header file for more details on the exact meaning of the structure fields.= > .\" > .Pp > +.It Ic show Cm callout Ar addr > +Show information about the callout structure > +.Vt struct callout > +present at > +.Ar addr . > +.\" > +.Pp > .It Ic show Cm cbstat > Show brief information about the TTY subsystem. > .\" > @@ -834,6 +841,10 @@ option is specified the > complete object is printed. > .\" > .Pp > +.It Ic show Cm panic > +Print the panic message if set. > +.\" > +.Pp > .It Ic show Cm page > Show statistics on VM pages. > .\" >=20 > Modified: head/sys/kern/kern_shutdown.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/kern/kern_shutdown.c Mon Jun 6 20:42:54 2016 (r301521)= > +++ head/sys/kern/kern_shutdown.c Mon Jun 6 20:57:24 2016 (r301522)= > @@ -929,3 +929,14 @@ mkdumpheader(struct kerneldumpheader *kd > strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); > kdh->parity =3D kerneldump_parity(kdh); > } > + > +#ifdef DDB > +DB_SHOW_COMMAND(panic, db_show_panic) > +{ > + > + if (panicstr =3D=3D NULL) > + db_printf("panicstr not set\n"); > + else > + db_printf("panic: %s\n", panicstr); > +} > +#endif >=20 > Modified: head/sys/kern/kern_timeout.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/kern/kern_timeout.c Mon Jun 6 20:42:54 2016 (r301521) > +++ head/sys/kern/kern_timeout.c Mon Jun 6 20:57:24 2016 (r301522) > @@ -38,6 +38,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include "opt_callout_profiling.h" > +#include "opt_ddb.h" > #if defined(__arm__) > #include "opt_timer.h" > #endif > @@ -60,6 +61,11 @@ __FBSDID("$FreeBSD$"); > #include > #include >=20 > +#ifdef DDB > +#include > +#include > +#endif > + > #ifdef SMP > #include > #endif > @@ -1615,3 +1621,34 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_sta > CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > 0, 0, sysctl_kern_callout_stat, "I", > "Dump immediate statistic snapshot of the scheduled callouts"); > + > +#ifdef DDB > +static void > +_show_callout(struct callout *c) > +{ > + > + db_printf("callout %p\n", c); > +#define C_DB_PRINTF(f, e) db_printf(" %s =3D " f "\n", #e, c->e);= > + db_printf(" &c_links =3D %p\n", &(c->c_links)); > + C_DB_PRINTF("%" PRId64, c_time); > + C_DB_PRINTF("%" PRId64, c_precision); > + C_DB_PRINTF("%p", c_arg); > + C_DB_PRINTF("%p", c_func); > + C_DB_PRINTF("%p", c_lock); > + C_DB_PRINTF("%#x", c_flags); > + C_DB_PRINTF("%#x", c_iflags); > + C_DB_PRINTF("%d", c_cpu); > +#undef C_DB_PRINTF > +} > + > +DB_SHOW_COMMAND(callout, db_show_callout) > +{ > + > + if (!have_addr) { > + db_printf("usage: show callout \n"); > + return; > + } > + > + _show_callout((struct callout *)addr); > +} > +#endif /* DDB */ >=20 From owner-svn-src-all@freebsd.org Tue Jun 7 04:22:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 070BCB6D621; Tue, 7 Jun 2016 04:22:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C63FA11FA; Tue, 7 Jun 2016 04:22:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u574MJBO078867; Tue, 7 Jun 2016 04:22:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u574MIFb078858; Tue, 7 Jun 2016 04:22:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606070422.u574MIFb078858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 7 Jun 2016 04:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301537 - head/usr.sbin/bluetooth/ath3kfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 04:22:20 -0000 Author: adrian Date: Tue Jun 7 04:22:18 2016 New Revision: 301537 URL: https://svnweb.freebsd.org/changeset/base/301537 Log: [ath3k] add a replacement ath3k firmware loading tool. This is influenced by the ath3k driver from linux (circa 2013, this is how long I've been sitting on this.) It handles loading in firmware using the newer model, where it assembles the right set of firmware blobs and board configuration based on the device list and querying the device. The older utility could only load in a single image - which sometimes was ath3k-1.fw and sometimes was ath3k-2.fw. However, the ath3k maintainers didn't want to keep adding in binaries that were just derivatives with a separate board config, so they deleted ath3k-2.fw from the Linux firmware repository and instead, well, did this. Now, this has been tested against AR3011 and AR3012 NICs from the AR9285+BT combo up through to the QCA9565+BT combo. It doesn't yet work with the QCAFN222 NIC as that is some newer chip. The firmware can be grabbed from https://github.com/erikarn/ath3kfw/ in the share/firmware/ath3k directory. I'll update this utility over time to support the newer firmware drops (newer than mid-2013) which should pull in the QCNFA222 and subsequent chips. Tested: * AR9285 + BT * AR9287 + BT * AR9485 + BT * AR9462 + BT * QCA9565 + BT Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_dbg.h (contents, props changed) head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.c (contents, props changed) head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.h (contents, props changed) head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.c (contents, props changed) head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.h (contents, props changed) head/usr.sbin/bluetooth/ath3kfw/main.c (contents, props changed) Deleted: head/usr.sbin/bluetooth/ath3kfw/ath3kfw.c Modified: head/usr.sbin/bluetooth/ath3kfw/Makefile head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 Modified: head/usr.sbin/bluetooth/ath3kfw/Makefile ============================================================================== --- head/usr.sbin/bluetooth/ath3kfw/Makefile Tue Jun 7 01:00:08 2016 (r301536) +++ head/usr.sbin/bluetooth/ath3kfw/Makefile Tue Jun 7 04:22:18 2016 (r301537) @@ -3,5 +3,6 @@ PROG= ath3kfw MAN= ath3kfw.8 LIBADD+= usb +SRCS= main.c ath3k_fw.c ath3k_hw.c .include Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_dbg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/ath3k_dbg.h Tue Jun 7 04:22:18 2016 (r301537) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __ATH3K_DEBUG_H__ +#define __ATH3K_DEBUG_H__ + +extern int ath3k_do_debug; +extern int ath3k_do_info; + +#define ath3k_debug(...) if (ath3k_do_debug) fprintf(stderr, __VA_ARGS__) +#define ath3k_err(...) fprintf(stderr, __VA_ARGS__) +#define ath3k_info(...) if (ath3k_do_info) fprintf(stdout, __VA_ARGS__) + +#endif Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.c Tue Jun 7 04:22:18 2016 (r301537) @@ -0,0 +1,114 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ath3k_fw.h" +#include "ath3k_dbg.h" + +int +ath3k_fw_read(struct ath3k_firmware *fw, const char *fwname) +{ + int fd; + struct stat sb; + unsigned char *buf; + ssize_t r; + int i; + + fd = open(fwname, O_RDONLY); + if (fd < 0) { + warn("%s: open: %s", __func__, fwname); + return (0); + } + + if (fstat(fd, &sb) != 0) { + warn("%s: stat: %s", __func__, fwname); + close(fd); + return (0); + } + + buf = calloc(1, sb.st_size); + if (buf == NULL) { + warn("%s: calloc", __func__); + close(fd); + return (0); + } + + i = 0; + /* XXX handle partial reads */ + r = read(fd, buf, sb.st_size); + if (r < 0) { + warn("%s: read", __func__); + free(buf); + close(fd); + return (0); + } + + if (r != sb.st_size) { + fprintf(stderr, "%s: read len %d != file size %d\n", + __func__, + (int) r, + (int) sb.st_size); + free(buf); + close(fd); + return (0); + } + + /* We have everything, so! */ + + bzero(fw, sizeof(*fw)); + + fw->fwname = strdup(fwname); + fw->len = sb.st_size; + fw->size = sb.st_size; + fw->buf = buf; + + close(fd); + return (1); +} + +void +ath3k_fw_free(struct ath3k_firmware *fw) +{ + if (fw->fwname) + free(fw->fwname); + if (fw->buf) + free(fw->buf); + bzero(fw, sizeof(*fw)); +} Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.h Tue Jun 7 04:22:18 2016 (r301537) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __ATH3K_FW_H__ +#define __ATH3K_FW_H__ + +/* + * XXX TODO: ensure that the endian-ness of this stuff is + * correct! + */ +struct ath3k_version { + unsigned int rom_version; + unsigned int build_version; + unsigned int ram_version; + unsigned char ref_clock; + unsigned char reserved[0x07]; +}; + +struct ath3k_firmware { + char *fwname; + int len; /* firmware length */ + int size; /* buffer size */ + unsigned char *buf; +}; + +extern int ath3k_fw_read(struct ath3k_firmware *fw, const char *fwname); +extern void ath3k_fw_free(struct ath3k_firmware *fw); + +#endif Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.c Tue Jun 7 04:22:18 2016 (r301537) @@ -0,0 +1,358 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ath3k_fw.h" +#include "ath3k_hw.h" +#include "ath3k_dbg.h" + +#define XMIN(x, y) ((x) < (y) ? (x) : (y)) + +int +ath3k_load_fwfile(struct libusb_device_handle *hdl, + const struct ath3k_firmware *fw) +{ + int size, count, sent = 0; + int ret, r; + + count = fw->len; + + size = XMIN(count, FW_HDR_SIZE); + + ath3k_debug("%s: file=%s, size=%d\n", + __func__, fw->fwname, count); + + /* + * Flip the device over to configuration mode. + */ + ret = libusb_control_transfer(hdl, + LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, + ATH3K_DNLOAD, + 0, + 0, + fw->buf + sent, + size, + 1000); /* XXX timeout */ + + if (ret != size) { + fprintf(stderr, "Can't switch to config mode; ret=%d\n", + ret); + return (-1); + } + + sent += size; + count -= size; + + /* Load in the rest of the data */ + while (count) { + size = XMIN(count, BULK_SIZE); + ath3k_debug("%s: transferring %d bytes, offset %d\n", + __func__, + sent, + size); + + ret = libusb_bulk_transfer(hdl, + 0x2, + fw->buf + sent, + size, + &r, + 1000); + + if (ret < 0 || r != size) { + fprintf(stderr, "Can't load firmware: err=%s, size=%d\n", + libusb_strerror(ret), + size); + return (-1); + } + sent += size; + count -= size; + } + return (0); +} + +int +ath3k_get_state(struct libusb_device_handle *hdl, unsigned char *state) +{ + int ret; + + ret = libusb_control_transfer(hdl, + LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN, + ATH3K_GETSTATE, + 0, + 0, + state, + 1, + 1000); /* XXX timeout */ + + if (ret < 0) { + fprintf(stderr, + "%s: libusb_control_transfer() failed: code=%d\n", + __func__, + ret); + return (0); + } + + return (ret == 1); +} + +int +ath3k_get_version(struct libusb_device_handle *hdl, + struct ath3k_version *version) +{ + int ret; + + ret = libusb_control_transfer(hdl, + LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN, + ATH3K_GETVERSION, + 0, + 0, + (unsigned char *) version, + sizeof(struct ath3k_version), + 1000); /* XXX timeout */ + + if (ret < 0) { + fprintf(stderr, + "%s: libusb_control_transfer() failed: code=%d\n", + __func__, + ret); + return (0); + } + + /* XXX endian fix! */ + + return (ret == sizeof(struct ath3k_version)); +} + +int +ath3k_load_patch(libusb_device_handle *hdl, const char *fw_path) +{ + int ret; + unsigned char fw_state; + struct ath3k_version fw_ver, pt_ver; + char fwname[FILENAME_MAX]; + struct ath3k_firmware fw; + uint32_t tmp; + + ret = ath3k_get_state(hdl, &fw_state); + if (ret < 0) { + ath3k_err("%s: Can't get state\n", __func__); + return (ret); + } + + if (fw_state & ATH3K_PATCH_UPDATE) { + ath3k_info("%s: Patch already downloaded\n", + __func__); + return (0); + } + + ret = ath3k_get_version(hdl, &fw_ver); + if (ret < 0) { + ath3k_debug("%s: Can't get version\n", __func__); + return (ret); + } + + /* XXX path info? */ + snprintf(fwname, FILENAME_MAX, "%s/ar3k/AthrBT_0x%08x.dfu", + fw_path, + fw_ver.rom_version); + + /* Read in the firmware */ + if (ath3k_fw_read(&fw, fwname) <= 0) { + ath3k_debug("%s: ath3k_fw_read() failed\n", + __func__); + return (-1); + } + + /* + * Extract the ROM/build version from the patch file. + */ + memcpy(&tmp, fw.buf + fw.len - 8, sizeof(tmp)); + pt_ver.rom_version = le32toh(tmp); + memcpy(&tmp, fw.buf + fw.len - 4, sizeof(tmp)); + pt_ver.build_version = le32toh(tmp); + + ath3k_info("%s: file %s: rom_ver=%d, build_ver=%d\n", + __func__, + fwname, + (int) pt_ver.rom_version, + (int) pt_ver.build_version); + + /* Check the ROM/build version against the firmware */ + if ((pt_ver.rom_version != fw_ver.rom_version) || + (pt_ver.build_version <= fw_ver.build_version)) { + ath3k_debug("Patch file version mismatch!\n"); + ath3k_fw_free(&fw); + return (-1); + } + + /* Load in the firmware */ + ret = ath3k_load_fwfile(hdl, &fw); + + /* free it */ + ath3k_fw_free(&fw); + + return (ret); +} + +int +ath3k_load_syscfg(libusb_device_handle *hdl, const char *fw_path) +{ + unsigned char fw_state; + char filename[FILENAME_MAX]; + struct ath3k_firmware fw; + struct ath3k_version fw_ver; + int clk_value, ret; + + ret = ath3k_get_state(hdl, &fw_state); + if (ret < 0) { + ath3k_err("Can't get state to change to load configuration err"); + return (-EBUSY); + } + + ret = ath3k_get_version(hdl, &fw_ver); + if (ret < 0) { + ath3k_err("Can't get version to change to load ram patch err"); + return (ret); + } + + switch (fw_ver.ref_clock) { + case ATH3K_XTAL_FREQ_26M: + clk_value = 26; + break; + case ATH3K_XTAL_FREQ_40M: + clk_value = 40; + break; + case ATH3K_XTAL_FREQ_19P2: + clk_value = 19; + break; + default: + clk_value = 0; + break; +} + + snprintf(filename, FILENAME_MAX, "%s/ar3k/ramps_0x%08x_%d%s", + fw_path, + fw_ver.rom_version, + clk_value, + ".dfu"); + + ath3k_info("%s: syscfg file = %s\n", + __func__, + filename); + + /* Read in the firmware */ + if (ath3k_fw_read(&fw, filename) <= 0) { + ath3k_err("%s: ath3k_fw_read() failed\n", + __func__); + return (-1); + } + + ret = ath3k_load_fwfile(hdl, &fw); + + ath3k_fw_free(&fw); + return (ret); +} + +int +ath3k_set_normal_mode(libusb_device_handle *hdl) +{ + int ret; + unsigned char fw_state; + + ret = ath3k_get_state(hdl, &fw_state); + if (ret < 0) { + ath3k_err("%s: can't get state\n", __func__); + return (ret); + } + + /* + * This isn't a fatal error - the device may have detached + * already. + */ + if ((fw_state & ATH3K_MODE_MASK) == ATH3K_NORMAL_MODE) { + ath3k_debug("%s: firmware is already in normal mode\n", + __func__); + return (0); + } + + ret = libusb_control_transfer(hdl, + LIBUSB_REQUEST_TYPE_VENDOR, /* XXX out direction? */ + ATH3K_SET_NORMAL_MODE, + 0, + 0, + NULL, + 0, + 1000); /* XXX timeout */ + + if (ret < 0) { + ath3k_err("%s: libusb_control_transfer() failed: code=%d\n", + __func__, + ret); + return (0); + } + + return (ret == 0); +} + +int +ath3k_switch_pid(libusb_device_handle *hdl) +{ + int ret; + ret = libusb_control_transfer(hdl, + LIBUSB_REQUEST_TYPE_VENDOR, /* XXX set an out flag? */ + USB_REG_SWITCH_VID_PID, + 0, + 0, + NULL, + 0, + 1000); /* XXX timeout */ + + if (ret < 0) { + ath3k_debug("%s: libusb_control_transfer() failed: code=%d\n", + __func__, + ret); + return (0); + } + + return (ret == 0); +} Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.h Tue Jun 7 04:22:18 2016 (r301537) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __ATH3K_HW_H__ +#define __ATH3K_HW_H__ + +#define ATH3K_DNLOAD 0x01 +#define ATH3K_GETSTATE 0x05 +#define ATH3K_SET_NORMAL_MODE 0x07 +#define ATH3K_GETVERSION 0x09 +#define USB_REG_SWITCH_VID_PID 0x0a + +#define ATH3K_MODE_MASK 0x3F +#define ATH3K_NORMAL_MODE 0x0E + +#define ATH3K_PATCH_UPDATE 0x80 +#define ATH3K_SYSCFG_UPDATE 0x40 + +#define ATH3K_XTAL_FREQ_26M 0x00 +#define ATH3K_XTAL_FREQ_40M 0x01 +#define ATH3K_XTAL_FREQ_19P2 0x02 +#define ATH3K_NAME_LEN 0xFF + +#define USB_REQ_DFU_DNLOAD 1 +#define BULK_SIZE 4096 +#define FW_HDR_SIZE 20 + +extern int ath3k_load_fwfile(struct libusb_device_handle *hdl, + const struct ath3k_firmware *fw); +extern int ath3k_get_state(struct libusb_device_handle *hdl, + unsigned char *state); +extern int ath3k_get_version(struct libusb_device_handle *hdl, + struct ath3k_version *version); +extern int ath3k_load_patch(libusb_device_handle *hdl, const char *fw_path); +extern int ath3k_load_syscfg(libusb_device_handle *hdl, const char *fw_path); +extern int ath3k_set_normal_mode(libusb_device_handle *hdl); +extern int ath3k_switch_pid(libusb_device_handle *hdl); + +#endif Modified: head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 ============================================================================== --- head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 Tue Jun 7 01:00:08 2016 (r301536) +++ head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 Tue Jun 7 04:22:18 2016 (r301537) @@ -1,4 +1,5 @@ .\" Copyright (c) 2010 Maksim Yevmenkin +.\" Copyright (c) 2013, 2016 Adrian Chadd .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,16 +25,16 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2010 +.Dd June 4, 2016 .Dt ATH3KFW 8 .Os .Sh NAME .Nm ath3kfw -.Nd firmware download utility for Atheros AR3011 chip based Bluetooth USB devices +.Nd firmware download utility for Atheros AR3011/AR3012 chip based Bluetooth USB devices .Sh SYNOPSIS .Nm .Fl d Ar device_name -.Fl f Ar firmware_file_name +.Fl f Ar firmware_path .Nm .Fl h .Sh DESCRIPTION @@ -45,23 +46,31 @@ device. .Pp This utility will .Em only -work with Atheros AR3011 chip based Bluetooth USB devices. +work with Atheros AR3011 and AR3012 chip based Bluetooth USB devices. The identification is currently based on USB vendor ID/product ID pair. The vendor ID should be 0x0cf3 .Pq Dv USB_VENDOR_ATHEROS2 -and the product ID should be 0x3000. +and the product ID should be one of the supported devices. .Pp -Firmware files ath3k-1.fw and ath3k-2.fw can be obtained from the -linux-firmware RPM. +Firmware files are available in the linux-firmware RPM. +.Pp +The +.Nm +utility will query the device to determine which firmware image and board +configuration to load in at runtime. .Pp The options are as follows: .Bl -tag -width indent +.It Fl D +Enable verbose debugging. .It Fl d Ar device_name Specify .Xr ugen 4 device name. -.It Fl f Ar firmware_file_name -Specify firmware file name for download. +.It I +Enable informational debugging. +.It Fl f Ar firmware_path +Specify the directory containing the firmware files to search and upload. .It Fl h Display usage message and exit. .El @@ -72,7 +81,10 @@ Display usage message and exit. .Xr ugen 4 , .Xr devd 8 .Sh AUTHORS -.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com +The original utility was written by +.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com . +This was written based on Linux ath3k by +.An Adrian Chadd Aq Mt adrian@freebsd.org . .Sh BUGS Most likely. Please report if found. Added: head/usr.sbin/bluetooth/ath3kfw/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/main.c Tue Jun 7 04:22:18 2016 (r301537) @@ -0,0 +1,394 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ath3k_fw.h" +#include "ath3k_hw.h" +#include "ath3k_dbg.h" + +#define _DEFAULT_ATH3K_FIRMWARE_PATH "/usr/share/firmware/ath3k/" + +int ath3k_do_debug = 0; +int ath3k_do_info = 0; + +struct ath3k_devid { + uint16_t product_id; + uint16_t vendor_id; + int is_3012; +}; + +static struct ath3k_devid ath3k_list[] = { + + /* Atheros AR3012 with sflash firmware*/ + { .vendor_id = 0x0489, .product_id = 0xe04e, .is_3012 = 1 }, + { .vendor_id = 0x0489, .product_id = 0xe04d, .is_3012 = 1 }, + { .vendor_id = 0x0489, .product_id = 0xe056, .is_3012 = 1 }, + { .vendor_id = 0x0489, .product_id = 0xe057, .is_3012 = 1 }, + { .vendor_id = 0x0489, .product_id = 0xe05f, .is_3012 = 1 }, + { .vendor_id = 0x04c5, .product_id = 0x1330, .is_3012 = 1 }, + { .vendor_id = 0x04ca, .product_id = 0x3004, .is_3012 = 1 }, + { .vendor_id = 0x04ca, .product_id = 0x3005, .is_3012 = 1 }, + { .vendor_id = 0x04ca, .product_id = 0x3006, .is_3012 = 1 }, + { .vendor_id = 0x04ca, .product_id = 0x3008, .is_3012 = 1 }, + { .vendor_id = 0x04ca, .product_id = 0x300b, .is_3012 = 1 }, + { .vendor_id = 0x0930, .product_id = 0x0219, .is_3012 = 1 }, + { .vendor_id = 0x0930, .product_id = 0x0220, .is_3012 = 1 }, + { .vendor_id = 0x0b05, .product_id = 0x17d0, .is_3012 = 1 }, + { .vendor_id = 0x0CF3, .product_id = 0x0036, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0x3004, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0x3005, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0x3008, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0x311D, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0x311E, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0x311F, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0x3121, .is_3012 = 1 }, + { .vendor_id = 0x0CF3, .product_id = 0x817a, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0xe004, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0xe005, .is_3012 = 1 }, + { .vendor_id = 0x0cf3, .product_id = 0xe003, .is_3012 = 1 }, + { .vendor_id = 0x13d3, .product_id = 0x3362, .is_3012 = 1 }, + { .vendor_id = 0x13d3, .product_id = 0x3375, .is_3012 = 1 }, + { .vendor_id = 0x13d3, .product_id = 0x3393, .is_3012 = 1 }, + { .vendor_id = 0x13d3, .product_id = 0x3402, .is_3012 = 1 }, + + /* Atheros AR5BBU22 with sflash firmware */ + { .vendor_id = 0x0489, .product_id = 0xE036, .is_3012 = 1 }, + { .vendor_id = 0x0489, .product_id = 0xE03C, .is_3012 = 1 }, +}; + +static int +ath3k_is_3012(struct libusb_device_descriptor *d) +{ + int i; + + /* Search looking for whether it's an AR3012 */ + for (i = 0; i < (int) nitems(ath3k_list); i++) { + if ((ath3k_list[i].product_id == d->idProduct) && + (ath3k_list[i].vendor_id == d->idVendor)) { + fprintf(stderr, "%s: found AR3012\n", __func__); + return (ath3k_list[i].is_3012); + } + } + + /* Not found */ + return (0); +} + +static libusb_device * +ath3k_find_device(libusb_context *ctx, int bus_id, int dev_id) +{ + libusb_device **list, *dev = NULL, *found = NULL; + ssize_t cnt, i; + + cnt = libusb_get_device_list(ctx, &list); + if (cnt < 0) { + ath3k_err("%s: libusb_get_device_list() failed: code %lld\n", + __func__, + (long long int) cnt); + return (NULL); + } + + /* + * XXX TODO: match on the vendor/product id too! + */ + for (i = 0; i < cnt; i++) { + dev = list[i]; + if (bus_id == libusb_get_bus_number(dev) && + dev_id == libusb_get_device_address(dev)) { + /* + * Take a reference so it's not freed later on. + */ + found = libusb_ref_device(dev); + break; + } + } + + libusb_free_device_list(list, 1); + return (found); +} + +static int +ath3k_init_ar3012(libusb_device_handle *hdl, const char *fw_path) +{ + int ret; + + ret = ath3k_load_patch(hdl, fw_path); + if (ret < 0) { + ath3k_err("Loading patch file failed\n"); + return (ret); + } + + ret = ath3k_load_syscfg(hdl, fw_path); + if (ret < 0) { + ath3k_err("Loading sysconfig file failed\n"); + return (ret); + } + + ret = ath3k_set_normal_mode(hdl); + if (ret < 0) { + ath3k_err("Set normal mode failed\n"); + return (ret); + } + + ath3k_switch_pid(hdl); + return (0); +} + +static int +ath3k_init_firmware(libusb_device_handle *hdl, const char *file_prefix) +{ + struct ath3k_firmware fw; + char fwname[FILENAME_MAX]; + int ret; + + /* XXX path info? */ + snprintf(fwname, FILENAME_MAX, "%s/ath3k-1.fw", file_prefix); + + ath3k_debug("%s: loading ath3k-1.fw\n", __func__); + + /* Read in the firmware */ + if (ath3k_fw_read(&fw, fwname) <= 0) { + fprintf(stderr, "%s: ath3k_fw_read() failed\n", + __func__); + return (-1); + } + + /* Load in the firmware */ + ret = ath3k_load_fwfile(hdl, &fw); + + /* free it */ + ath3k_fw_free(&fw); + + return (0); +} + +/* + * Parse ugen name and extract device's bus and address + */ + +static int +parse_ugen_name(char const *ugen, uint8_t *bus, uint8_t *addr) +{ + char *ep; + + if (strncmp(ugen, "ugen", 4) != 0) + return (-1); + + *bus = (uint8_t) strtoul(ugen + 4, &ep, 10); + if (*ep != '.') + return (-1); + + *addr = (uint8_t) strtoul(ep + 1, &ep, 10); + if (*ep != '\0') + return (-1); + + return (0); +} + +static void +usage(void) +{ + fprintf(stderr, + "Usage: ath3kfw (-D) -d ugenX.Y (-f firmware path) (-I)\n"); + fprintf(stderr, " -D: enable debugging\n"); + fprintf(stderr, " -d: device to operate upon\n"); + fprintf(stderr, " -f: firmware path, if not default\n"); + fprintf(stderr, " -I: enable informational output\n"); + exit(127); +} + +int +main(int argc, char *argv[]) +{ + struct libusb_device_descriptor d; + libusb_context *ctx; + libusb_device *dev; + libusb_device_handle *hdl; + unsigned char state; + struct ath3k_version ver; + int r; + uint8_t bus_id = 0, dev_id = 0; + int devid_set = 0; + int n; + char *firmware_path = NULL; + int is_3012 = 0; + + /* libusb setup */ + r = libusb_init(&ctx); + if (r != 0) { + ath3k_err("%s: libusb_init failed: code %d\n", + argv[0], *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jun 7 04:51:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5D35B6DDB1; Tue, 7 Jun 2016 04:51:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90DB31318; Tue, 7 Jun 2016 04:51:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u574pplh089333; Tue, 7 Jun 2016 04:51:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u574poE4089319; Tue, 7 Jun 2016 04:51:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606070451.u574poE4089319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 7 Jun 2016 04:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301538 - in head/sys: dev/cxgb dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/ixl dev/mlx5/mlx5_en dev/qlxgbe dev/qlxge net netinet ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 04:51:52 -0000 Author: sephe Date: Tue Jun 7 04:51:50 2016 New Revision: 301538 URL: https://svnweb.freebsd.org/changeset/base/301538 Log: net: Use M_HASHTYPE_OPAQUE_HASH if the mbuf flowid has hash properties Reviewed by: hps, erj, tuexen Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6688 Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/e1000/if_igb.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixl/ixl_txrx.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxge/qls_isr.c head/sys/net/flowtable.c head/sys/net/if_vxlan.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/ofed/drivers/net/mlx4/en_rx.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/cxgb/cxgb_sge.c Tue Jun 7 04:51:50 2016 (r301538) @@ -2900,7 +2900,8 @@ process_responses(adapter_t *adap, struc eop = get_packet(adap, drop_thresh, qs, mh, r); if (eop) { if (r->rss_hdr.hash_type && !adap->timestamp) { - M_HASHTYPE_SET(mh->mh_head, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mh->mh_head, + M_HASHTYPE_OPAQUE_HASH); mh->mh_head->m_pkthdr.flowid = rss_hash; } } Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/e1000/if_igb.c Tue Jun 7 04:51:50 2016 (r301538) @@ -5154,7 +5154,7 @@ igb_rxeof(struct igb_queue *que, int cou default: /* XXX fallthrough */ M_HASHTYPE_SET(rxr->fmp, - M_HASHTYPE_OPAQUE); + M_HASHTYPE_OPAQUE_HASH); } } else { #ifndef IGB_LEGACY_TX Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jun 7 04:51:50 2016 (r301538) @@ -1300,6 +1300,7 @@ netvsc_recv(struct hv_vmbus_channel *cha struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; int size, do_lro = 0, do_csum = 1; + int hash_type = M_HASHTYPE_OPAQUE_HASH; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return (0); @@ -1430,8 +1431,6 @@ skip: } if (hash_info != NULL && hash_value != NULL) { - int hash_type = M_HASHTYPE_OPAQUE; - rxr->hn_rss_pkts++; m_new->m_pkthdr.flowid = hash_value->hash_value; if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == @@ -1465,14 +1464,15 @@ skip: break; } } - M_HASHTYPE_SET(m_new, hash_type); } else { - if (hash_value != NULL) + if (hash_value != NULL) { m_new->m_pkthdr.flowid = hash_value->hash_value; - else + } else { m_new->m_pkthdr.flowid = rxr->hn_rx_idx; - M_HASHTYPE_SET(m_new, M_HASHTYPE_OPAQUE); + hash_type = M_HASHTYPE_OPAQUE; + } } + M_HASHTYPE_SET(m_new, hash_type); /* * Note: Moved RX completion back to hv_nv_on_receive() so all Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/ixgbe/ix_txrx.c Tue Jun 7 04:51:50 2016 (r301538) @@ -1964,7 +1964,7 @@ ixgbe_rxeof(struct ix_queue *que) #endif default: M_HASHTYPE_SET(sendmp, - M_HASHTYPE_OPAQUE); + M_HASHTYPE_OPAQUE_HASH); } } else { sendmp->m_pkthdr.flowid = que->msix; Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/ixl/ixl_txrx.c Tue Jun 7 04:51:50 2016 (r301538) @@ -1453,10 +1453,10 @@ ixl_ptype_to_hash(u8 ptype) ex = decoded.outer_frag; if (!decoded.known) - return M_HASHTYPE_OPAQUE; + return M_HASHTYPE_OPAQUE_HASH; if (decoded.outer_ip == I40E_RX_PTYPE_OUTER_L2) - return M_HASHTYPE_OPAQUE; + return M_HASHTYPE_OPAQUE_HASH; /* Note: anything that gets to this point is IP */ if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV6) { @@ -1492,7 +1492,7 @@ ixl_ptype_to_hash(u8 ptype) } } /* We should never get here!! */ - return M_HASHTYPE_OPAQUE; + return M_HASHTYPE_OPAQUE_HASH; } #endif /* RSS */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Jun 7 04:51:50 2016 (r301538) @@ -222,11 +222,11 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *c M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV6); break; default: /* Other */ - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE_HASH); break; } #else - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE_HASH); #endif } else { mb->m_pkthdr.flowid = rq->ix; Modified: head/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- head/sys/dev/qlxgbe/ql_isr.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/qlxgbe/ql_isr.c Tue Jun 7 04:51:50 2016 (r301538) @@ -159,7 +159,7 @@ qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); mpf->m_pkthdr.flowid = sgc->rss_hash; - M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH); (*ifp->if_input)(ifp, mpf); @@ -324,7 +324,7 @@ qla_lro_intr(qla_host_t *ha, qla_sgl_lro mpf->m_pkthdr.csum_data = 0xFFFF; mpf->m_pkthdr.flowid = sgc->rss_hash; - M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH); if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); Modified: head/sys/dev/qlxge/qls_isr.c ============================================================================== --- head/sys/dev/qlxge/qls_isr.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/dev/qlxge/qls_isr.c Tue Jun 7 04:51:50 2016 (r301538) @@ -190,7 +190,7 @@ qls_rx_comp(qla_host_t *ha, uint32_t rxr if ((cq_e->flags1 & Q81_RX_FLAGS1_RSS_MATCH_MASK)) { rxr->rss_int++; mp->m_pkthdr.flowid = cq_e->rss; - M_HASHTYPE_SET(mp, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mp, M_HASHTYPE_OPAQUE_HASH); } if (cq_e->flags0 & (Q81_RX_FLAGS0_TE | Q81_RX_FLAGS0_NU | Q81_RX_FLAGS0_IE)) { Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/net/flowtable.c Tue Jun 7 04:51:50 2016 (r301538) @@ -689,7 +689,7 @@ flowtable_lookup(sa_family_t sa, struct return (EHOSTUNREACH); if (M_HASHTYPE_GET(m) == M_HASHTYPE_NONE) { - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE_HASH); m->m_pkthdr.flowid = fle->f_hash; } Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/net/if_vxlan.c Tue Jun 7 04:51:50 2016 (r301538) @@ -2237,8 +2237,7 @@ vxlan_pick_source_port(struct vxlan_soft range = sc->vxl_max_port - sc->vxl_min_port + 1; /* check if flowid is set and not opaque */ - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE && - M_HASHTYPE_GET(m) != M_HASHTYPE_OPAQUE) + if (M_HASHTYPE_ISHASH(m)) hash = m->m_pkthdr.flowid; else hash = jenkins_hash(m->m_data, ETHER_HDR_LEN, Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/netinet/sctp_input.c Tue Jun 7 04:51:50 2016 (r301538) @@ -6236,7 +6236,7 @@ sctp_input(struct mbuf **mp, int *offp, tag = htonl(sh->v_tag); flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); m->m_pkthdr.flowid = flowid; - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE_HASH); } cpu_to_use = sctp_cpuarry[flowid % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/netinet/sctp_pcb.c Tue Jun 7 04:51:50 2016 (r301538) @@ -4070,7 +4070,7 @@ sctp_add_remote_addr(struct sctp_tcb *st net->flowid = stcb->asoc.my_vtag ^ ntohs(stcb->rport) ^ ntohs(stcb->sctp_ep->sctp_lport); - net->flowtype = M_HASHTYPE_OPAQUE; + net->flowtype = M_HASHTYPE_OPAQUE_HASH; if (netp) { *netp = net; } Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_rx.c Tue Jun 7 04:22:18 2016 (r301537) +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Tue Jun 7 04:51:50 2016 (r301538) @@ -619,7 +619,7 @@ int mlx4_en_process_rx_cq(struct net_dev /* forward Toeplitz compatible hash value */ mb->m_pkthdr.flowid = be32_to_cpu(cqe->immed_rss_invalid); - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE_HASH); mb->m_pkthdr.rcvif = dev; if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) { From owner-svn-src-all@freebsd.org Tue Jun 7 05:08:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BF95B6E179; Tue, 7 Jun 2016 05:08:26 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BECAC1B76; Tue, 7 Jun 2016 05:08:25 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5758ONH093698; Tue, 7 Jun 2016 05:08:24 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5758OoF093694; Tue, 7 Jun 2016 05:08:24 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201606070508.u5758OoF093694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 7 Jun 2016 05:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301539 - in head/sys: dev/gpio kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 05:08:26 -0000 Author: mmel Date: Tue Jun 7 05:08:24 2016 New Revision: 301539 URL: https://svnweb.freebsd.org/changeset/base/301539 Log: INTRNG: As follow up of r301451, implement mapping and configuration of gpio pin interrupts by new way. Note: This removes last consumer of intr_ddata machinery and we remove it in separate commit. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Jun 7 04:51:50 2016 (r301538) +++ head/sys/dev/gpio/gpiobus.c Tue Jun 7 05:08:24 2016 (r301539) @@ -79,22 +79,47 @@ static int gpiobus_pin_toggle(device_t, * data will be moved into struct resource. */ #ifdef INTRNG +static void +gpio_destruct_map_data(struct intr_map_data *map_data) +{ + + KASSERT(map_data->type == INTR_MAP_DATA_GPIO, + ("%s: bad map_data type %d", __func__, map_data->type)); + + free(map_data, M_DEVBUF); +} + struct resource * gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode) { - u_int irqnum; - - /* - * Allocate new fictitious interrupt number and store configuration - * into it. - */ - irqnum = intr_gpio_map_irq(pin->dev, pin->pin, pin->flags, intr_mode); - if (irqnum == INTR_IRQ_INVALID) + int rv; + u_int irq; + struct intr_map_data_gpio *gpio_data; + struct resource *res; + + gpio_data = malloc(sizeof(*gpio_data), M_DEVBUF, M_WAITOK | M_ZERO); + gpio_data->hdr.type = INTR_MAP_DATA_GPIO; + gpio_data->hdr.destruct = gpio_destruct_map_data; + gpio_data->gpio_pin_num = pin->pin; + gpio_data->gpio_pin_flags = pin->flags; + gpio_data->gpio_intr_mode = intr_mode; + + rv = intr_map_irq(pin->dev, 0, (struct intr_map_data *)gpio_data, + &irq); + if (rv != 0) { + gpio_destruct_map_data((struct intr_map_data *)gpio_data); return (NULL); + } - return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, - irqnum, irqnum, 1, alloc_flags)); + res = bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, irq, irq, 1, + alloc_flags); + if (res == NULL) { + gpio_destruct_map_data((struct intr_map_data *)gpio_data); + return (NULL); + } + rman_set_virtual(res, gpio_data); + return (res); } #else struct resource * Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Tue Jun 7 04:51:50 2016 (r301538) +++ head/sys/dev/gpio/gpiobusvar.h Tue Jun 7 05:08:24 2016 (r301539) @@ -70,6 +70,13 @@ struct gpiobus_pin_data char *name; /* pin name. */ }; +struct intr_map_data_gpio { + struct intr_map_data hdr; + u_int gpio_pin_num; + u_int gpio_pin_flags; + u_int gpio_intr_mode; +}; + struct gpiobus_softc { struct mtx sc_mtx; /* bus mutex */ Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Tue Jun 7 04:51:50 2016 (r301538) +++ head/sys/kern/subr_intr.c Tue Jun 7 05:08:24 2016 (r301539) @@ -147,7 +147,9 @@ struct intr_dev_data { }; static struct intr_dev_data *intr_ddata_tab[2 * NIRQ]; +#if 0 static u_int intr_ddata_first_unused; +#endif #define IRQ_DDATA_BASE 10000 CTASSERT(IRQ_DDATA_BASE > nitems(irq_sources)); @@ -534,6 +536,7 @@ intr_isrc_init_on_cpu(struct intr_irqsrc } #endif +#if 0 static struct intr_dev_data * intr_ddata_alloc(u_int extsize) { @@ -556,6 +559,7 @@ intr_ddata_alloc(u_int extsize) ddata->idd_data = (struct intr_map_data *)((uintptr_t)ddata + size); return (ddata); } +#endif static struct intr_irqsrc * intr_ddata_lookup(u_int irq, struct intr_map_data **datap) @@ -620,30 +624,6 @@ intr_acpi_map_irq(device_t dev, u_int ir } #endif -/* - * Store GPIO interrupt decription in framework and return unique interrupt - * number (resource handle) associated with it. - */ -u_int -intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, u_int intr_mode) -{ - struct intr_dev_data *ddata; - struct intr_map_data_gpio *dag; - - ddata = intr_ddata_alloc(sizeof(struct intr_map_data_gpio)); - if (ddata == NULL) - return (INTR_IRQ_INVALID); /* no space left */ - - ddata->idd_dev = dev; - ddata->idd_data->type = INTR_MAP_DATA_GPIO; - - dag = (struct intr_map_data_gpio *)ddata->idd_data; - dag->gpio_pin_num = pin_num; - dag->gpio_pin_flags = pin_flags; - dag->gpio_intr_mode = intr_mode; - return (ddata->idd_irq); -} - #ifdef INTR_SOLO /* * Setup filter into interrupt source. Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Tue Jun 7 04:51:50 2016 (r301538) +++ head/sys/sys/intr.h Tue Jun 7 05:08:24 2016 (r301539) @@ -43,13 +43,6 @@ struct intr_map_data_acpi { }; #endif -struct intr_map_data_gpio { - struct intr_map_data hdr; - u_int gpio_pin_num; - u_int gpio_pin_flags; - u_int gpio_intr_mode; -}; - #ifdef notyet #define INTR_SOLO INTR_MD1 typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); @@ -129,9 +122,6 @@ u_int intr_acpi_map_irq(device_t, u_int, enum intr_trigger); #endif -u_int intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, - u_int intr_mode); - #ifdef SMP int intr_bind_irq(device_t, struct resource *, int); From owner-svn-src-all@freebsd.org Tue Jun 7 05:52:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9763EB6EA9A; Tue, 7 Jun 2016 05:52:53 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3811F38; Tue, 7 Jun 2016 05:52:52 +0000 (UTC) (envelope-from dwmalone@maths.tcd.ie) Received: from salmon.maths.tcd.ie (localhost [127.0.0.1]) by salmon.maths.tcd.ie (Postfix) with ESMTP id D1BEC159165; Tue, 7 Jun 2016 06:52:49 +0100 (IST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=maths.tcd.ie; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received:received; s=20150418; t= 1465278762; x=1467093163; bh=KRvV2BlAds2lm+DgYWx9AkudgeMihpHHsO0 LOVMaVRE=; b=IjL8Wwp5WhHLg1v7DmDU/FZYZGd/5i27nZ0k4Yl1HkJuY2CMuP4 Njf6JY9XC260xFrbeRTQvAmfNyTh+/aSTM0CIiPvHCI8dEXavbhOo4sLgTnGVfD0 8xbnvC/BJsEa8VH09iir+AW3mb58wSVfEjgcM6VKGy/PiV+JmTmyBQtw= X-Virus-Scanned: amavisd-new at maths.tcd.ie Received: from salmon.maths.tcd.ie ([127.0.0.1]) by salmon.maths.tcd.ie (salmon.maths.tcd.ie [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XCfxYcAJl_q0; Tue, 7 Jun 2016 06:52:42 +0100 (IST) Received: from smtp.maths.tcd.ie (walton.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510a]) by salmon.maths.tcd.ie (Postfix) with ESMTP id 0F730159127; Tue, 7 Jun 2016 06:52:42 +0100 (IST) Received: by smtp.maths.tcd.ie (Postfix, from userid 238) id 785AC730B4; Tue, 7 Jun 2016 06:52:41 +0100 (IST) Date: Tue, 7 Jun 2016 06:52:40 +0100 From: David Malone To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r299954 - stable/10/sbin/restore Message-ID: <20160607055240.GA53732@walton.maths.tcd.ie> References: <201605161629.u4GGTumH048298@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605161629.u4GGTumH048298@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 05:52:53 -0000 Hi Pedro, The OpenBSD commit message said off_t, but you commit and commit message says size_t, which won't be bigger than a long on some of our platforms. Should it have been off_t, or did I misunderstand something? David. > Author: pfg > Date: Mon May 16 16:29:56 2016 > New Revision: 299954 > URL: https://svnweb.freebsd.org/changeset/base/299954 > > Log: > MFC r298901: > restore: promote some getfiles() parameters to size_t. > > This is based on a change from OpenBSD: > > "Fix restore so that it can actually restore files larger than 4GB by > changing the type of "size" to off_t in getfiles() plus little dependent > type cleanup, from Daniel Lucq." > > It is an important for machines with 32 bit longs. > While here unsign the flags, also from OpenBSD. > > Obtained from: OpenBSD (with changes) > > Modified: > stable/10/sbin/restore/dirs.c > stable/10/sbin/restore/extern.h > stable/10/sbin/restore/tape.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sbin/restore/dirs.c > ============================================================================== > --- stable/10/sbin/restore/dirs.c Mon May 16 16:16:46 2016 (r299953) > +++ stable/10/sbin/restore/dirs.c Mon May 16 16:29:56 2016 (r299954) > @@ -85,7 +85,7 @@ struct modeinfo { > mode_t mode; > uid_t uid; > gid_t gid; > - int flags; > + u_int flags; > int extsize; > }; > > @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct > static void flushent(void); > static struct inotab *inotablookup(ino_t); > static RST_DIR *opendirfile(const char *); > -static void putdir(char *, long); > -static void putdirattrs(char *, long); > +static void putdir(char *, size_t); > +static void putdirattrs(char *, size_t); > static void putent(struct direct *); > static void rst_seekdir(RST_DIR *, long, long); > static long rst_telldir(RST_DIR *); > @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) > * Put the directory entries in the directory file > */ > static void > -putdir(char *buf, long size) > +putdir(char *buf, size_t size) > { > struct direct *dp; > - long loc, i; > + size_t loc, i; > > for (loc = 0; loc < size; ) { > dp = (struct direct *)(buf + loc); > @@ -356,12 +356,12 @@ putdir(char *buf, long size) > "reclen not multiple of 4 "); > if (dp->d_reclen < DIRSIZ(0, dp)) > vprintf(stdout, > - "reclen less than DIRSIZ (%d < %zu) ", > + "reclen less than DIRSIZ (%u < %zu) ", > dp->d_reclen, DIRSIZ(0, dp)); > #if NAME_MAX < 255 > if (dp->d_namlen > NAME_MAX) > vprintf(stdout, > - "reclen name too big (%d > %d) ", > + "reclen name too big (%u > %u) ", > dp->d_namlen, NAME_MAX); > #endif > vprintf(stdout, "\n"); > @@ -418,7 +418,7 @@ flushent(void) > * Save extended attributes for a directory entry to a file. > */ > static void > -putdirattrs(char *buf, long size) > +putdirattrs(char *buf, size_t size) > { > > if (mf != NULL && fwrite(buf, size, 1, mf) != 1) > > Modified: stable/10/sbin/restore/extern.h > ============================================================================== > --- stable/10/sbin/restore/extern.h Mon May 16 16:16:46 2016 (r299953) > +++ stable/10/sbin/restore/extern.h Mon May 16 16:29:56 2016 (r299954) > @@ -54,8 +54,8 @@ void freeentry(struct entry *); > void freename(char *); > int genliteraldir(char *, ino_t); > char *gentempname(struct entry *); > -void getfile(void (*)(char *, long), void (*)(char *, long), > - void (*)(char *, long)); > +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), > + void (*)(char *, size_t)); > void getvol(long); > void initsymtable(char *); > int inodetype(ino_t); > @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); > void treescan(char *, ino_t, long (*)(char *, ino_t, int)); > ino_t upperbnd(ino_t); > long verifyfile(char *, ino_t, int); > -void xtrnull(char *, long); > +void xtrnull(char *, size_t); > > /* From ../dump/dumprmt.c */ > void rmtclose(void); > > Modified: stable/10/sbin/restore/tape.c > ============================================================================== > --- stable/10/sbin/restore/tape.c Mon May 16 16:16:46 2016 (r299953) > +++ stable/10/sbin/restore/tape.c Mon May 16 16:29:56 2016 (r299954) > @@ -104,7 +104,7 @@ static int checksum(int *); > static void findinode(struct s_spcl *); > static void findtapeblksize(void); > static char *setupextattr(int); > -static void xtrattr(char *, long); > +static void xtrattr(char *, size_t); > static void set_extattr_link(char *, void *, int); > static void set_extattr_fd(int, char *, void *, int); > static int gethead(struct s_spcl *); > @@ -114,12 +114,12 @@ static u_long swabl(u_long); > static u_char *swablong(u_char *, int); > static u_char *swabshort(u_char *, int); > static void terminateinput(void); > -static void xtrfile(char *, long); > -static void xtrlnkfile(char *, long); > -static void xtrlnkskip(char *, long); > -static void xtrmap(char *, long); > -static void xtrmapskip(char *, long); > -static void xtrskip(char *, long); > +static void xtrfile(char *, size_t); > +static void xtrlnkfile(char *, size_t); > +static void xtrlnkskip(char *, size_t); > +static void xtrmap(char *, size_t); > +static void xtrmapskip(char *, size_t); > +static void xtrskip(char *, size_t); > > /* > * Set up an input source > @@ -564,7 +564,7 @@ printdumpinfo(void) > int > extractfile(char *name) > { > - int flags; > + u_int flags; > uid_t uid; > gid_t gid; > mode_t mode; > @@ -931,13 +931,13 @@ skipfile(void) > * to the skip function. > */ > void > -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), > - void (*skip)(char *, long)) > +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), > + void (*skip)(char *, size_t)) > { > int i; > - off_t size; > + volatile off_t size; > int curblk, attrsize; > - void (*fillit)(char *, long); > + void (*fillit)(char *, size_t); > static char clearedbuf[MAXBSIZE]; > char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; > char junk[TP_BSIZE]; > @@ -1066,7 +1066,7 @@ setupextattr(int extsize) > * Extract the next block of extended attributes. > */ > static void > -xtrattr(char *buf, long size) > +xtrattr(char *buf, size_t size) > { > > if (extloc + size > extbufsize) > @@ -1079,7 +1079,7 @@ xtrattr(char *buf, long size) > * Write out the next block of a file. > */ > static void > -xtrfile(char *buf, long size) > +xtrfile(char *buf, size_t size) > { > > if (Nflag) > @@ -1096,7 +1096,7 @@ xtrfile(char *buf, long size) > */ > /* ARGSUSED */ > static void > -xtrskip(char *buf, long size) > +xtrskip(char *buf, size_t size) > { > > if (lseek(ofile, size, SEEK_CUR) == -1) { > @@ -1111,7 +1111,7 @@ xtrskip(char *buf, long size) > * Collect the next block of a symbolic link. > */ > static void > -xtrlnkfile(char *buf, long size) > +xtrlnkfile(char *buf, size_t size) > { > > pathlen += size; > @@ -1128,7 +1128,7 @@ xtrlnkfile(char *buf, long size) > */ > /* ARGSUSED */ > static void > -xtrlnkskip(char *buf, long size) > +xtrlnkskip(char *buf, size_t size) > { > > fprintf(stderr, "unallocated block in symbolic link %s\n", > @@ -1140,7 +1140,7 @@ xtrlnkskip(char *buf, long size) > * Collect the next block of a bit map. > */ > static void > -xtrmap(char *buf, long size) > +xtrmap(char *buf, size_t size) > { > > memmove(map, buf, size); > @@ -1152,7 +1152,7 @@ xtrmap(char *buf, long size) > */ > /* ARGSUSED */ > static void > -xtrmapskip(char *buf, long size) > +xtrmapskip(char *buf, size_t size) > { > > panic("hole in map\n"); > @@ -1164,7 +1164,7 @@ xtrmapskip(char *buf, long size) > */ > /* ARGSUSED */ > void > -xtrnull(char *buf, long size) > +xtrnull(char *buf, size_t size) > { > > return; > From owner-svn-src-all@freebsd.org Tue Jun 7 06:42:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A169B6D4A5; Tue, 7 Jun 2016 06:42:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34B2D19A5; Tue, 7 Jun 2016 06:42:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u576gZQi030310; Tue, 7 Jun 2016 06:42:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u576gZIQ030309; Tue, 7 Jun 2016 06:42:35 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606070642.u576gZIQ030309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 7 Jun 2016 06:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301540 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 06:42:36 -0000 Author: np Date: Tue Jun 7 06:42:35 2016 New Revision: 301540 URL: https://svnweb.freebsd.org/changeset/base/301540 Log: cxgbe(4): Provide information about traffic classes in the sysctl mib. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jun 7 05:08:24 2016 (r301539) +++ head/sys/dev/cxgbe/t4_main.c Tue Jun 7 06:42:35 2016 (r301540) @@ -496,6 +496,7 @@ static int sysctl_tp_la(SYSCTL_HANDLER_A static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); +static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); #endif #ifdef TCP_OFFLOAD static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); @@ -5034,8 +5035,10 @@ cxgbe_sysctls(struct port_info *pi) { struct sysctl_ctx_list *ctx; struct sysctl_oid *oid; - struct sysctl_oid_list *children; + struct sysctl_oid_list *children, *children2; struct adapter *sc = pi->adapter; + int i; + char name[16]; ctx = device_get_sysctl_ctx(pi->dev); @@ -5064,6 +5067,29 @@ cxgbe_sysctls(struct port_info *pi) port_top_speed(pi), "max speed (in Gbps)"); /* + * dev.(cxgbe|cxl).X.tc. + */ + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "tc", CTLFLAG_RD, NULL, + "Tx scheduler traffic classes"); + for (i = 0; i < sc->chip_params->nsched_cls; i++) { + struct tx_sched_class *tc = &pi->tc[i]; + + snprintf(name, sizeof(name), "%d", i); + children2 = SYSCTL_CHILDREN(SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(oid), OID_AUTO, name, CTLFLAG_RD, NULL, + "traffic class")); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "flags", CTLFLAG_RD, + &tc->flags, 0, "flags"); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "refcount", + CTLFLAG_RD, &tc->refcount, 0, "references to this class"); +#ifdef SBUF_DRAIN + SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "params", + CTLTYPE_STRING | CTLFLAG_RD, sc, (pi->port_id << 16) | i, + sysctl_tc_params, "A", "traffic class parameters"); +#endif + } + + /* * dev.cxgbe.X.stats. */ oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD, @@ -7456,6 +7482,101 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) return (rc); } + +static int +sysctl_tc_params(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct tx_sched_class *tc; + struct t4_sched_class_params p; + struct sbuf *sb; + int i, rc, port_id, flags, mbps, gbps; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + port_id = arg2 >> 16; + MPASS(port_id < sc->params.nports); + MPASS(sc->port[port_id] != NULL); + i = arg2 & 0xffff; + MPASS(i < sc->chip_params->nsched_cls); + tc = &sc->port[port_id]->tc[i]; + + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4tc_p"); + if (rc) + goto done; + flags = tc->flags; + p = tc->params; + end_synchronized_op(sc, LOCK_HELD); + + if ((flags & TX_SC_OK) == 0) { + sbuf_printf(sb, "none"); + goto done; + } + + if (p.level == SCHED_CLASS_LEVEL_CL_WRR) { + sbuf_printf(sb, "cl-wrr weight %u", p.weight); + goto done; + } else if (p.level == SCHED_CLASS_LEVEL_CL_RL) + sbuf_printf(sb, "cl-rl"); + else if (p.level == SCHED_CLASS_LEVEL_CH_RL) + sbuf_printf(sb, "ch-rl"); + else { + rc = ENXIO; + goto done; + } + + if (p.ratemode == SCHED_CLASS_RATEMODE_REL) { + /* XXX: top speed or actual link speed? */ + gbps = port_top_speed(sc->port[port_id]); + sbuf_printf(sb, " %u%% of %uGbps", p.maxrate, gbps); + } + else if (p.ratemode == SCHED_CLASS_RATEMODE_ABS) { + switch (p.rateunit) { + case SCHED_CLASS_RATEUNIT_BITS: + mbps = p.maxrate / 1000; + gbps = p.maxrate / 1000000; + if (p.maxrate == gbps * 1000000) + sbuf_printf(sb, " %uGbps", gbps); + else if (p.maxrate == mbps * 1000) + sbuf_printf(sb, " %uMbps", mbps); + else + sbuf_printf(sb, " %uKbps", p.maxrate); + break; + case SCHED_CLASS_RATEUNIT_PKTS: + sbuf_printf(sb, " %upps", p.maxrate); + break; + default: + rc = ENXIO; + goto done; + } + } + + switch (p.mode) { + case SCHED_CLASS_MODE_CLASS: + sbuf_printf(sb, " aggregate"); + break; + case SCHED_CLASS_MODE_FLOW: + sbuf_printf(sb, " per-flow"); + break; + default: + rc = ENXIO; + goto done; + } + +done: + if (rc == 0) + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} #endif #ifdef TCP_OFFLOAD From owner-svn-src-all@freebsd.org Tue Jun 7 07:04:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D69EB6D947; Tue, 7 Jun 2016 07:04:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E23D131E; Tue, 7 Jun 2016 07:04:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57745Ab037590; Tue, 7 Jun 2016 07:04:05 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57745dw037588; Tue, 7 Jun 2016 07:04:05 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606070704.u57745dw037588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 7 Jun 2016 07:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301541 - in head: share/man/man5 usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 07:04:06 -0000 Author: araujo Date: Tue Jun 7 07:04:05 2016 New Revision: 301541 URL: https://svnweb.freebsd.org/changeset/base/301541 Log: Bump date in both manpages. Reported by: rodrigc Modified: head/share/man/man5/rc.conf.5 head/usr.sbin/ypldap/ypldap.8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Jun 7 06:42:35 2016 (r301540) +++ head/share/man/man5/rc.conf.5 Tue Jun 7 07:04:05 2016 (r301541) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2016 +.Dd June 8, 2016 .Dt RC.CONF 5 .Os .Sh NAME Modified: head/usr.sbin/ypldap/ypldap.8 ============================================================================== --- head/usr.sbin/ypldap/ypldap.8 Tue Jun 7 06:42:35 2016 (r301540) +++ head/usr.sbin/ypldap/ypldap.8 Tue Jun 7 07:04:05 2016 (r301541) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 27 2015 $ +.Dd $Mdocdate: June 8 2016 $ .Dt YPLDAP 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Tue Jun 7 07:48:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2107B6E2A1; Tue, 7 Jun 2016 07:48:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3B061A57; Tue, 7 Jun 2016 07:48:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u577mabD052559; Tue, 7 Jun 2016 07:48:36 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u577maaW052558; Tue, 7 Jun 2016 07:48:36 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606070748.u577maaW052558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 7 Jun 2016 07:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301542 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 07:48:37 -0000 Author: np Date: Tue Jun 7 07:48:36 2016 New Revision: 301542 URL: https://svnweb.freebsd.org/changeset/base/301542 Log: cxgbe(4): A couple of fixes to set_sched_queue. - Validate the scheduling class against the actual limit (which is chip specific) instead of a magic number. - Return an error if an attempt is made to manipulate the tx queues of a VI that hasn't been initialized. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jun 7 07:04:05 2016 (r301541) +++ head/sys/dev/cxgbe/t4_main.c Tue Jun 7 07:48:36 2016 (r301542) @@ -8575,11 +8575,6 @@ set_sched_queue(struct adapter *sc, stru if (rc) return (rc); - if (!(sc->flags & FULL_INIT_DONE)) { - rc = EAGAIN; - goto done; - } - if (p->port >= sc->params.nports) { rc = EINVAL; goto done; @@ -8588,7 +8583,14 @@ set_sched_queue(struct adapter *sc, stru /* XXX: Only supported for the main VI. */ pi = sc->port[p->port]; vi = &pi->vi[0]; - if (!in_range(p->queue, 0, vi->ntxq - 1) || !in_range(p->cl, 0, 7)) { + if (!(vi->flags & VI_INIT_DONE)) { + /* tx queues not set up yet */ + rc = EAGAIN; + goto done; + } + + if (!in_range(p->queue, 0, vi->ntxq - 1) || + !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) { rc = EINVAL; goto done; } From owner-svn-src-all@freebsd.org Tue Jun 7 09:03:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0F27B6A965; Tue, 7 Jun 2016 09:03:28 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2F21312; Tue, 7 Jun 2016 09:03:28 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5793RGw081952; Tue, 7 Jun 2016 09:03:27 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5793Rt4081950; Tue, 7 Jun 2016 09:03:27 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201606070903.u5793Rt4081950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 7 Jun 2016 09:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301543 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 09:03:28 -0000 Author: skra Date: Tue Jun 7 09:03:27 2016 New Revision: 301543 URL: https://svnweb.freebsd.org/changeset/base/301543 Log: Remove temporary solution for storing interrupt mapping data as it's not needed after r301451 and follow-ups r301453, r301539. This makes INTRNG clean of all additions related to various buses. Modified: head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Tue Jun 7 07:48:36 2016 (r301542) +++ head/sys/kern/subr_intr.c Tue Jun 7 09:03:27 2016 (r301543) @@ -35,10 +35,8 @@ __FBSDID("$FreeBSD$"); * - to complete things for removable PICs */ -#include "opt_acpi.h" #include "opt_ddb.h" #include "opt_hwpmc_hooks.h" -#include "opt_platform.h" #include #include @@ -123,37 +121,6 @@ static struct mtx isrc_table_lock; static struct intr_irqsrc *irq_sources[NIRQ]; u_int irq_next_free; -/* - * XXX - All stuff around struct intr_dev_data is considered as temporary - * until better place for storing struct intr_map_data will be find. - * - * For now, there are two global interrupt numbers spaces: - * <0, NIRQ) ... interrupts without config data - * managed in irq_sources[] - * IRQ_DDATA_BASE + <0, 2 * NIRQ) ... interrupts with config data - * managed in intr_ddata_tab[] - * - * Read intr_ddata_lookup() to see how these spaces are worked with. - * Note that each interrupt number from second space duplicates some number - * from first space at this moment. An interrupt number from first space can - * be duplicated even multiple times in second space. - */ -struct intr_dev_data { - device_t idd_dev; - intptr_t idd_xref; - u_int idd_irq; - struct intr_map_data * idd_data; - struct intr_irqsrc * idd_isrc; -}; - -static struct intr_dev_data *intr_ddata_tab[2 * NIRQ]; -#if 0 -static u_int intr_ddata_first_unused; -#endif - -#define IRQ_DDATA_BASE 10000 -CTASSERT(IRQ_DDATA_BASE > nitems(irq_sources)); - #ifdef SMP static boolean_t irq_assign_cpu = FALSE; #endif @@ -536,94 +503,6 @@ intr_isrc_init_on_cpu(struct intr_irqsrc } #endif -#if 0 -static struct intr_dev_data * -intr_ddata_alloc(u_int extsize) -{ - struct intr_dev_data *ddata; - size_t size; - - size = sizeof(*ddata); - ddata = malloc(size + extsize, M_INTRNG, M_WAITOK | M_ZERO); - - mtx_lock(&isrc_table_lock); - if (intr_ddata_first_unused >= nitems(intr_ddata_tab)) { - mtx_unlock(&isrc_table_lock); - free(ddata, M_INTRNG); - return (NULL); - } - intr_ddata_tab[intr_ddata_first_unused] = ddata; - ddata->idd_irq = IRQ_DDATA_BASE + intr_ddata_first_unused++; - mtx_unlock(&isrc_table_lock); - - ddata->idd_data = (struct intr_map_data *)((uintptr_t)ddata + size); - return (ddata); -} -#endif - -static struct intr_irqsrc * -intr_ddata_lookup(u_int irq, struct intr_map_data **datap) -{ - int error; - struct intr_irqsrc *isrc; - struct intr_dev_data *ddata; - - isrc = isrc_lookup(irq); - if (isrc != NULL) { - if (datap != NULL) - *datap = NULL; - return (isrc); - } - - if (irq < IRQ_DDATA_BASE) - return (NULL); - - irq -= IRQ_DDATA_BASE; - if (irq >= nitems(intr_ddata_tab)) - return (NULL); - - ddata = intr_ddata_tab[irq]; - if (ddata->idd_isrc == NULL) { - error = intr_map_irq(ddata->idd_dev, ddata->idd_xref, - ddata->idd_data, &irq); - if (error != 0) - return (NULL); - ddata->idd_isrc = isrc_lookup(irq); - } - if (datap != NULL) - *datap = ddata->idd_data; - return (ddata->idd_isrc); -} - -#ifdef DEV_ACPI -/* - * Map interrupt source according to ACPI info into framework. If such mapping - * does not exist, create it. Return unique interrupt number (resource handle) - * associated with mapped interrupt source. - */ -u_int -intr_acpi_map_irq(device_t dev, u_int irq, enum intr_polarity pol, - enum intr_trigger trig) -{ - struct intr_map_data_acpi *daa; - struct intr_dev_data *ddata; - - ddata = intr_ddata_alloc(sizeof(struct intr_map_data_acpi)); - if (ddata == NULL) - return (INTR_IRQ_INVALID); /* no space left */ - - ddata->idd_dev = dev; - ddata->idd_data->type = INTR_MAP_DATA_ACPI; - - daa = (struct intr_map_data_acpi *)ddata->idd_data; - daa->irq = irq; - daa->pol = pol; - daa->trig = trig; - - return (ddata->idd_irq); -} -#endif - #ifdef INTR_SOLO /* * Setup filter into interrupt source. @@ -1054,14 +933,11 @@ intr_alloc_irq(device_t dev, struct reso KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - data = rman_get_virtual(res); - if (data == NULL) - isrc = intr_ddata_lookup(rman_get_start(res), &data); - else - isrc = isrc_lookup(rman_get_start(res)); + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL) return (EINVAL); + data = rman_get_virtual(res); return (PIC_ALLOC_INTR(isrc->isrc_dev, isrc, res, data)); } @@ -1074,14 +950,11 @@ intr_release_irq(device_t dev, struct re KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - data = rman_get_virtual(res); - if (data == NULL) - isrc = intr_ddata_lookup(rman_get_start(res), &data); - else - isrc = isrc_lookup(rman_get_start(res)); + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL) return (EINVAL); + data = rman_get_virtual(res); return (PIC_RELEASE_INTR(isrc->isrc_dev, isrc, res, data)); } @@ -1097,14 +970,11 @@ intr_setup_irq(device_t dev, struct reso KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - data = rman_get_virtual(res); - if (data == NULL) - isrc = intr_ddata_lookup(rman_get_start(res), &data); - else - isrc = isrc_lookup(rman_get_start(res)); + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL) return (EINVAL); + data = rman_get_virtual(res); name = device_get_nameunit(dev); #ifdef INTR_SOLO @@ -1161,14 +1031,12 @@ intr_teardown_irq(device_t dev, struct r KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - data = rman_get_virtual(res); - if (data == NULL) - isrc = intr_ddata_lookup(rman_get_start(res), &data); - else - isrc = isrc_lookup(rman_get_start(res)); + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); + data = rman_get_virtual(res); + #ifdef INTR_SOLO if (isrc->isrc_filter != NULL) { if (isrc != cookie) @@ -1211,7 +1079,7 @@ intr_describe_irq(device_t dev, struct r KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = intr_ddata_lookup(rman_get_start(res), NULL); + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); #ifdef INTR_SOLO @@ -1243,7 +1111,7 @@ intr_bind_irq(device_t dev, struct resou KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = intr_ddata_lookup(rman_get_start(res), NULL); + isrc = isrc_lookup(rman_get_start(res)); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); #ifdef INTR_SOLO Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Tue Jun 7 07:48:36 2016 (r301542) +++ head/sys/sys/intr.h Tue Jun 7 09:03:27 2016 (r301543) @@ -34,15 +34,6 @@ #define INTR_IRQ_INVALID 0xFFFFFFFF -#ifdef DEV_ACPI -struct intr_map_data_acpi { - struct intr_map_data hdr; - u_int irq; - enum intr_polarity pol; - enum intr_trigger trig; -}; -#endif - #ifdef notyet #define INTR_SOLO INTR_MD1 typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); @@ -117,11 +108,6 @@ int intr_map_msi(device_t, device_t, int int intr_alloc_msix(device_t, device_t, intptr_t, int *); int intr_release_msix(device_t, device_t, intptr_t, int); -#ifdef DEV_ACPI -u_int intr_acpi_map_irq(device_t, u_int, enum intr_polarity, - enum intr_trigger); -#endif - #ifdef SMP int intr_bind_irq(device_t, struct resource *, int); From owner-svn-src-all@freebsd.org Tue Jun 7 13:10:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F218AB6DB3D; Tue, 7 Jun 2016 13:10:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A918F134E; Tue, 7 Jun 2016 13:10:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57DADEc071046; Tue, 7 Jun 2016 13:10:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57DADST071044; Tue, 7 Jun 2016 13:10:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606071310.u57DADST071044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 7 Jun 2016 13:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301544 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 13:10:15 -0000 Author: hselasky Date: Tue Jun 7 13:10:13 2016 New Revision: 301544 URL: https://svnweb.freebsd.org/changeset/base/301544 Log: Fallback to arc4rand() in the LinuxKPI when read_random() returns zero. This can happen for virtual machines. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/etherdevice.h head/sys/compat/linuxkpi/common/include/linux/random.h Modified: head/sys/compat/linuxkpi/common/include/linux/etherdevice.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/etherdevice.h Tue Jun 7 09:03:27 2016 (r301543) +++ head/sys/compat/linuxkpi/common/include/linux/etherdevice.h Tue Jun 7 13:10:13 2016 (r301544) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2015-2016 Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -102,7 +102,8 @@ eth_broadcast_addr(u8 *pa) static inline void random_ether_addr(u8 * dst) { - read_random(dst, 6); + if (read_random(dst, 6) == 0) + arc4rand(dst, 6, 0); dst[0] &= 0xfe; dst[0] |= 0x02; Modified: head/sys/compat/linuxkpi/common/include/linux/random.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/random.h Tue Jun 7 09:03:27 2016 (r301543) +++ head/sys/compat/linuxkpi/common/include/linux/random.h Tue Jun 7 13:10:13 2016 (r301544) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,11 +32,13 @@ #define _LINUX_RANDOM_H_ #include +#include static inline void get_random_bytes(void *buf, int nbytes) { - read_random(buf, nbytes); + if (read_random(buf, nbytes) == 0) + arc4rand(buf, nbytes, 0); } #endif /* _LINUX_RANDOM_H_ */ From owner-svn-src-all@freebsd.org Tue Jun 7 13:58:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1905B6EC07; Tue, 7 Jun 2016 13:58:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7564617AD; Tue, 7 Jun 2016 13:58:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57DwqQI088896; Tue, 7 Jun 2016 13:58:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57DwqRv088891; Tue, 7 Jun 2016 13:58:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606071358.u57DwqRv088891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 7 Jun 2016 13:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301545 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 13:58:53 -0000 Author: hselasky Date: Tue Jun 7 13:58:52 2016 New Revision: 301545 URL: https://svnweb.freebsd.org/changeset/base/301545 Log: Add SR-IOV guest support to the mlx5en driver. This patch adds the missing pieces needed for device setup using the mlx5en driver inside a virtual machine which is providing hardware access through SR-IOV. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/vport.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Tue Jun 7 13:10:13 2016 (r301544) +++ head/sys/dev/mlx5/driver.h Tue Jun 7 13:58:52 2016 (r301545) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Jun 7 13:10:13 2016 (r301544) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Jun 7 13:58:52 2016 (r301545) @@ -471,6 +471,241 @@ int mlx5_set_nic_vport_promisc(struct ml return mlx5_modify_nic_vport_context(mdev, in, sizeof(in)); } EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_promisc); + +int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev, + u32 vport, + enum mlx5_list_type list_type, + u8 addr_list[][ETH_ALEN], + int *list_size) +{ + u32 in[MLX5_ST_SZ_DW(query_nic_vport_context_in)]; + void *nic_vport_ctx; + int max_list_size; + int req_list_size; + u8 *mac_addr; + int out_sz; + void *out; + int err; + int i; + + req_list_size = *list_size; + + max_list_size = (list_type == MLX5_NIC_VPORT_LIST_TYPE_UC) ? + 1 << MLX5_CAP_GEN_MAX(dev, log_max_current_uc_list) : + 1 << MLX5_CAP_GEN_MAX(dev, log_max_current_mc_list); + + if (req_list_size > max_list_size) { + mlx5_core_warn(dev, "Requested list size (%d) > (%d) max_list_size\n", + req_list_size, max_list_size); + req_list_size = max_list_size; + } + + out_sz = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + req_list_size * MLX5_ST_SZ_BYTES(mac_address_layout); + + memset(in, 0, sizeof(in)); + out = kzalloc(out_sz, GFP_KERNEL); + if (!out) + return -ENOMEM; + + MLX5_SET(query_nic_vport_context_in, in, opcode, + MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT); + MLX5_SET(query_nic_vport_context_in, in, allowed_list_type, list_type); + MLX5_SET(query_nic_vport_context_in, in, vport_number, vport); + + if (vport) + MLX5_SET(query_nic_vport_context_in, in, other_vport, 1); + + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, out_sz); + if (err) + goto out; + + nic_vport_ctx = MLX5_ADDR_OF(query_nic_vport_context_out, out, + nic_vport_context); + req_list_size = MLX5_GET(nic_vport_context, nic_vport_ctx, + allowed_list_size); + + *list_size = req_list_size; + for (i = 0; i < req_list_size; i++) { + mac_addr = MLX5_ADDR_OF(nic_vport_context, + nic_vport_ctx, + current_uc_mac_address[i]) + 2; + ether_addr_copy(addr_list[i], mac_addr); + } +out: + kfree(out); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_mac_list); + +int mlx5_modify_nic_vport_mac_list(struct mlx5_core_dev *dev, + enum mlx5_list_type list_type, + u8 addr_list[][ETH_ALEN], + int list_size) +{ + u32 out[MLX5_ST_SZ_DW(modify_nic_vport_context_out)]; + void *nic_vport_ctx; + int max_list_size; + int in_sz; + void *in; + int err; + int i; + + max_list_size = list_type == MLX5_NIC_VPORT_LIST_TYPE_UC ? + 1 << MLX5_CAP_GEN(dev, log_max_current_uc_list) : + 1 << MLX5_CAP_GEN(dev, log_max_current_mc_list); + + if (list_size > max_list_size) + return -ENOSPC; + + in_sz = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + list_size * MLX5_ST_SZ_BYTES(mac_address_layout); + + memset(out, 0, sizeof(out)); + in = kzalloc(in_sz, GFP_KERNEL); + if (!in) + return -ENOMEM; + + MLX5_SET(modify_nic_vport_context_in, in, opcode, + MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT); + MLX5_SET(modify_nic_vport_context_in, in, + field_select.addresses_list, 1); + + nic_vport_ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, + nic_vport_context); + + MLX5_SET(nic_vport_context, nic_vport_ctx, + allowed_list_type, list_type); + MLX5_SET(nic_vport_context, nic_vport_ctx, + allowed_list_size, list_size); + + for (i = 0; i < list_size; i++) { + u8 *curr_mac = MLX5_ADDR_OF(nic_vport_context, + nic_vport_ctx, + current_uc_mac_address[i]) + 2; + ether_addr_copy(curr_mac, addr_list[i]); + } + + err = mlx5_cmd_exec_check_status(dev, in, in_sz, out, sizeof(out)); + kfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_mac_list); + +int mlx5_query_nic_vport_vlan_list(struct mlx5_core_dev *dev, + u32 vport, + u16 *vlan_list, + int *list_size) +{ + u32 in[MLX5_ST_SZ_DW(query_nic_vport_context_in)]; + void *nic_vport_ctx; + int max_list_size; + int req_list_size; + int out_sz; + void *out; + void *vlan_addr; + int err; + int i; + + req_list_size = *list_size; + + max_list_size = 1 << MLX5_CAP_GEN_MAX(dev, log_max_vlan_list); + + if (req_list_size > max_list_size) { + mlx5_core_warn(dev, "Requested list size (%d) > (%d) max_list_size\n", + req_list_size, max_list_size); + req_list_size = max_list_size; + } + + out_sz = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + req_list_size * MLX5_ST_SZ_BYTES(vlan_layout); + + memset(in, 0, sizeof(in)); + out = kzalloc(out_sz, GFP_KERNEL); + if (!out) + return -ENOMEM; + + MLX5_SET(query_nic_vport_context_in, in, opcode, + MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT); + MLX5_SET(query_nic_vport_context_in, in, allowed_list_type, + MLX5_NIC_VPORT_CONTEXT_ALLOWED_LIST_TYPE_VLAN_LIST); + MLX5_SET(query_nic_vport_context_in, in, vport_number, vport); + + if (vport) + MLX5_SET(query_nic_vport_context_in, in, other_vport, 1); + + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, out_sz); + if (err) + goto out; + + nic_vport_ctx = MLX5_ADDR_OF(query_nic_vport_context_out, out, + nic_vport_context); + req_list_size = MLX5_GET(nic_vport_context, nic_vport_ctx, + allowed_list_size); + + *list_size = req_list_size; + for (i = 0; i < req_list_size; i++) { + vlan_addr = MLX5_ADDR_OF(nic_vport_context, nic_vport_ctx, + current_uc_mac_address[i]); + vlan_list[i] = MLX5_GET(vlan_layout, vlan_addr, vlan); + } +out: + kfree(out); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_vlan_list); + +int mlx5_modify_nic_vport_vlans(struct mlx5_core_dev *dev, + u16 vlans[], + int list_size) +{ + u32 out[MLX5_ST_SZ_DW(modify_nic_vport_context_out)]; + void *nic_vport_ctx; + int max_list_size; + int in_sz; + void *in; + int err; + int i; + + max_list_size = 1 << MLX5_CAP_GEN(dev, log_max_vlan_list); + + if (list_size > max_list_size) + return -ENOSPC; + + in_sz = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + list_size * MLX5_ST_SZ_BYTES(vlan_layout); + + memset(out, 0, sizeof(out)); + in = kzalloc(in_sz, GFP_KERNEL); + if (!in) + return -ENOMEM; + + MLX5_SET(modify_nic_vport_context_in, in, opcode, + MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT); + MLX5_SET(modify_nic_vport_context_in, in, + field_select.addresses_list, 1); + + nic_vport_ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, + nic_vport_context); + + MLX5_SET(nic_vport_context, nic_vport_ctx, + allowed_list_type, MLX5_NIC_VPORT_LIST_TYPE_VLAN); + MLX5_SET(nic_vport_context, nic_vport_ctx, + allowed_list_size, list_size); + + for (i = 0; i < list_size; i++) { + void *vlan_addr = MLX5_ADDR_OF(nic_vport_context, + nic_vport_ctx, + current_uc_mac_address[i]); + MLX5_SET(vlan_layout, vlan_addr, vlan, vlans[i]); + } + + err = mlx5_cmd_exec_check_status(dev, in, in_sz, out, sizeof(out)); + kfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_vlans); + int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_dev *mdev, int vport, u8 *addr) { @@ -785,6 +1020,129 @@ int mlx5_set_eswitch_cvlan_info(struct m } EXPORT_SYMBOL_GPL(mlx5_set_eswitch_cvlan_info); +int mlx5_arm_vport_context_events(struct mlx5_core_dev *mdev, + u8 vport, + u32 events_mask) +{ + u32 *in; + u32 inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in); + void *nic_vport_ctx; + int err; + + in = mlx5_vzalloc(inlen); + if (!in) + return -ENOMEM; + + MLX5_SET(modify_nic_vport_context_in, + in, + opcode, + MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT); + MLX5_SET(modify_nic_vport_context_in, + in, + field_select.change_event, + 1); + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, other_vport, 1); + nic_vport_ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, + in, + nic_vport_context); + + MLX5_SET(nic_vport_context, nic_vport_ctx, arm_change_event, 1); + + if (events_mask & MLX5_UC_ADDR_CHANGE) + MLX5_SET(nic_vport_context, + nic_vport_ctx, + event_on_uc_address_change, + 1); + if (events_mask & MLX5_MC_ADDR_CHANGE) + MLX5_SET(nic_vport_context, + nic_vport_ctx, + event_on_mc_address_change, + 1); + if (events_mask & MLX5_VLAN_CHANGE) + MLX5_SET(nic_vport_context, + nic_vport_ctx, + event_on_vlan_change, + 1); + if (events_mask & MLX5_PROMISC_CHANGE) + MLX5_SET(nic_vport_context, + nic_vport_ctx, + event_on_promisc_change, + 1); + if (events_mask & MLX5_MTU_CHANGE) + MLX5_SET(nic_vport_context, + nic_vport_ctx, + event_on_mtu, + 1); + + err = mlx5_modify_nic_vport_context(mdev, in, inlen); + + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_arm_vport_context_events); + +int mlx5_query_vport_promisc(struct mlx5_core_dev *mdev, + u32 vport, + u8 *promisc_uc, + u8 *promisc_mc, + u8 *promisc_all) +{ + u32 *out; + int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out); + int err; + + out = kzalloc(outlen, GFP_KERNEL); + if (!out) + return -ENOMEM; + + err = mlx5_query_nic_vport_context(mdev, vport, out, outlen); + if (err) + goto out; + + *promisc_uc = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.promisc_uc); + *promisc_mc = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.promisc_mc); + *promisc_all = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.promisc_all); + +out: + kfree(out); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_promisc); + +int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev *mdev, + int promisc_uc, + int promisc_mc, + int promisc_all) +{ + void *in; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in); + int err; + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_err(mdev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, field_select.promisc, 1); + MLX5_SET(modify_nic_vport_context_in, in, + nic_vport_context.promisc_uc, promisc_uc); + MLX5_SET(modify_nic_vport_context_in, in, + nic_vport_context.promisc_mc, promisc_mc); + MLX5_SET(modify_nic_vport_context_in, in, + nic_vport_context.promisc_all, promisc_all); + + err = mlx5_modify_nic_vport_context(mdev, in, inlen); + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_promisc); + int mlx5_query_vport_counter(struct mlx5_core_dev *dev, u8 port_num, u16 vport_num, void *out, int out_size) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Tue Jun 7 13:10:13 2016 (r301544) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Tue Jun 7 13:58:52 2016 (r301545) @@ -390,6 +390,49 @@ add_eth_addr_rule_out: return (err); } +static int mlx5e_vport_context_update_vlans(struct mlx5e_priv *priv) +{ + struct ifnet *ifp = priv->ifp; + int max_list_size; + int list_size; + u16 *vlans; + int vlan; + int err; + int i; + + list_size = 0; + for_each_set_bit(vlan, priv->vlan.active_vlans, VLAN_N_VID) + list_size++; + + max_list_size = 1 << MLX5_CAP_GEN(priv->mdev, log_max_vlan_list); + + if (list_size > max_list_size) { + if_printf(ifp, + "ifnet vlans list size (%d) > (%d) max vport list size, some vlans will be dropped\n", + list_size, max_list_size); + list_size = max_list_size; + } + + vlans = kcalloc(list_size, sizeof(*vlans), GFP_KERNEL); + if (!vlans) + return -ENOMEM; + + i = 0; + for_each_set_bit(vlan, priv->vlan.active_vlans, VLAN_N_VID) { + if (i >= list_size) + break; + vlans[i++] = vlan; + } + + err = mlx5_modify_nic_vport_vlans(priv->mdev, vlans, list_size); + if (err) + if_printf(ifp, "Failed to modify vport vlans list err(%d)\n", + err); + + kfree(vlans); + return err; +} + enum mlx5e_vlan_rule_type { MLX5E_VLAN_RULE_TYPE_UNTAGGED, MLX5E_VLAN_RULE_TYPE_ANY_VID, @@ -448,6 +491,7 @@ mlx5e_add_vlan_rule(struct mlx5e_priv *p outer_headers.first_vid); MLX5_SET(fte_match_param, match_value, outer_headers.first_vid, vid); + mlx5e_vport_context_update_vlans(priv); break; } @@ -478,6 +522,7 @@ mlx5e_del_vlan_rule(struct mlx5e_priv *p case MLX5E_VLAN_RULE_TYPE_MATCH_VID: mlx5_del_flow_table_entry(priv->ft.vlan, priv->vlan.active_vlans_ft_ix[vid]); + mlx5e_vport_context_update_vlans(priv); break; } } @@ -628,6 +673,91 @@ mlx5e_sync_ifp_addr(struct mlx5e_priv *p if_maddr_runlock(ifp); } +static void mlx5e_fill_addr_array(struct mlx5e_priv *priv, int list_type, + u8 addr_array[][ETH_ALEN], int size) +{ + bool is_uc = (list_type == MLX5_NIC_VPORT_LIST_TYPE_UC); + struct ifnet *ifp = priv->ifp; + struct mlx5e_eth_addr_hash_node *hn; + struct mlx5e_eth_addr_hash_head *addr_list; + struct mlx5e_eth_addr_hash_node *tmp; + int i = 0; + int hi; + + addr_list = is_uc ? priv->eth_addr.if_uc : priv->eth_addr.if_mc; + + if (is_uc) /* Make sure our own address is pushed first */ + ether_addr_copy(addr_array[i++], IF_LLADDR(ifp)); + else if (priv->eth_addr.broadcast_enabled) + ether_addr_copy(addr_array[i++], ifp->if_broadcastaddr); + + mlx5e_for_each_hash_node(hn, tmp, addr_list, hi) { + if (ether_addr_equal(IF_LLADDR(ifp), hn->ai.addr)) + continue; + if (i >= size) + break; + ether_addr_copy(addr_array[i++], hn->ai.addr); + } +} + +static void mlx5e_vport_context_update_addr_list(struct mlx5e_priv *priv, + int list_type) +{ + bool is_uc = (list_type == MLX5_NIC_VPORT_LIST_TYPE_UC); + struct mlx5e_eth_addr_hash_node *hn; + u8 (*addr_array)[ETH_ALEN] = NULL; + struct mlx5e_eth_addr_hash_head *addr_list; + struct mlx5e_eth_addr_hash_node *tmp; + int max_size; + int size; + int err; + int hi; + + size = is_uc ? 0 : (priv->eth_addr.broadcast_enabled ? 1 : 0); + max_size = is_uc ? + 1 << MLX5_CAP_GEN(priv->mdev, log_max_current_uc_list) : + 1 << MLX5_CAP_GEN(priv->mdev, log_max_current_mc_list); + + addr_list = is_uc ? priv->eth_addr.if_uc : priv->eth_addr.if_mc; + mlx5e_for_each_hash_node(hn, tmp, addr_list, hi) + size++; + + if (size > max_size) { + if_printf(priv->ifp, + "ifp %s list size (%d) > (%d) max vport list size, some addresses will be dropped\n", + is_uc ? "UC" : "MC", size, max_size); + size = max_size; + } + + if (size) { + addr_array = kcalloc(size, ETH_ALEN, GFP_KERNEL); + if (!addr_array) { + err = -ENOMEM; + goto out; + } + mlx5e_fill_addr_array(priv, list_type, addr_array, size); + } + + err = mlx5_modify_nic_vport_mac_list(priv->mdev, list_type, addr_array, size); +out: + if (err) + if_printf(priv->ifp, + "Failed to modify vport %s list err(%d)\n", + is_uc ? "UC" : "MC", err); + kfree(addr_array); +} + +static void mlx5e_vport_context_update(struct mlx5e_priv *priv) +{ + struct mlx5e_eth_addr_db *ea = &priv->eth_addr; + + mlx5e_vport_context_update_addr_list(priv, MLX5_NIC_VPORT_LIST_TYPE_UC); + mlx5e_vport_context_update_addr_list(priv, MLX5_NIC_VPORT_LIST_TYPE_MC); + mlx5_modify_nic_vport_promisc(priv->mdev, 0, + ea->allmulti_enabled, + ea->promisc_enabled); +} + static void mlx5e_apply_ifp_addr(struct mlx5e_priv *priv) { @@ -701,6 +831,8 @@ mlx5e_set_rx_mode_core(struct mlx5e_priv ea->promisc_enabled = promisc_enabled; ea->allmulti_enabled = allmulti_enabled; ea->broadcast_enabled = broadcast_enabled; + + mlx5e_vport_context_update(priv); } void Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Jun 7 13:10:13 2016 (r301544) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Jun 7 13:58:52 2016 (r301545) @@ -3001,6 +3001,13 @@ mlx5e_create_ifp(struct mlx5_core_dev *m } mlx5_query_nic_vport_mac_address(priv->mdev, 0, dev_addr); + /* check if we should generate a random MAC address */ + if (MLX5_CAP_GEN(priv->mdev, vport_group_manager) == 0 && + is_zero_ether_addr(dev_addr)) { + random_ether_addr(dev_addr); + if_printf(ifp, "Assigned random MAC address\n"); + } + /* set default MTU */ mlx5e_set_dev_port_mtu(ifp, ifp->if_mtu); Modified: head/sys/dev/mlx5/vport.h ============================================================================== --- head/sys/dev/mlx5/vport.h Tue Jun 7 13:10:13 2016 (r301544) +++ head/sys/dev/mlx5/vport.h Tue Jun 7 13:58:52 2016 (r301545) @@ -38,6 +38,18 @@ int mlx5_vport_query_out_of_rx_buffer(st u32 *out_of_rx_buffer); u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod); +int mlx5_arm_vport_context_events(struct mlx5_core_dev *mdev, + u8 vport, + u32 events_mask); +int mlx5_query_vport_promisc(struct mlx5_core_dev *mdev, + u32 vport, + u8 *promisc_uc, + u8 *promisc_mc, + u8 *promisc_all); +int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev *mdev, + int promisc_uc, + int promisc_mc, + int promisc_all); int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, u32 vport, u8 *addr); int mlx5_set_nic_vport_current_mac(struct mlx5_core_dev *mdev, int vport, @@ -49,6 +61,22 @@ int mlx5_set_nic_vport_mc_list(struct ml int mlx5_set_nic_vport_promisc(struct mlx5_core_dev *mdev, int vport, bool promisc_mc, bool promisc_uc, bool promisc_all); +int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev, + u32 vport, + enum mlx5_list_type list_type, + u8 addr_list[][ETH_ALEN], + int *list_size); +int mlx5_modify_nic_vport_mac_list(struct mlx5_core_dev *dev, + enum mlx5_list_type list_type, + u8 addr_list[][ETH_ALEN], + int list_size); +int mlx5_query_nic_vport_vlan_list(struct mlx5_core_dev *dev, + u32 vport, + u16 *vlan_list, + int *list_size); +int mlx5_modify_nic_vport_vlans(struct mlx5_core_dev *dev, + u16 vlans[], + int list_size); int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_dev *mdev, int vport, u8 *addr); int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev); From owner-svn-src-all@freebsd.org Tue Jun 7 14:11:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0084B6EFC4; Tue, 7 Jun 2016 14:11:16 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0FC91291; Tue, 7 Jun 2016 14:11:16 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57EBFFC093320; Tue, 7 Jun 2016 14:11:15 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57EBFmH093319; Tue, 7 Jun 2016 14:11:15 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201606071411.u57EBFmH093319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Tue, 7 Jun 2016 14:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301546 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 14:11:16 -0000 Author: skreuzer (doc,ports committer) Date: Tue Jun 7 14:11:15 2016 New Revision: 301546 URL: https://svnweb.freebsd.org/changeset/base/301546 Log: Document 300779, Dummynet AQM version 0.2.1 Approved by: re (gjb, implicit, relnotes) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 7 13:58:52 2016 (r301545) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 7 14:11:15 2016 (r301546) @@ -1771,6 +1771,10 @@ + Dummynet AQM, an independent implementation of + CoDel and FQ-CoDel for ipfw/dummynet has been imported to the base + system. + From owner-svn-src-all@freebsd.org Tue Jun 7 14:21:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D6FB6D2B5 for ; Tue, 7 Jun 2016 14:21:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E197A1B7F for ; Tue, 7 Jun 2016 14:21:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465309316; bh=CgzcogzWNJzI7Gh46+6Ju5A4UlB9IUsB2KpK3GVlfac=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=b+L0Aep6MKz6QLHbszmiC6iqAp8T4ja0teQhVb9z91pqy33cUr/hkSQPttqZJ3SErBZk6bYNfBlMiIqfPbjfPRlG4Kj4amKVqSWjlzIiHZipFN5/vyNBLQi+hFcUGemzRfdD1v7ggabrWo0mQN/lAW8AEHLd9nGDRUTSLNfeqpgLs17+86817R9QFq/vCjdeIGL/YIQY2eUY/7iT1SbLfq13lFrSuqQftzZiiJmrITm8RARyNUJ/wCDrBC9LCy0JB0xFHoBTj6+cDhQf4/0tmtA9vJcubCsFQ/8jJPdXIyNXiBWXg5UZ5BRbghTa6j8Wa58doHw/VamZNiFgR8kF/g== Received: from [66.196.81.170] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 Received: from [98.139.211.205] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 X-Yahoo-Newman-Id: 163321.90188.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: rQDRkKoVM1l_KvnSZYd3cswUwcLDq8x1_Z1zCWBEAdciUha OhxSX7aJf9J_ELQnbWQzFt_p7AqVxRG5wB_3DxFk3o5qcuuH5Sy3eiRF0KDD 9NheBkpVY3vNpcOKPVlzObeTQK64dF_l1etfFgHOZpXoHM2Q5xpyBAatvCPS QvFVG6Rd2OvG9uEmAsWqE7BcHwtmawdKOrWEKYBA_GlIOtw6JBlv2rcHhcVi Cqz4qYul3PgM_8002wKQErR80cETAVCuNgJXBhn_OTw__ZtYBpPWkyeiz3Kn nDaNKUTwx_nydjl.DJq34.TRYZ4yZeHRcR93T9GmqDni6vG3Lzdce4unu3Mj GBtGJ_Fm1GHbeFzsjen1u1OcgV_m0YkeFsBNdX5m7pIpX9eMHdVcpqZysEHP 4JvdQKBzLy2ouWSX2K4o.AkjVV4eKvukE3xCuWpCB4aX2eBUxBX1191A6GjD ZmHgkn48QKS7Tb7N0rvkShEYiYAxavGytRw.ufXwbF8KNWWMG_2R4nyyrcVC qDppsAHQ0VxTq.XnpuPYVE17uyxdbvnKI X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r299954 - stable/10/sbin/restore To: David Malone References: <201605161629.u4GGTumH048298@repo.freebsd.org> <20160607055240.GA53732@walton.maths.tcd.ie> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: Pedro Giffuni Message-ID: <1601b9c2-41a8-03e4-fa8f-3ccf4785ecd4@FreeBSD.org> Date: Tue, 7 Jun 2016 09:21:16 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160607055240.GA53732@walton.maths.tcd.ie> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 14:21:59 -0000 H David; On 06/07/16 00:52, David Malone wrote: > Hi Pedro, > > The OpenBSD commit message said off_t, but you commit and commit > message says size_t, which won't be bigger than a long on some of > our platforms. Should it have been off_t, or did I misunderstand > something? > You didn't misunderstand anything. The OpenBSD commit logs says off_t but their commit also has size_t's. I didn't feel like changing their commit log but still wanted to keep the "spirit" of the change and give them credit. size_t is bigger on the platforms that matter, plus it is unsigned. Pedro. > David. >> Author: pfg >> Date: Mon May 16 16:29:56 2016 >> New Revision: 299954 >> URL: https://svnweb.freebsd.org/changeset/base/299954 >> >> Log: >> MFC r298901: >> restore: promote some getfiles() parameters to size_t. >> >> This is based on a change from OpenBSD: >> >> "Fix restore so that it can actually restore files larger than 4GB by >> changing the type of "size" to off_t in getfiles() plus little dependent >> type cleanup, from Daniel Lucq." >> >> It is an important for machines with 32 bit longs. >> While here unsign the flags, also from OpenBSD. >> >> Obtained from: OpenBSD (with changes) >> >> Modified: >> stable/10/sbin/restore/dirs.c >> stable/10/sbin/restore/extern.h >> stable/10/sbin/restore/tape.c >> Directory Properties: >> stable/10/ (props changed) >> >> Modified: stable/10/sbin/restore/dirs.c >> ============================================================================== >> --- stable/10/sbin/restore/dirs.c Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/dirs.c Mon May 16 16:29:56 2016 (r299954) >> @@ -85,7 +85,7 @@ struct modeinfo { >> mode_t mode; >> uid_t uid; >> gid_t gid; >> - int flags; >> + u_int flags; >> int extsize; >> }; >> >> @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct >> static void flushent(void); >> static struct inotab *inotablookup(ino_t); >> static RST_DIR *opendirfile(const char *); >> -static void putdir(char *, long); >> -static void putdirattrs(char *, long); >> +static void putdir(char *, size_t); >> +static void putdirattrs(char *, size_t); >> static void putent(struct direct *); >> static void rst_seekdir(RST_DIR *, long, long); >> static long rst_telldir(RST_DIR *); >> @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) >> * Put the directory entries in the directory file >> */ >> static void >> -putdir(char *buf, long size) >> +putdir(char *buf, size_t size) >> { >> struct direct *dp; >> - long loc, i; >> + size_t loc, i; >> >> for (loc = 0; loc < size; ) { >> dp = (struct direct *)(buf + loc); >> @@ -356,12 +356,12 @@ putdir(char *buf, long size) >> "reclen not multiple of 4 "); >> if (dp->d_reclen < DIRSIZ(0, dp)) >> vprintf(stdout, >> - "reclen less than DIRSIZ (%d < %zu) ", >> + "reclen less than DIRSIZ (%u < %zu) ", >> dp->d_reclen, DIRSIZ(0, dp)); >> #if NAME_MAX < 255 >> if (dp->d_namlen > NAME_MAX) >> vprintf(stdout, >> - "reclen name too big (%d > %d) ", >> + "reclen name too big (%u > %u) ", >> dp->d_namlen, NAME_MAX); >> #endif >> vprintf(stdout, "\n"); >> @@ -418,7 +418,7 @@ flushent(void) >> * Save extended attributes for a directory entry to a file. >> */ >> static void >> -putdirattrs(char *buf, long size) >> +putdirattrs(char *buf, size_t size) >> { >> >> if (mf != NULL && fwrite(buf, size, 1, mf) != 1) >> >> Modified: stable/10/sbin/restore/extern.h >> ============================================================================== >> --- stable/10/sbin/restore/extern.h Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/extern.h Mon May 16 16:29:56 2016 (r299954) >> @@ -54,8 +54,8 @@ void freeentry(struct entry *); >> void freename(char *); >> int genliteraldir(char *, ino_t); >> char *gentempname(struct entry *); >> -void getfile(void (*)(char *, long), void (*)(char *, long), >> - void (*)(char *, long)); >> +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), >> + void (*)(char *, size_t)); >> void getvol(long); >> void initsymtable(char *); >> int inodetype(ino_t); >> @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); >> void treescan(char *, ino_t, long (*)(char *, ino_t, int)); >> ino_t upperbnd(ino_t); >> long verifyfile(char *, ino_t, int); >> -void xtrnull(char *, long); >> +void xtrnull(char *, size_t); >> >> /* From ../dump/dumprmt.c */ >> void rmtclose(void); >> >> Modified: stable/10/sbin/restore/tape.c >> ============================================================================== >> --- stable/10/sbin/restore/tape.c Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/tape.c Mon May 16 16:29:56 2016 (r299954) >> @@ -104,7 +104,7 @@ static int checksum(int *); >> static void findinode(struct s_spcl *); >> static void findtapeblksize(void); >> static char *setupextattr(int); >> -static void xtrattr(char *, long); >> +static void xtrattr(char *, size_t); >> static void set_extattr_link(char *, void *, int); >> static void set_extattr_fd(int, char *, void *, int); >> static int gethead(struct s_spcl *); >> @@ -114,12 +114,12 @@ static u_long swabl(u_long); >> static u_char *swablong(u_char *, int); >> static u_char *swabshort(u_char *, int); >> static void terminateinput(void); >> -static void xtrfile(char *, long); >> -static void xtrlnkfile(char *, long); >> -static void xtrlnkskip(char *, long); >> -static void xtrmap(char *, long); >> -static void xtrmapskip(char *, long); >> -static void xtrskip(char *, long); >> +static void xtrfile(char *, size_t); >> +static void xtrlnkfile(char *, size_t); >> +static void xtrlnkskip(char *, size_t); >> +static void xtrmap(char *, size_t); >> +static void xtrmapskip(char *, size_t); >> +static void xtrskip(char *, size_t); >> >> /* >> * Set up an input source >> @@ -564,7 +564,7 @@ printdumpinfo(void) >> int >> extractfile(char *name) >> { >> - int flags; >> + u_int flags; >> uid_t uid; >> gid_t gid; >> mode_t mode; >> @@ -931,13 +931,13 @@ skipfile(void) >> * to the skip function. >> */ >> void >> -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), >> - void (*skip)(char *, long)) >> +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), >> + void (*skip)(char *, size_t)) >> { >> int i; >> - off_t size; >> + volatile off_t size; >> int curblk, attrsize; >> - void (*fillit)(char *, long); >> + void (*fillit)(char *, size_t); >> static char clearedbuf[MAXBSIZE]; >> char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; >> char junk[TP_BSIZE]; >> @@ -1066,7 +1066,7 @@ setupextattr(int extsize) >> * Extract the next block of extended attributes. >> */ >> static void >> -xtrattr(char *buf, long size) >> +xtrattr(char *buf, size_t size) >> { >> >> if (extloc + size > extbufsize) >> @@ -1079,7 +1079,7 @@ xtrattr(char *buf, long size) >> * Write out the next block of a file. >> */ >> static void >> -xtrfile(char *buf, long size) >> +xtrfile(char *buf, size_t size) >> { >> >> if (Nflag) >> @@ -1096,7 +1096,7 @@ xtrfile(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrskip(char *buf, long size) >> +xtrskip(char *buf, size_t size) >> { >> >> if (lseek(ofile, size, SEEK_CUR) == -1) { >> @@ -1111,7 +1111,7 @@ xtrskip(char *buf, long size) >> * Collect the next block of a symbolic link. >> */ >> static void >> -xtrlnkfile(char *buf, long size) >> +xtrlnkfile(char *buf, size_t size) >> { >> >> pathlen += size; >> @@ -1128,7 +1128,7 @@ xtrlnkfile(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrlnkskip(char *buf, long size) >> +xtrlnkskip(char *buf, size_t size) >> { >> >> fprintf(stderr, "unallocated block in symbolic link %s\n", >> @@ -1140,7 +1140,7 @@ xtrlnkskip(char *buf, long size) >> * Collect the next block of a bit map. >> */ >> static void >> -xtrmap(char *buf, long size) >> +xtrmap(char *buf, size_t size) >> { >> >> memmove(map, buf, size); >> @@ -1152,7 +1152,7 @@ xtrmap(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrmapskip(char *buf, long size) >> +xtrmapskip(char *buf, size_t size) >> { >> >> panic("hole in map\n"); >> @@ -1164,7 +1164,7 @@ xtrmapskip(char *buf, long size) >> */ >> /* ARGSUSED */ >> void >> -xtrnull(char *buf, long size) >> +xtrnull(char *buf, size_t size) >> { >> >> return; >> From owner-svn-src-all@freebsd.org Tue Jun 7 14:37:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 539C5B6D815; Tue, 7 Jun 2016 14:37:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB5813D2; Tue, 7 Jun 2016 14:37:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57EbivC003581; Tue, 7 Jun 2016 14:37:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57EbiO6003579; Tue, 7 Jun 2016 14:37:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606071437.u57EbiO6003579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Jun 2016 14:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301548 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 14:37:45 -0000 Author: pfg Date: Tue Jun 7 14:37:43 2016 New Revision: 301548 URL: https://svnweb.freebsd.org/changeset/base/301548 Log: ext2fs: cleanup generation number management. Ext2/3/4 manages generation numbers differently than UFS so adopt some rules that should work well. When allocating a new inode, make sure we generate a "good" random value specifically avoiding zero. Don't interfere with the numbers that are already generated in the filesystem: ext2fs doesn't have the backwards compatibility issues where there were no generation numbers. Reviewed by: kevlo MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Tue Jun 7 14:16:10 2016 (r301547) +++ head/sys/fs/ext2fs/ext2_alloc.c Tue Jun 7 14:37:43 2016 (r301548) @@ -407,9 +407,11 @@ ext2_valloc(struct vnode *pvp, int mode, /* * Set up a new generation number for this inode. + * Avoid zero values. */ - while (ip->i_gen == 0 || ++ip->i_gen == 0) + do { ip->i_gen = arc4random(); + } while ( ip->i_gen == 0); vfs_timestamp(&ts); ip->i_birthtime = ts.tv_sec; Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Tue Jun 7 14:16:10 2016 (r301547) +++ head/sys/fs/ext2fs/ext2_vfsops.c Tue Jun 7 14:37:43 2016 (r301548) @@ -993,16 +993,6 @@ ext2_vget(struct mount *mp, ino_t ino, i * Finish inode initialization. */ - /* - * Set up a generation number for this inode if it does not - * already have one. This should only happen on old filesystems. - */ - if (ip->i_gen == 0) { - while (ip->i_gen == 0) - ip->i_gen = arc4random(); - if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) - ip->i_flag |= IN_MODIFIED; - } *vpp = vp; return (0); } From owner-svn-src-all@freebsd.org Tue Jun 7 15:07:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B49AB6DFA9; Tue, 7 Jun 2016 15:07:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1FB1447; Tue, 7 Jun 2016 15:07:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57F7185014433; Tue, 7 Jun 2016 15:07:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57F71mg014429; Tue, 7 Jun 2016 15:07:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606071507.u57F71mg014429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Jun 2016 15:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301549 - in head/sys: modules/netgraph/mppc net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 15:07:02 -0000 Author: pfg Date: Tue Jun 7 15:07:00 2016 New Revision: 301549 URL: https://svnweb.freebsd.org/changeset/base/301549 Log: ng_mppc(4): Bring netgraph(3) MPPC compression support. Support for compression has been available from July 2007 but it was never imported due to concerns with patents once held by STAC/HiFn. The issues have clearly been resolved so bring it in now. Special thanks to Brett Glass for preserving the code and pointing documentation for the expiration case. Obtained from: mav (through Brett Glass) Relnotes: yes MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6739 Added: head/sys/net/mppc.h (contents, props changed) head/sys/net/mppcc.c (contents, props changed) head/sys/net/mppcd.c (contents, props changed) Modified: head/sys/modules/netgraph/mppc/Makefile Modified: head/sys/modules/netgraph/mppc/Makefile ============================================================================== --- head/sys/modules/netgraph/mppc/Makefile Tue Jun 7 14:37:43 2016 (r301548) +++ head/sys/modules/netgraph/mppc/Makefile Tue Jun 7 15:07:00 2016 (r301549) @@ -4,11 +4,10 @@ KMOD= ng_mppc SRCS= ng_mppc.c opt_netgraph.h -NETGRAPH_MPPC_COMPRESSION?= 0 +NETGRAPH_MPPC_COMPRESSION?= 1 NETGRAPH_MPPC_ENCRYPTION?= 1 .if ${NETGRAPH_MPPC_COMPRESSION} > 0 -# XXX These files don't exist yet, but hopefully someday they will... .PATH: ${.CURDIR}/../../../net SRCS+= mppcc.c mppcd.c .endif Added: head/sys/net/mppc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/mppc.h Tue Jun 7 15:07:00 2016 (r301549) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2007 Alexander Motin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * MPPC decompression library. + * Version 1.0 + * + * Note that Hi/Fn (later acquired by Exar Corporation) held US patents + * on some implementation-critical aspects of MPPC compression. + * These patents lapsed due to non-payment of fees in 2007 and by 2015 + * expired altogether. + */ + +#ifndef _NET_MPPC_H_ +#define _NET_MPPC_H_ + +#define MPPC_MANDATORY_COMPRESS_FLAGS 0 +#define MPPC_MANDATORY_DECOMPRESS_FLAGS 0 + +#define MPPC_SAVE_HISTORY 1 + +#define MPPC_OK 5 +#define MPPC_EXPANDED 8 +#define MPPC_RESTART_HISTORY 16 +#define MPPC_DEST_EXHAUSTED 32 + +extern size_t MPPC_SizeOfCompressionHistory(void); +extern size_t MPPC_SizeOfDecompressionHistory(void); + +extern void MPPC_InitCompressionHistory(char *history); +extern void MPPC_InitDecompressionHistory(char *history); + +extern int MPPC_Compress(u_char **src, u_char **dst, u_long *srcCnt, u_long *dstCnt, char *history, int flags, int undef); +extern int MPPC_Decompress(u_char **src, u_char **dst, u_long *srcCnt, u_long *dstCnt, char *history, int flags); + +#endif Added: head/sys/net/mppcc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/mppcc.c Tue Jun 7 15:07:00 2016 (r301549) @@ -0,0 +1,299 @@ +/*- + * Copyright (c) 2002-2004 Jan Dubiec + * Copyright (c) 2007 Alexander Motin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * MPPC decompression library. + * Version 1.0 + * + * Note that Hi/Fn (later acquired by Exar Corporation) held US patents + * on some implementation-critical aspects of MPPC compression. + * These patents lapsed due to non-payment of fees in 2007 and by 2015 + * expired altogether. + */ + +#include +#include + +#include + +#define MPPE_HIST_LEN 8192 + +#define HASH(x) (((40543*(((((x)[0]<<4)^(x)[1])<<4)^(x)[2]))>>4) & 0x1fff) + +struct MPPC_comp_state { + uint8_t hist[2*MPPE_HIST_LEN]; + uint16_t histptr; + uint16_t hash[MPPE_HIST_LEN]; +}; + +/* Inserts 1 to 8 bits into the output buffer. */ +static void __inline +putbits8(uint8_t *buf, uint32_t val, const uint32_t n, uint32_t *i, uint32_t *l) +{ + buf += *i; + if (*l >= n) { + *l = (*l) - n; + val <<= *l; + *buf = *buf | (val & 0xff); + if (*l == 0) { + *l = 8; + (*i)++; + *(++buf) = 0; + } + } else { + (*i)++; + *l = 8 - n + (*l); + val <<= *l; + *buf = *buf | ((val >> 8) & 0xff); + *(++buf) = val & 0xff; + } +} + +/* Inserts 9 to 16 bits into the output buffer. */ +static void __inline +putbits16(uint8_t *buf, uint32_t val, const uint32_t n, uint32_t *i, uint32_t *l) +{ + buf += *i; + if (*l >= n - 8) { + (*i)++; + *l = 8 - n + (*l); + val <<= *l; + *buf = *buf | ((val >> 8) & 0xff); + *(++buf) = val & 0xff; + if (*l == 0) { + *l = 8; + (*i)++; + *(++buf) = 0; + } + } else { + (*i)++; (*i)++; + *l = 16 - n + (*l); + val <<= *l; + *buf = *buf | ((val >> 16) & 0xff); + *(++buf) = (val >> 8) & 0xff; + *(++buf) = val & 0xff; + } +} + +/* Inserts 17 to 24 bits into the output buffer. */ +static void __inline +putbits24(uint8_t *buf, uint32_t val, const uint32_t n, uint32_t *i, uint32_t *l) +{ + buf += *i; + if (*l >= n - 16) { + (*i)++; (*i)++; + *l = 16 - n + (*l); + val <<= *l; + *buf = *buf | ((val >> 16) & 0xff); + *(++buf) = (val >> 8) & 0xff; + *(++buf) = val & 0xff; + if (*l == 0) { + *l = 8; + (*i)++; + *(++buf) = 0; + } + } else { + (*i)++; (*i)++; (*i)++; + *l = 24 - n + (*l); + val <<= *l; + *buf = *buf | ((val >> 24) & 0xff); + *(++buf) = (val >> 16) & 0xff; + *(++buf) = (val >> 8) & 0xff; + *(++buf) = val & 0xff; + } +} + +size_t MPPC_SizeOfCompressionHistory(void) +{ + return (sizeof(struct MPPC_comp_state)); +} + +void MPPC_InitCompressionHistory(char *history) +{ + struct MPPC_comp_state *state = (struct MPPC_comp_state*)history; + + bzero(history, sizeof(struct MPPC_comp_state)); + state->histptr = MPPE_HIST_LEN; +} + +int MPPC_Compress(u_char **src, u_char **dst, u_long *srcCnt, u_long *dstCnt, char *history, int flags, int undef) +{ + struct MPPC_comp_state *state = (struct MPPC_comp_state*)history; + uint32_t olen, off, len, idx, i, l; + uint8_t *hist, *sbuf, *p, *q, *r, *s; + int rtn = MPPC_OK; + + /* + * At this point, to avoid possible buffer overflow caused by packet + * expansion during/after compression, we should make sure we have + * space for the worst case. + + * Maximum MPPC packet expansion is 12.5%. This is the worst case when + * all octets in the input buffer are >= 0x80 and we cannot find any + * repeated tokens. + */ + if (*dstCnt < (*srcCnt * 9 / 8 + 2)) { + rtn &= ~MPPC_OK; + return (rtn); + } + + /* We can't compress more then MPPE_HIST_LEN bytes in a call. */ + if (*srcCnt > MPPE_HIST_LEN) { + rtn &= ~MPPC_OK; + return (rtn); + } + + hist = state->hist + MPPE_HIST_LEN; + /* check if there is enough room at the end of the history */ + if (state->histptr + *srcCnt >= 2*MPPE_HIST_LEN) { + rtn |= MPPC_RESTART_HISTORY; + state->histptr = MPPE_HIST_LEN; + memcpy(state->hist, hist, MPPE_HIST_LEN); + } + /* Add packet to the history. */ + sbuf = state->hist + state->histptr; + memcpy(sbuf, *src, *srcCnt); + state->histptr += *srcCnt; + + /* compress data */ + r = sbuf + *srcCnt; + **dst = olen = i = 0; + l = 8; + while (i < *srcCnt - 2) { + s = q = sbuf + i; + + /* Prognose matching position using hash function. */ + idx = HASH(s); + p = hist + state->hash[idx]; + state->hash[idx] = (uint16_t) (s - hist); + if (p > s) /* It was before MPPC_RESTART_HISTORY. */ + p -= MPPE_HIST_LEN; /* Try previous history buffer. */ + off = s - p; + + /* Check our prognosis. */ + if (off > MPPE_HIST_LEN - 1 || off < 1 || *p++ != *s++ || + *p++ != *s++ || *p++ != *s++) { + /* No match found; encode literal byte. */ + if ((*src)[i] < 0x80) { /* literal byte < 0x80 */ + putbits8(*dst, (uint32_t) (*src)[i], 8, &olen, &l); + } else { /* literal byte >= 0x80 */ + putbits16(*dst, (uint32_t) (0x100|((*src)[i]&0x7f)), 9, + &olen, &l); + } + ++i; + continue; + } + + /* Find length of the matching fragment */ +#if defined(__amd64__) || defined(__i386__) + /* Optimization for CPUs without strict data aligning requirements */ + while ((*((uint32_t*)p) == *((uint32_t*)s)) && (s < (r - 3))) { + p+=4; + s+=4; + } +#endif + while((*p++ == *s++) && (s <= r)); + len = s - q - 1; + i += len; + + /* At least 3 character match found; code data. */ + /* Encode offset. */ + if (off < 64) { /* 10-bit offset; 0 <= offset < 64 */ + putbits16(*dst, 0x3c0|off, 10, &olen, &l); + } else if (off < 320) { /* 12-bit offset; 64 <= offset < 320 */ + putbits16(*dst, 0xe00|(off-64), 12, &olen, &l); + } else if (off < 8192) { /* 16-bit offset; 320 <= offset < 8192 */ + putbits16(*dst, 0xc000|(off-320), 16, &olen, &l); + } else { /* NOTREACHED */ + rtn &= ~MPPC_OK; + return rtn; + } + + /* Encode length of match. */ + if (len < 4) { /* length = 3 */ + putbits8(*dst, 0, 1, &olen, &l); + } else if (len < 8) { /* 4 <= length < 8 */ + putbits8(*dst, 0x08|(len&0x03), 4, &olen, &l); + } else if (len < 16) { /* 8 <= length < 16 */ + putbits8(*dst, 0x30|(len&0x07), 6, &olen, &l); + } else if (len < 32) { /* 16 <= length < 32 */ + putbits8(*dst, 0xe0|(len&0x0f), 8, &olen, &l); + } else if (len < 64) { /* 32 <= length < 64 */ + putbits16(*dst, 0x3c0|(len&0x1f), 10, &olen, &l); + } else if (len < 128) { /* 64 <= length < 128 */ + putbits16(*dst, 0xf80|(len&0x3f), 12, &olen, &l); + } else if (len < 256) { /* 128 <= length < 256 */ + putbits16(*dst, 0x3f00|(len&0x7f), 14, &olen, &l); + } else if (len < 512) { /* 256 <= length < 512 */ + putbits16(*dst, 0xfe00|(len&0xff), 16, &olen, &l); + } else if (len < 1024) { /* 512 <= length < 1024 */ + putbits24(*dst, 0x3fc00|(len&0x1ff), 18, &olen, &l); + } else if (len < 2048) { /* 1024 <= length < 2048 */ + putbits24(*dst, 0xff800|(len&0x3ff), 20, &olen, &l); + } else if (len < 4096) { /* 2048 <= length < 4096 */ + putbits24(*dst, 0x3ff000|(len&0x7ff), 22, &olen, &l); + } else if (len < 8192) { /* 4096 <= length < 8192 */ + putbits24(*dst, 0xffe000|(len&0xfff), 24, &olen, &l); + } else { /* NOTREACHED */ + rtn &= ~MPPC_OK; + return (rtn); + } + } + + /* Add remaining octets to the output. */ + while(*srcCnt - i > 0) { + if ((*src)[i] < 0x80) { /* literal byte < 0x80 */ + putbits8(*dst, (uint32_t) (*src)[i++], 8, &olen, &l); + } else { /* literal byte >= 0x80 */ + putbits16(*dst, (uint32_t) (0x100|((*src)[i++]&0x7f)), 9, &olen, + &l); + } + } + + /* Reset unused bits of the last output octet. */ + if ((l != 0) && (l != 8)) { + putbits8(*dst, 0, l, &olen, &l); + } + + /* If result is bigger then original, set flag and flush history. */ + if ((*srcCnt < olen) || ((flags & MPPC_SAVE_HISTORY) == 0)) { + if (*srcCnt < olen) + rtn |= MPPC_EXPANDED; + bzero(history, sizeof(struct MPPC_comp_state)); + state->histptr = MPPE_HIST_LEN; + } + + *src += *srcCnt; + *srcCnt = 0; + *dst += olen; + *dstCnt -= olen; + + return (rtn); +} Added: head/sys/net/mppcd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/mppcd.c Tue Jun 7 15:07:00 2016 (r301549) @@ -0,0 +1,284 @@ +/*- + * Copyright (c) 2002-2004 Jan Dubiec + * Copyright (c) 2007 Alexander Motin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * MPPC decompression library. + * Version 1.0 + * + * Note that Hi/Fn (later acquired by Exar Corporation) held US patents + * on some implementation-critical aspects of MPPC compression. + * These patents lapsed due to non-payment of fees in 2007 and by 2015 + * expired altogether. + */ + +#include +#include + +#include + +#define MPPE_HIST_LEN 8192 + +struct MPPC_decomp_state { + uint8_t hist[2*MPPE_HIST_LEN]; + uint16_t histptr; +}; + +static uint32_t __inline +getbits(const uint8_t *buf, const uint32_t n, uint32_t *i, uint32_t *l) +{ + static const uint32_t m[] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; + uint32_t res, ol; + + ol = *l; + if (*l >= n) { + *l = (*l) - n; + res = (buf[*i] & m[ol]) >> (*l); + if (*l == 0) { + *l = 8; + (*i)++; + } + } else { + *l = 8 - n + (*l); + res = (buf[(*i)++] & m[ol]) << 8; + res = (res | buf[*i]) >> (*l); + } + + return (res); +} + +static uint32_t __inline +getbyte(const uint8_t *buf, const uint32_t i, const uint32_t l) +{ + if (l == 8) { + return (buf[i]); + } else { + return ((((buf[i] << 8) | buf[i+1]) >> l) & 0xff); + } +} + +static void __inline +lamecopy(uint8_t *dst, uint8_t *src, uint32_t len) +{ + while (len--) + *dst++ = *src++; +} + +size_t MPPC_SizeOfDecompressionHistory(void) +{ + return (sizeof(struct MPPC_decomp_state)); +} + +void MPPC_InitDecompressionHistory(char *history) +{ + struct MPPC_decomp_state *state = (struct MPPC_decomp_state*)history; + + bzero(history, sizeof(struct MPPC_decomp_state)); + state->histptr = MPPE_HIST_LEN; +} + +int MPPC_Decompress(u_char **src, u_char **dst, u_long *srcCnt, u_long *dstCnt, char *history, int flags) +{ + struct MPPC_decomp_state *state = (struct MPPC_decomp_state*)history; + uint32_t olen, off, len, bits, val, sig, i, l; + uint8_t *hist, *s; + u_char *isrc = *src; + int rtn = MPPC_OK; + + if ((flags & MPPC_RESTART_HISTORY) != 0) { + memcpy(state->hist, state->hist + MPPE_HIST_LEN, MPPE_HIST_LEN); + state->histptr = MPPE_HIST_LEN; + } + + hist = state->hist + state->histptr; + olen = len = i = 0; + l = 8; + bits = *srcCnt * 8; + while (bits >= 8) { + val = getbyte(isrc, i++, l); + if (val < 0x80) { /* literal byte < 0x80 */ + if (state->histptr < 2*MPPE_HIST_LEN) { + /* Copy uncompressed byte to the history. */ + (state->hist)[(state->histptr)++] = (uint8_t) val; + } else { + /* Buffer overflow; drop packet. */ + rtn &= ~MPPC_OK; + return rtn; + } + olen++; + bits -= 8; + continue; + } + + sig = val & 0xc0; + if (sig == 0x80) { /* literal byte >= 0x80 */ + if (state->histptr < 2*MPPE_HIST_LEN) { + /* Copy uncompressed byte to the history. */ + (state->hist)[(state->histptr)++] = + (uint8_t) (0x80|((val&0x3f)<<1)|getbits(isrc, 1 , &i ,&l)); + } else { + /* buffer overflow; drop packet */ + rtn &= ~MPPC_OK; + return (rtn); + } + olen++; + bits -= 9; + continue; + } + + /* Not a literal byte so it must be an (offset,length) pair */ + /* decode offset */ + sig = val & 0xf0; + if (sig == 0xf0) { /* 10-bit offset; 0 <= offset < 64 */ + off = (((val&0x0f)<<2)|getbits(isrc, 2 , &i ,&l)); + bits -= 10; + } else { + if (sig == 0xe0) { /* 12-bit offset; 64 <= offset < 320 */ + off = ((((val&0x0f)<<4)|getbits(isrc, 4 , &i ,&l))+64); + bits -= 12; + } else { + if ((sig&0xe0) == 0xc0) {/* 16-bit offset; 320 <= offset < 8192 */ + off = ((((val&0x1f)<<8)|getbyte(isrc, i++, l))+320); + bits -= 16; + if (off > MPPE_HIST_LEN - 1) { + rtn &= ~MPPC_OK; + return (rtn); + } + } else { /* NOTREACHED */ + rtn &= ~MPPC_OK; + return (rtn); + } + } + } + /* Decode length of match. */ + val = getbyte(isrc, i, l); + if ((val & 0x80) == 0x00) { /* len = 3 */ + len = 3; + bits--; + getbits(isrc, 1 , &i ,&l); + } else if ((val & 0xc0) == 0x80) { /* 4 <= len < 8 */ + len = 0x04 | ((val>>4) & 0x03); + bits -= 4; + getbits(isrc, 4 , &i ,&l); + } else if ((val & 0xe0) == 0xc0) { /* 8 <= len < 16 */ + len = 0x08 | ((val>>2) & 0x07); + bits -= 6; + getbits(isrc, 6 , &i ,&l); + } else if ((val & 0xf0) == 0xe0) { /* 16 <= len < 32 */ + len = 0x10 | (val & 0x0f); + bits -= 8; + i++; + } else { + bits -= 8; + val = (val << 8) | getbyte(isrc, ++i, l); + if ((val & 0xf800) == 0xf000) { /* 32 <= len < 64 */ + len = 0x0020 | ((val >> 6) & 0x001f); + bits -= 2; + getbits(isrc, 2 , &i ,&l); + } else if ((val & 0xfc00) == 0xf800) { /* 64 <= len < 128 */ + len = 0x0040 | ((val >> 4) & 0x003f); + bits -= 4; + getbits(isrc, 4 , &i ,&l); + } else if ((val & 0xfe00) == 0xfc00) { /* 128 <= len < 256 */ + len = 0x0080 | ((val >> 2) & 0x007f); + bits -= 6; + getbits(isrc, 6 , &i ,&l); + } else if ((val & 0xff00) == 0xfe00) { /* 256 <= len < 512 */ + len = 0x0100 | (val & 0x00ff); + bits -= 8; + i++; + } else { + bits -= 8; + val = (val << 8) | getbyte(isrc, ++i, l); + if ((val & 0xff8000) == 0xff0000) { /* 512 <= len < 1024 */ + len = 0x000200 | ((val >> 6) & 0x0001ff); + bits -= 2; + getbits(isrc, 2 , &i ,&l); + } else if ((val & 0xffc000) == 0xff8000) {/* 1024 <= len < 2048 */ + len = 0x000400 | ((val >> 4) & 0x0003ff); + bits -= 4; + getbits(isrc, 4 , &i ,&l); + } else if ((val & 0xffe000) == 0xffc000) {/* 2048 <= len < 4096 */ + len = 0x000800 | ((val >> 2) & 0x0007ff); + bits -= 6; + getbits(isrc, 6 , &i ,&l); + } else if ((val & 0xfff000) == 0xffe000) {/* 4096 <= len < 8192 */ + len = 0x001000 | (val & 0x000fff); + bits -= 8; + i++; + } else { /* NOTREACHED */ + rtn &= ~MPPC_OK; + return (rtn); + } + } + } + + s = state->hist + state->histptr; + state->histptr += len; + olen += len; + if (state->histptr < 2*MPPE_HIST_LEN) { + /* Copy uncompressed bytes to the history. */ + + /* + * In some cases len may be greater than off. It means that memory + * areas pointed by s and s-off overlap. To decode that strange case + * data should be copied exactly by address increasing to make + * some data repeated. + */ + lamecopy(s, s - off, len); + } else { + /* Buffer overflow; drop packet. */ + rtn &= ~MPPC_OK; + return (rtn); + } + } + + /* Do PFC decompression. */ + len = olen; + if ((hist[0] & 0x01) != 0) { + (*dst)[0] = 0; + (*dst)++; + len++; + } + + if (len <= *dstCnt) { + /* Copy uncompressed packet to the output buffer. */ + memcpy(*dst, hist, olen); + } else { + /* Buffer overflow; drop packet. */ + rtn |= MPPC_DEST_EXHAUSTED; + } + + *src += *srcCnt; + *srcCnt = 0; + *dst += len; + *dstCnt -= len; + + return (rtn); +} From owner-svn-src-all@freebsd.org Tue Jun 7 15:11:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB768B6E03F for ; Tue, 7 Jun 2016 15:11:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm37-vm2.bullet.mail.bf1.yahoo.com (nm37-vm2.bullet.mail.bf1.yahoo.com [72.30.238.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0A6199B for ; Tue, 7 Jun 2016 15:11:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465312293; bh=1QJgh8Z6MSlfd3t66MxcHXUvbwUYB9QOTPLVPInYpP4=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=gzD8QeRZI1/hAOC8d0bAUyE+dkDGAJHoLGsKDMude51dSe9dSOFHi/BUtAwZdiVUsHLN/j/c0mH2JBefpm6Lf9/glJzN0kQNJkG1DyTptoOxyd0GbKdDZ8+pYzwS9Y8nEbzwTCVD+bf6RyJxxyw7h0shTc4ZgfpOdgArTp4FOw0wcxvYwQkA4+Gx9K6uhp90f/lymVrp2GhOYy6QrhCEozblX/ibixTM9dSyv8ngHEd68nw8wY7s5U3SvavBLRE3CURu6ESndMNZ1tPf82eMMfDlkbHBUPygfYj336RkuxsdQeex0uOgPPSvtC7f0H6ZfQxgyT5NAj+zj22jpLFOhg== Received: from [98.139.215.140] by nm37.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 15:11:33 -0000 Received: from [98.139.211.195] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 15:11:33 -0000 Received: from [127.0.0.1] by smtp204.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 15:11:33 -0000 X-Yahoo-Newman-Id: 586768.93735.bm@smtp204.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: jG567aQVM1mtpPux9mRrLAhtK1tJjQKDSnH88SKSyWqBCfj 7Vz8wz9vORzEpFQyHape1kXULNWye9x1Ck5VArn7tIVyJQuOQaFE9XXxHqIH 6YcyYZuce1egcHBKA9ASqt0.lWlrk1RILHp11HGF_2vogEqZv_PnAsMmGZLW zeQ4d713rgkVYXC8.ys_ywl9DV0SgYfb_BR.L0PuFjiHhs4CKEdowZz9i34q 0nZr32i0eDLFPpyOh.5Y.uNJqcP1m3HsTd.tevREEa5y6T4XxWACd14LqI.C EKRxwyFOEIJZAVq89yDq_Bxcx_zS2b1hnNtmcQb5_vPEP4MWhEUa_GI7i6v7 vSYrtbNXVl2KwmmdfsbWlaP05joD8uXBhA0MQ.G7riDhl3YfozTQ3As.tk9K xU5OlxtHZ70h7_LyPqdIv2iT6iuRVTBX673Gn0l9bX5wXrrGPJ47Wiao5Ij8 CpFCiksojftR6ExSZAc4WEue1L.nZaNHZwoX1L.DyxdXCv6HSQrcENayJ4ld uPrkfIxOSleaSJ2SlCgvU5663it8wzYs6 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r301549 - in head/sys: modules/netgraph/mppc net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606071507.u57F71mg014429@repo.freebsd.org> From: Pedro Giffuni Message-ID: <3d05fdd6-8fa6-f63d-c5a9-cd5b7954422b@FreeBSD.org> Date: Tue, 7 Jun 2016 10:11:40 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606071507.u57F71mg014429@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 15:11:40 -0000 On 06/07/16 10:07, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jun 7 15:07:00 2016 > New Revision: 301549 > URL: https://svnweb.freebsd.org/changeset/base/301549 > > Log: > ng_mppc(4): Bring netgraph(3) MPPC compression support. > > Support for compression has been available from July 2007 but it > was never imported due to concerns with patents once held by > STAC/HiFn. The issues have clearly been resolved so bring it > in now. > > Special thanks to Brett Glass for preserving the code and > pointing documentation for the expiration case. > > Obtained from: mav (through Brett Glass) Actually *Taken from* Pedro. From owner-svn-src-all@freebsd.org Tue Jun 7 15:20:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53BA6B6E300; Tue, 7 Jun 2016 15:20:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 247421EA4; Tue, 7 Jun 2016 15:20:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57FKrpM018799; Tue, 7 Jun 2016 15:20:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57FKr3e018798; Tue, 7 Jun 2016 15:20:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606071520.u57FKr3e018798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Jun 2016 15:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301550 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 15:20:54 -0000 Author: pfg Date: Tue Jun 7 15:20:53 2016 New Revision: 301550 URL: https://svnweb.freebsd.org/changeset/base/301550 Log: ng_mppc(4): Bring netgraph(3) MPPC compression support. Documentation change missing from r301549. Modified: head/share/man/man4/ng_mppc.4 Modified: head/share/man/man4/ng_mppc.4 ============================================================================== --- head/share/man/man4/ng_mppc.4 Tue Jun 7 15:07:00 2016 (r301549) +++ head/share/man/man4/ng_mppc.4 Tue Jun 7 15:20:53 2016 (r301550) @@ -35,7 +35,7 @@ .\" $Whistle: ng_mppc.8,v 1.1 1999/12/08 20:20:39 archie Exp $ .\" $FreeBSD$ .\" -.Dd December 8, 1999 +.Dd June 7, 2016 .Dt NG_MPPC 4 .Os .Sh NAME @@ -153,12 +153,6 @@ and are supplied to selectively compile in either or both capabilities. At least one of these must be defined, or else this node type is useless. .Pp -The MPPC protocol requires proprietary compression code available -from Hi/Fn (formerly STAC). -These files must be obtained elsewhere and added to the kernel -sources before this node type will compile with the -.Dv NETGRAPH_MPPC_COMPRESSION -option. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_ppp 4 , From owner-svn-src-all@freebsd.org Tue Jun 7 15:38:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D41F8B6E94F; Tue, 7 Jun 2016 15:38:45 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEBA91B15; Tue, 7 Jun 2016 15:38:45 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-oi0-f48.google.com with SMTP id p204so87191493oih.3; Tue, 07 Jun 2016 08:38:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NkFdeKIM5H2NBndTzAL3vMznGQWtDUZ6G07TBw1QygU=; b=G1sM7ItFUIxbgIzSZJpXei/QhJ74Ar3wlHYCD1mIetPzMG4etNrJRogc5mK+h0PEOS 63COvqQU64mlH9aroP+o2Gdg58A95RQk/K3XzDYc44yE+dMlukAs6EmlVCr2SPprZNah NHWH36zWfTyawmxsdD54h3LJSkUdO69cG14Cp9wQTR1Ul2f4/R+gJCgpxB1sXJAk4XZL w4R0dyPwfnUX2E3wrG73nKNKAETIPmq0pBvNXBnfdwiQ6/q1d+BT3pr49JLRNNwsjaBc vMX8zFyhTugudew8JS7x8hi6TyyUtjnSgxAGuB/jVbjBNwlv/1FA90BxpOBaRGwDlg/9 yYCQ== X-Gm-Message-State: ALyK8tK8b5ODotqfUlGv495yXubrMm/OUgXMK+mshY2QiP5Y/zYejyZkZAaqKwOhb6B6JA== X-Received: by 10.157.49.40 with SMTP id e37mr59619otc.38.1465313611931; Tue, 07 Jun 2016 08:33:31 -0700 (PDT) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id j7sm7270254otc.13.2016.06.07.08.33.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Jun 2016 08:33:31 -0700 (PDT) Received: by mail-it0-f47.google.com with SMTP id h62so30769941itb.1; Tue, 07 Jun 2016 08:33:31 -0700 (PDT) X-Received: by 10.36.16.67 with SMTP id 64mr570456ity.88.1465313611059; Tue, 07 Jun 2016 08:33:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.60.67 with HTTP; Tue, 7 Jun 2016 08:33:30 -0700 (PDT) In-Reply-To: <3626355.rfEWHPgmKy@ralph.baldwin.cx> References: <201606051607.u55G7vUg062390@repo.freebsd.org> <3626355.rfEWHPgmKy@ralph.baldwin.cx> From: Svatopluk Kraus Date: Tue, 7 Jun 2016 17:33:30 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r301451 - in head/sys: kern sys To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 15:38:45 -0000 On Mon, Jun 6, 2016 at 8:47 PM, John Baldwin wrote: > On Sunday, June 05, 2016 04:07:57 PM Svatopluk Kraus wrote: >> Author: skra >> Date: Sun Jun 5 16:07:57 2016 >> New Revision: 301451 >> URL: https://svnweb.freebsd.org/changeset/base/301451 >> >> Log: >> (1) Add a new bus method to get a mapping data for an interrupt. >> >> BUS_MAP_INTR() is used to get an interrupt mapping data according >> to provided hints. The hints could be modified afterwards, but only >> if mapping data was allocated. This method is intended to be called >> before BUS_ALLOC_RESOURCE(). >> >> An interrupt mapping data describes an interrupt - hardware number, >> type, configuration, cpu binding, and whatever is needed to setup it. >> >> (2) Introduce a method which allows storing of an additional data >> in struct resource to be available for bus drivers. This method is >> convenient in two ways: >> - there is no need to rework existing bus drivers as they can simply >> be extended to provide an additional data, >> - there is no need to modify any existing bus methods as struct >> resource is already passed to them as argument and thus stored data >> is simply accessible by other bus drivers. >> For now, implement this method only for INTRNG. >> >> This is motivated by needs of modern SOCs where hardware initialization >> is not straightforward and resources descriptions are complex, opaque >> for everyone but provider, and may vary from SOC to SOC. Typical >> situation is that one bus driver can fetch a resource description for >> its child device, but it's opaque for this driver. Another bus driver >> knows a provider for this kind of resource and can pass this resource >> description to it. In fact, something like device IVARS would be >> perfect for that if implemented generally enough. Unfortunatelly, IVARS >> are usable only by their owners now. Only owner knows its IVARS layout, >> thus other bus drivers are not able to use them. >> >> Differential Revision: https://reviews.freebsd.org/D6632 > > Does anything need to query this data besides the "nexus" or similar > driver at the top of bus_alloc_resource()? If so, I'd much rather do > this by having an optional args structure passed to bus_alloc_resource > that is extensible ala make_dev_s() and bus_map_resource(). Previously > I had mentioned passing this as part of bus_setup_intr() rather than > bus_alloc_resource(), but it would actually work better for ACPI if > we did it for bus_alloc_resource() instead. > > I guess my question is do you need access to this beyond the lifetime > of the call to bus_alloc_resource(). On x86 for example the state that > would needed to be passed up from ACPI (currently via bus_config_intr()) > is stored in the interrupt source structure, so it doesn't need to be > attached to the resource directly, it just needs to be passed up with it > so it can be saved in the interrupt source structure. > > -- > John Baldwin INTRNG was designed with the idea that a description of an interrupt belongs to a device, not to an interrupt itself. The very same interrupt may be used by more devices and each device should keep own description for this interrupt as these descriptions may differ - one can be GPIO like, another FDT like - one can demand binding to cpu0, another to cpu3 - and so on. In FDT case, it's regular as there are configurations for all possible devices in FDT blob, and it may be runtime choice which device will be used and you may even alternate these devices (meaning those which use the same interrupt). In the interrupt source structure (in a controller specific part) is then saved the info how an interrupt is really setup, and it's done in a controller native form. For example, when an interrupt is shared, two devices can be attached, both can allocate the same interrupt, but their configurations may differ. They can be setup at the same time, but also in rotation. Now, to answer your question. The interrupt mapping data is only needed in two situation for now. First, when a global scope interrupt number is looked up. It may be done during bus_alloc_resource() call. Second, when an interrupt is setup during bus_setup_intr(). When this data is saved in struct resource, it belongs to a device and can be used repeatedly during lifetime of this struct. And there is no need to modify any driver. Look also at r301539. An interrupt mapping data is saved in gpio_alloc_intr_resource(), so bus_setup_intr() can be used as is. Svatopluk Kraus From owner-svn-src-all@freebsd.org Tue Jun 7 16:18:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B172B6E28F; Tue, 7 Jun 2016 16:18:11 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D8681FE9; Tue, 7 Jun 2016 16:18:11 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GIALR041278; Tue, 7 Jun 2016 16:18:10 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57GI9qZ041269; Tue, 7 Jun 2016 16:18:09 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606071618.u57GI9qZ041269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 7 Jun 2016 16:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301551 - in head: crypto/openssh secure/usr.sbin/sshd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:18:11 -0000 Author: lidl Date: Tue Jun 7 16:18:09 2016 New Revision: 301551 URL: https://svnweb.freebsd.org/changeset/base/301551 Log: Add blacklist support to sshd Reviewed by: rpaulo Approved by: rpaulo (earlier version of changes) Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5915 Added: head/crypto/openssh/blacklist.c (contents, props changed) head/crypto/openssh/blacklist_client.h (contents, props changed) Modified: head/crypto/openssh/auth-pam.c head/crypto/openssh/auth.c head/crypto/openssh/auth1.c head/crypto/openssh/auth2.c head/crypto/openssh/packet.c head/crypto/openssh/sshd.c head/secure/usr.sbin/sshd/Makefile Modified: head/crypto/openssh/auth-pam.c ============================================================================== --- head/crypto/openssh/auth-pam.c Tue Jun 7 15:20:53 2016 (r301550) +++ head/crypto/openssh/auth-pam.c Tue Jun 7 16:18:09 2016 (r301551) @@ -98,6 +98,9 @@ #include "ssh-gss.h" #endif #include "monitor_wrap.h" +#ifdef USE_BLACKLIST +#include "blacklist_client.h" +#endif extern ServerOptions options; extern Buffer loginmsg; @@ -794,6 +797,9 @@ sshpam_query(void *ctx, char **name, cha free(msg); return (0); } +#ifdef USE_BLACKLIST + blacklist_notify(1); +#endif error("PAM: %s for %s%.100s from %.100s", msg, sshpam_authctxt->valid ? "" : "illegal user ", sshpam_authctxt->user, Modified: head/crypto/openssh/auth.c ============================================================================== --- head/crypto/openssh/auth.c Tue Jun 7 15:20:53 2016 (r301550) +++ head/crypto/openssh/auth.c Tue Jun 7 16:18:09 2016 (r301551) @@ -75,6 +75,9 @@ __RCSID("$FreeBSD$"); #include "authfile.h" #include "ssherr.h" #include "compat.h" +#ifdef USE_BLACKLIST +#include "blacklist_client.h" +#endif /* import */ extern ServerOptions options; @@ -306,6 +309,10 @@ auth_log(Authctxt *authctxt, int authent compat20 ? "ssh2" : "ssh1", authctxt->info != NULL ? ": " : "", authctxt->info != NULL ? authctxt->info : ""); +#ifdef USE_BLACKLIST + if (!authctxt->postponed) + blacklist_notify(!authenticated); +#endif free(authctxt->info); authctxt->info = NULL; @@ -640,6 +647,9 @@ getpwnamallow(const char *user) } #endif if (pw == NULL) { +#ifdef USE_BLACKLIST + blacklist_notify(1); +#endif logit("Invalid user %.100s from %.100s", user, get_remote_ipaddr()); #ifdef CUSTOM_FAILED_LOGIN Modified: head/crypto/openssh/auth1.c ============================================================================== --- head/crypto/openssh/auth1.c Tue Jun 7 15:20:53 2016 (r301550) +++ head/crypto/openssh/auth1.c Tue Jun 7 16:18:09 2016 (r301551) @@ -43,6 +43,9 @@ #endif #include "monitor_wrap.h" #include "buffer.h" +#ifdef USE_BLACKLIST +#include "blacklist_client.h" +#endif /* import */ extern ServerOptions options; @@ -337,6 +340,9 @@ do_authloop(Authctxt *authctxt) char *msg; size_t len; +#ifdef USE_BLACKLIST + blacklist_notify(1); +#endif error("Access denied for user %s by PAM account " "configuration", authctxt->user); len = buffer_len(&loginmsg); @@ -404,6 +410,9 @@ do_authentication(Authctxt *authctxt) else { debug("do_authentication: invalid user %s", user); authctxt->pw = fakepw(); +#ifdef USE_BLACKLIST + blacklist_notify(1); +#endif } /* Configuration may have changed as a result of Match */ Modified: head/crypto/openssh/auth2.c ============================================================================== --- head/crypto/openssh/auth2.c Tue Jun 7 15:20:53 2016 (r301550) +++ head/crypto/openssh/auth2.c Tue Jun 7 16:18:09 2016 (r301551) @@ -52,6 +52,9 @@ __RCSID("$FreeBSD$"); #include "pathnames.h" #include "buffer.h" #include "canohost.h" +#ifdef USE_BLACKLIST +#include "blacklist_client.h" +#endif #ifdef GSSAPI #include "ssh-gss.h" @@ -248,6 +251,9 @@ input_userauth_request(int type, u_int32 } else { logit("input_userauth_request: invalid user %s", user); authctxt->pw = fakepw(); +#ifdef USE_BLACKLIST + blacklist_notify(1); +#endif #ifdef SSH_AUDIT_EVENTS PRIVSEP(audit_event(SSH_INVALID_USER)); #endif Added: head/crypto/openssh/blacklist.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/crypto/openssh/blacklist.c Tue Jun 7 16:18:09 2016 (r301551) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +#include +#include +#include +#include + +#include "ssh.h" +#include "packet.h" +#include "log.h" +#include "blacklist_client.h" +#include + +static struct blacklist *blstate; + +void +blacklist_init(void) +{ + blstate = blacklist_open(); +} + +void +blacklist_notify(int action) +{ + int fd; + if (blstate == NULL) + blacklist_init(); + if (blstate == NULL) + return; + fd = packet_get_connection_in(); + if (!packet_connection_is_on_socket()) { + fprintf(stderr, "packet_connection_is_on_socket: false " + "(fd = %d)\n", fd); + } + (void)blacklist_r(blstate, action, fd, "ssh"); +} Added: head/crypto/openssh/blacklist_client.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/crypto/openssh/blacklist_client.h Tue Jun 7 16:18:09 2016 (r301551) @@ -0,0 +1,31 @@ +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +void blacklist_notify(int); +void blacklist_init(void); Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Tue Jun 7 15:20:53 2016 (r301550) +++ head/crypto/openssh/packet.c Tue Jun 7 16:18:09 2016 (r301551) @@ -86,6 +86,9 @@ __RCSID("$FreeBSD$"); #include "packet.h" #include "ssherr.h" #include "sshbuf.h" +#ifdef USE_BLACKLIST +#include "blacklist_client.h" +#endif #ifdef PACKET_DEBUG #define DBG(x) x @@ -2071,6 +2074,9 @@ sshpkt_fatal(struct ssh *ssh, const char case SSH_ERR_NO_KEX_ALG_MATCH: case SSH_ERR_NO_HOSTKEY_ALG_MATCH: if (ssh && ssh->kex && ssh->kex->failed_choice) { +#ifdef USE_BLACKLIST + blacklist_notify(1); +#endif fatal("Unable to negotiate with %.200s port %d: %s. " "Their offer: %s", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), ssh_err(r), Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Tue Jun 7 15:20:53 2016 (r301550) +++ head/crypto/openssh/sshd.c Tue Jun 7 16:18:09 2016 (r301551) @@ -135,6 +135,9 @@ __RCSID("$FreeBSD$"); #include "ssh-sandbox.h" #include "version.h" #include "ssherr.h" +#ifdef USE_BLACKLIST +#include "blacklist_client.h" +#endif #ifdef LIBWRAP #include @@ -388,6 +391,9 @@ grace_alarm_handler(int sig) kill(0, SIGTERM); } +#ifdef USE_BLACKLIST + blacklist_notify(1); +#endif /* Log error and exit. */ sigdie("Timeout before authentication for %s", get_remote_ipaddr()); } @@ -649,6 +655,10 @@ privsep_preauth_child(void) /* Demote the private keys to public keys. */ demote_sensitive_data(); +#ifdef USE_BLACKLIST + blacklist_init(); +#endif + /* Demote the child */ if (getuid() == 0 || geteuid() == 0) { /* Change our root directory */ @@ -1272,6 +1282,9 @@ server_accept_loop(int *sock_in, int *so for (i = 0; i < options.max_startups; i++) startup_pipes[i] = -1; +#ifdef USE_BLACKLIST + blacklist_init(); +#endif /* * Stay listening for connections until the system crashes or * the daemon is killed with a signal. Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Tue Jun 7 15:20:53 2016 (r301550) +++ head/secure/usr.sbin/sshd/Makefile Tue Jun 7 16:18:09 2016 (r301551) @@ -40,6 +40,13 @@ CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT LIBADD+= bsm .endif +.if ${MK_BLACKLIST_SUPPORT} != "no" +CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include +SRCS+= blacklist.c +LIBADD+= blacklist +LDFLAGS+=-L${LIBBLACKLISTDIR} +.endif + .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h From owner-svn-src-all@freebsd.org Tue Jun 7 16:21:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD5CCB6E4A6; Tue, 7 Jun 2016 16:21:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BE3CD13BD; Tue, 7 Jun 2016 16:21:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u57GLleb006385; Tue, 7 Jun 2016 09:21:51 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201606071621.u57GLleb006385@gw.catspoiler.org> Date: Tue, 7 Jun 2016 09:21:47 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r301546 - head/release/doc/en_US.ISO8859-1/relnotes To: skreuzer@FreeBSD.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201606071411.u57EBFmH093319@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:21:58 -0000 On 7 Jun, Steven Kreuzer wrote: > Author: skreuzer (doc,ports committer) > Date: Tue Jun 7 14:11:15 2016 > New Revision: 301546 > URL: https://svnweb.freebsd.org/changeset/base/301546 > > Log: > Document 300779, Dummynet AQM version 0.2.1 > > Approved by: re (gjb, implicit, relnotes) > > Modified: > head/release/doc/en_US.ISO8859-1/relnotes/article.xml > > Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml > ============================================================================== > --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 7 13:58:52 2016 (r301545) > +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Jun 7 14:11:15 2016 (r301546) > @@ -1771,6 +1771,10 @@ > > > > + Dummynet AQM, an independent implementation of > + CoDel and FQ-CoDel for ipfw/dummynet has been imported to the base > + system. > + > > > > PIE and FQ-PIE are also included. From owner-svn-src-all@freebsd.org Tue Jun 7 16:26:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6BECB6E566; Tue, 7 Jun 2016 16:26:35 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6042E17A3; Tue, 7 Jun 2016 16:26:35 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GQYa6045295; Tue, 7 Jun 2016 16:26:34 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57GQYU6045292; Tue, 7 Jun 2016 16:26:34 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606071626.u57GQYU6045292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 7 Jun 2016 16:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301552 - head/contrib/blacklist/bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:26:35 -0000 Author: lidl Date: Tue Jun 7 16:26:34 2016 New Revision: 301552 URL: https://svnweb.freebsd.org/changeset/base/301552 Log: Note blacklist support first appeared in FreeBSD 11 Reported by: jbeich Sponsored by: The FreeBSD Foundation Modified: head/contrib/blacklist/bin/blacklistctl.8 head/contrib/blacklist/bin/blacklistd.8 head/contrib/blacklist/bin/blacklistd.conf.5 Modified: head/contrib/blacklist/bin/blacklistctl.8 ============================================================================== --- head/contrib/blacklist/bin/blacklistctl.8 Tue Jun 7 16:18:09 2016 (r301551) +++ head/contrib/blacklist/bin/blacklistctl.8 Tue Jun 7 16:26:34 2016 (r301552) @@ -75,7 +75,11 @@ will first attempt to remove the existin it to make sure that there is only one rule active. .Sh HISTORY .Nm -appeared in +first appeared in .Nx 7 . +.Fx support for +.Nm +was implemented in +.Fx 11 . .Sh AUTHORS .An Christos Zoulas Modified: head/contrib/blacklist/bin/blacklistd.8 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.8 Tue Jun 7 16:18:09 2016 (r301551) +++ head/contrib/blacklist/bin/blacklistd.8 Tue Jun 7 16:26:34 2016 (r301552) @@ -216,7 +216,11 @@ Socket to receive connection notificatio .Xr syslogd 8 .Sh HISTORY .Nm -appeared in +first appeared in .Nx 7 . +.Fx support for +.Nm +was implemented in +.Fx 11 . .Sh AUTHORS .An Christos Zoulas Modified: head/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.conf.5 Tue Jun 7 16:18:09 2016 (r301551) +++ head/contrib/blacklist/bin/blacklistd.conf.5 Tue Jun 7 16:26:34 2016 (r301552) @@ -216,7 +216,11 @@ bnx0:ssh * * * * 3 6h .Xr blacklistd 8 .Sh HISTORY .Nm -appeared in +first appeared in .Nx 7 . +.Fx support for +.Nm +was implemented in +.Fx 11 . .Sh AUTHORS .An Christos Zoulas From owner-svn-src-all@freebsd.org Tue Jun 7 16:31:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF78EB6E6EC; Tue, 7 Jun 2016 16:31:05 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 877801C7D; Tue, 7 Jun 2016 16:31:05 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GV4jo046306; Tue, 7 Jun 2016 16:31:04 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57GV4pc045668; Tue, 7 Jun 2016 16:31:04 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606071631.u57GV4pc045668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 7 Jun 2016 16:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301553 - in head: etc etc/rc.d lib libexec tools/build/mk usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:31:05 -0000 Author: lidl Date: Tue Jun 7 16:31:03 2016 New Revision: 301553 URL: https://svnweb.freebsd.org/changeset/base/301553 Log: Separate BLACKLIST vs BLACKLIST_SUPPORT properly Sponsored by: The FreeBSD Foundation Modified: head/etc/Makefile head/etc/rc.d/Makefile head/lib/Makefile head/libexec/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Jun 7 16:26:34 2016 (r301552) +++ head/etc/Makefile Tue Jun 7 16:31:03 2016 (r301553) @@ -86,7 +86,7 @@ BIN1+= apmd.conf BIN1+= auto_master .endif -.if ${MK_BLACKLIST_SUPPORT} != "no" +.if ${MK_BLACKLIST} != "no" BIN1+= blacklistd.conf .endif Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Tue Jun 7 16:26:34 2016 (r301552) +++ head/etc/rc.d/Makefile Tue Jun 7 16:31:03 2016 (r301553) @@ -170,7 +170,7 @@ FILES+= automountd FILES+= autounmountd .endif -.if ${MK_BLACKLIST_SUPPORT} != "no" +.if ${MK_BLACKLIST} != "no" _blacklistd+= blacklistd .endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Jun 7 16:26:34 2016 (r301552) +++ head/lib/Makefile Tue Jun 7 16:31:03 2016 (r301553) @@ -161,7 +161,7 @@ SUBDIR_DEPEND_liblzma= ${_libthr} _libngatm= libngatm .endif -.if ${MK_BLACKLIST_SUPPORT} != "no" +.if ${MK_BLACKLIST} != "no" _libblacklist= libblacklist .endif Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Tue Jun 7 16:26:34 2016 (r301552) +++ head/libexec/Makefile Tue Jun 7 16:31:03 2016 (r301553) @@ -34,7 +34,7 @@ SUBDIR= ${_atf} \ _atrun= atrun .endif -.if ${MK_BLACKLIST_SUPPORT} != "no" +.if ${MK_BLACKLIST} != "no" _blacklistd-helper+= blacklistd-helper .endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jun 7 16:26:34 2016 (r301552) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jun 7 16:31:03 2016 (r301553) @@ -431,7 +431,7 @@ OLD_FILES+=usr/share/man/man7/ldint.7.gz OLD_FILES+=usr/share/man/man7/binutils.7.gz .endif -.if ${MK_BLACKLIST_SUPPORT} == no +.if ${MK_BLACKLIST} == no OLD_FILES+=etc/rc.d/blacklistd OLD_FILES+=usr/include/blacklist.h OLD_FILES+=usr/lib/libblacklist.a Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Jun 7 16:26:34 2016 (r301552) +++ head/usr.sbin/Makefile Tue Jun 7 16:31:03 2016 (r301553) @@ -113,9 +113,9 @@ SUBDIR.${MK_AUDIT}+= auditreduce SUBDIR.${MK_AUDIT}+= praudit SUBDIR.${MK_AUTHPF}+= authpf SUBDIR.${MK_AUTOFS}+= autofs -.if ${MK_BLACKLIST_SUPPORT} != "no" -SUBDIR.${MK_BLACKLIST_SUPPORT}+= blacklistctl -SUBDIR.${MK_BLACKLIST_SUPPORT}+= blacklistd +.if ${MK_BLACKLIST} != "no" +SUBDIR.${MK_BLACKLIST}+= blacklistctl +SUBDIR.${MK_BLACKLIST}+= blacklistd .endif SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BOOTPARAMD}+= bootparamd From owner-svn-src-all@freebsd.org Tue Jun 7 16:35:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EAE6B6E944; Tue, 7 Jun 2016 16:35:57 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D09481188; Tue, 7 Jun 2016 16:35:56 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GZthR049368; Tue, 7 Jun 2016 16:35:55 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57GZtAJ049366; Tue, 7 Jun 2016 16:35:55 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606071635.u57GZtAJ049366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 7 Jun 2016 16:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301554 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:35:57 -0000 Author: lidl Date: Tue Jun 7 16:35:55 2016 New Revision: 301554 URL: https://svnweb.freebsd.org/changeset/base/301554 Log: Document BLACKLIST related build options Reported by: bdrewery Sponsored by: The FreeBSD Foundation Added: head/tools/build/options/WITHOUT_BLACKLIST (contents, props changed) head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT (contents, props changed) Added: head/tools/build/options/WITHOUT_BLACKLIST ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BLACKLIST Tue Jun 7 16:35:55 2016 (r301554) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set this if you do not want to build blacklistd / blacklistctl. Added: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT Tue Jun 7 16:35:55 2016 (r301554) @@ -0,0 +1,8 @@ +.\" $FreeBSD$ +Set to build some programs without blacklistd support, like +.Xr fingerd 8 , +.Xr ftpd 8 , +.Xr rlogind 8 , +.Xr rshd 8 , +and +.Xr sshd 8 . From owner-svn-src-all@freebsd.org Tue Jun 7 16:51:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37013B6E833; Tue, 7 Jun 2016 16:51:58 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0471311B7; Tue, 7 Jun 2016 16:51:57 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GpveW055078; Tue, 7 Jun 2016 16:51:57 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57Gpu3U055075; Tue, 7 Jun 2016 16:51:56 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606071651.u57Gpu3U055075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 7 Jun 2016 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301555 - head/contrib/blacklist/bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:51:58 -0000 Author: lidl Date: Tue Jun 7 16:51:56 2016 New Revision: 301555 URL: https://svnweb.freebsd.org/changeset/base/301555 Log: Bump dates in blacklist related manpages Reported by: araujo Sponsored by: The FreeBSD Foundation Modified: head/contrib/blacklist/bin/blacklistctl.8 head/contrib/blacklist/bin/blacklistd.8 head/contrib/blacklist/bin/blacklistd.conf.5 Modified: head/contrib/blacklist/bin/blacklistctl.8 ============================================================================== --- head/contrib/blacklist/bin/blacklistctl.8 Tue Jun 7 16:35:55 2016 (r301554) +++ head/contrib/blacklist/bin/blacklistctl.8 Tue Jun 7 16:51:56 2016 (r301555) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 29, 2015 +.Dd June 7, 2016 .Dt BLACKLISTCTL 8 .Os .Sh NAME Modified: head/contrib/blacklist/bin/blacklistd.8 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.8 Tue Jun 7 16:35:55 2016 (r301554) +++ head/contrib/blacklist/bin/blacklistd.8 Tue Jun 7 16:51:56 2016 (r301555) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 4, 2015 +.Dd June 7, 2016 .Dt BLACKLISTD 8 .Os .Sh NAME Modified: head/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.conf.5 Tue Jun 7 16:35:55 2016 (r301554) +++ head/contrib/blacklist/bin/blacklistd.conf.5 Tue Jun 7 16:51:56 2016 (r301555) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 29, 2015 +.Dd June 7, 2016 .Dt BLACKLISTD.CONF 5 .Os .Sh NAME From owner-svn-src-all@freebsd.org Tue Jun 7 16:53:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EC56B6E999; Tue, 7 Jun 2016 16:53:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58370139E; Tue, 7 Jun 2016 16:53:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57Gr53x057163; Tue, 7 Jun 2016 16:53:05 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57Gr5A4057162; Tue, 7 Jun 2016 16:53:05 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606071653.u57Gr5A4057162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 7 Jun 2016 16:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301556 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:53:06 -0000 Author: truckman Date: Tue Jun 7 16:53:05 2016 New Revision: 301556 URL: https://svnweb.freebsd.org/changeset/base/301556 Log: MFC r299921 Add an assertion to catch a potential underflow in an array index calculation, though this should not happen in the current code. Reported by: Coverity CID: 1008486 Modified: stable/10/sbin/ifconfig/ifieee80211.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/10/sbin/ifconfig/ifieee80211.c Tue Jun 7 16:51:56 2016 (r301555) +++ stable/10/sbin/ifconfig/ifieee80211.c Tue Jun 7 16:53:05 2016 (r301556) @@ -3626,6 +3626,7 @@ list_txpow(int s) /* suppress duplicates as above */ if (isset(reported, c->ic_ieee) && !verbose) { /* XXX we assume duplicates are adjacent */ + assert(achans->ic_nchans > 0); prev = &achans->ic_chans[achans->ic_nchans-1]; /* display highest power on channel */ if (c->ic_maxpower > prev->ic_maxpower) From owner-svn-src-all@freebsd.org Tue Jun 7 16:56:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95F3AB6EA9D; Tue, 7 Jun 2016 16:56:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7246F1752; Tue, 7 Jun 2016 16:56:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GuFpT057463; Tue, 7 Jun 2016 16:56:15 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57GuFr9057462; Tue, 7 Jun 2016 16:56:15 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606071656.u57GuFr9057462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Tue, 7 Jun 2016 16:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301557 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:56:16 -0000 Author: truckman Date: Tue Jun 7 16:56:15 2016 New Revision: 301557 URL: https://svnweb.freebsd.org/changeset/base/301557 Log: MFC r300564 Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes The length of the name returned from the $LOGNAME and $USER can be very long and it was being concatenated to a fixed length buffer with no bounds checking. Fix this problem by limiting the length of the name copied. Additionally, this name is actually used to create a format string to be used in adding log file entries so embedded % characters in the name could confuse *printf(), and embedded whitespace could confuse a log file parser. Handle the former by escaping each % with an additional %, and handle the latter by simply stripping it out. Clean up the code by moving the variable declarations to the top of the function, formatting them to conform with style, and moving intialization elsewhere. Reduce code indentation by returning early in a couple of places. Reported by: Coverity CID: 1006692 Reviewed by: markj (previous version) Differential Revision: https://reviews.freebsd.org/D6490 Modified: stable/10/usr.sbin/pw/pw_log.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw_log.c ============================================================================== --- stable/10/usr.sbin/pw/pw_log.c Tue Jun 7 16:53:05 2016 (r301556) +++ stable/10/usr.sbin/pw/pw_log.c Tue Jun 7 16:56:15 2016 (r301557) @@ -29,40 +29,90 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include +#include #include #include #include #include "pw.h" -static FILE *logfile = NULL; +static FILE *logfile = NULL; void pw_log(struct userconf * cnf, int mode, int which, char const * fmt,...) { - if (cnf->logfile && *cnf->logfile) { - if (logfile == NULL) { /* With umask==0 we need to control file access modes on create */ - int fd = open(cnf->logfile, O_WRONLY | O_CREAT | O_APPEND, 0600); + va_list argp; + time_t now; + const char *cp, *name; + struct tm *t; + int fd, i, rlen; + char nfmt[256], sname[32]; - if (fd != -1) - logfile = fdopen(fd, "a"); + if (cnf->logfile == NULL || cnf->logfile[0] == '\0') { + return; + } + + if (logfile == NULL) { + /* With umask==0 we need to control file access modes on create */ + fd = open(cnf->logfile, O_WRONLY | O_CREAT | O_APPEND, 0600); + if (fd == -1) { + return; } - if (logfile != NULL) { - va_list argp; - time_t now = time(NULL); - struct tm *t = localtime(&now); - char nfmt[256]; - const char *name; - - if ((name = getenv("LOGNAME")) == NULL && (name = getenv("USER")) == NULL) - name = "unknown"; - /* ISO 8601 International Standard Date format */ - strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t); - sprintf(nfmt + strlen(nfmt), "[%s:%s%s] %s\n", name, Which[which], Modes[mode], fmt); - va_start(argp, fmt); - vfprintf(logfile, nfmt, argp); - va_end(argp); - fflush(logfile); + logfile = fdopen(fd, "a"); + if (logfile == NULL) { + return; } } + + if ((name = getenv("LOGNAME")) == NULL && + (name = getenv("USER")) == NULL) { + strcpy(sname, "unknown"); + } else { + /* + * Since "name" will be embedded in a printf-like format, + * we must sanitize it: + * + * Limit its length so other information in the message + * is not truncated + * + * Squeeze out embedded whitespace for the benefit of + * log file parsers + * + * Escape embedded % characters with another % + */ + for (i = 0, cp = name; + *cp != '\0' && i < (int)sizeof(sname) - 1; cp++) { + if (*cp == '%') { + if (i < (int)sizeof(sname) - 2) { + sname[i++] = '%'; + sname[i++] = '%'; + } else { + break; + } + } else if (!isspace(*cp)) { + sname[i++] = *cp; + } /* else do nothing */ + } + if (i == 0) { + strcpy(sname, "unknown"); + } else { + sname[i] = '\0'; + } + } + now = time(NULL); + t = localtime(&now); + /* ISO 8601 International Standard Date format */ + strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t); + rlen = sizeof(nfmt) - strlen(nfmt); + if (rlen <= 0 || snprintf(nfmt + strlen(nfmt), rlen, + "[%s:%s%s] %s\n", sname, Which[which], Modes[mode], + fmt) >= rlen) { + warnx("log format overflow, user name=%s", sname); + } else { + va_start(argp, fmt); + vfprintf(logfile, nfmt, argp); + va_end(argp); + fflush(logfile); + } } From owner-svn-src-all@freebsd.org Tue Jun 7 16:57:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C94BB6EB1E; Tue, 7 Jun 2016 16:57:15 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E94C01963; Tue, 7 Jun 2016 16:57:14 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57GvEwl057568; Tue, 7 Jun 2016 16:57:14 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57GvD1I057564; Tue, 7 Jun 2016 16:57:13 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201606071657.u57GvD1I057564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Tue, 7 Jun 2016 16:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301558 - in head/sys/netgraph/bluetooth: l2cap socket X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 16:57:15 -0000 Author: takawata Date: Tue Jun 7 16:57:13 2016 New Revision: 301558 URL: https://svnweb.freebsd.org/changeset/base/301558 Log: Disconnect LE socket when the HCI connection associated is disconnected. Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c Tue Jun 7 16:56:15 2016 (r301557) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c Tue Jun 7 16:57:13 2016 (r301558) @@ -346,7 +346,8 @@ ng_l2cap_new_chan(ng_l2cap_p l2cap, ng_l ch->scid = ng_l2cap_get_cid(l2cap, (con->linktype!= NG_HCI_LINK_ACL)); } - + + ch->idtype = idtype; if (ch->scid != NG_L2CAP_NULL_CID) { /* Initialize channel */ ch->psm = psm; Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c Tue Jun 7 16:56:15 2016 (r301557) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c Tue Jun 7 16:57:13 2016 (r301558) @@ -1389,7 +1389,13 @@ ng_l2cap_l2ca_discon_ind(ng_l2cap_chan_p error = ENOMEM; else { ip = (ng_l2cap_l2ca_discon_ind_ip *)(msg->data); - ip->lcid = ch->scid; + ip->idtype = ch->idtype; + if(ch->idtype == NG_L2CAP_L2CA_IDTYPE_ATT|| + ch->idtype == NG_L2CAP_L2CA_IDTYPE_SMP) + ip->lcid = ch->con->con_handle; + else + ip->lcid = ch->scid; + NG_SEND_MSG_HOOK(error, l2cap->node, msg, l2cap->l2c, 0); } Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 7 16:56:15 2016 (r301557) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 7 16:57:13 2016 (r301558) @@ -1115,7 +1115,7 @@ ng_btsocket_l2cap_process_l2ca_discon_in /* Look for the socket with given channel ID */ pcb = ng_btsocket_l2cap_pcb_by_cid(&rt->src, ip->lcid, - NG_L2CAP_L2CA_IDTYPE_BREDR); + ip->idtype); if (pcb == NULL) { mtx_unlock(&ng_btsocket_l2cap_sockets_mtx); return (0); From owner-svn-src-all@freebsd.org Tue Jun 7 17:08:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C988B6ED6F; Tue, 7 Jun 2016 17:08:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D44C01E40; Tue, 7 Jun 2016 17:08:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57H8ZY6061686; Tue, 7 Jun 2016 17:08:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57H8Yfx061683; Tue, 7 Jun 2016 17:08:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606071708.u57H8Yfx061683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Jun 2016 17:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301559 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 17:08:36 -0000 Author: pfg Date: Tue Jun 7 17:08:34 2016 New Revision: 301559 URL: https://svnweb.freebsd.org/changeset/base/301559 Log: ext2fs(5): Cosmetic cleanups, mostly to the ext4 code. Obtained from: NetBSD Modified: head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Tue Jun 7 16:57:13 2016 (r301558) +++ head/sys/fs/ext2fs/ext2_bmap.c Tue Jun 7 17:08:34 2016 (r301559) @@ -86,8 +86,8 @@ ext2_bmap(struct vop_bmap_args *ap) } /* - * This function converts the logical block number of a file to - * its physical block number on the disk within ext4 extents. + * Convert the logical block number of a file to its physical block number + * on the disk within ext4 extents. */ static int ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bnp, int *runp, int *runb) @@ -97,7 +97,7 @@ ext4_bmapext(struct vnode *vp, int32_t b struct ext4_extent *ep; struct ext4_extent_path path = { .ep_bp = NULL }; daddr_t lbn; - int ret = 0; + int error = 0; ip = VTOI(vp); fs = ip->i_e2fs; @@ -120,7 +120,7 @@ ext4_bmapext(struct vnode *vp, int32_t b } else { ep = path.ep_ext; if (ep == NULL) - ret = EIO; + error = EIO; else { *bnp = fsbtodb(fs, lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); @@ -140,7 +140,7 @@ ext4_bmapext(struct vnode *vp, int32_t b path.ep_bp = NULL; } - return (ret); + return (error); } /* Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Tue Jun 7 16:57:13 2016 (r301558) +++ head/sys/fs/ext2fs/ext2_extents.h Tue Jun 7 17:08:34 2016 (r301559) @@ -40,8 +40,8 @@ * Ext4 file system extent on disk. */ struct ext4_extent { - uint32_t e_blk; /* first logical block */ - uint16_t e_len; /* number of blocks */ + uint32_t e_blk; /* first logical block */ + uint16_t e_len; /* number of blocks */ uint16_t e_start_hi; /* high 16 bits of physical block */ uint32_t e_start_lo; /* low 32 bits of physical block */ }; Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Tue Jun 7 16:57:13 2016 (r301558) +++ head/sys/fs/ext2fs/ext2fs.h Tue Jun 7 17:08:34 2016 (r301559) @@ -87,7 +87,7 @@ struct ext2fs { uint32_t e3fs_journal_dev; /* device number of journal file */ uint32_t e3fs_last_orphan; /* start of list of inodes to delete */ uint32_t e3fs_hash_seed[4]; /* HTREE hash seed */ - char e3fs_def_hash_version; /* Default hash version to use */ + char e3fs_def_hash_version;/* Default hash version to use */ char e3fs_jnl_backup_type; uint16_t e3fs_desc_size; /* size of group descriptor */ uint32_t e3fs_default_mount_opts; @@ -97,13 +97,13 @@ struct ext2fs { uint32_t e4fs_bcount_hi; /* high bits of blocks count */ uint32_t e4fs_rbcount_hi; /* high bits of reserved blocks count */ uint32_t e4fs_fbcount_hi; /* high bits of free blocks count */ - uint16_t e4fs_min_extra_isize; /* all inodes have at least some bytes */ - uint16_t e4fs_want_extra_isize; /* inodes must reserve some bytes */ + uint16_t e4fs_min_extra_isize; /* all inodes have some bytes */ + uint16_t e4fs_want_extra_isize;/* inodes must reserve some bytes */ uint32_t e4fs_flags; /* miscellaneous flags */ uint16_t e4fs_raid_stride; /* RAID stride */ - uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ + uint16_t e4fs_mmpintv; /* seconds to wait in MMP checking */ uint64_t e4fs_mmpblk; /* block for multi-mount protection */ - uint32_t e4fs_raid_stripe_wid; /* blocks on all data disks (N * stride) */ + uint32_t e4fs_raid_stripe_wid; /* blocks on data disks (N * stride) */ uint8_t e4fs_log_gpf; /* FLEX_BG group size */ uint8_t e4fs_chksum_type; /* metadata checksum algorithm used */ uint8_t e4fs_encrypt; /* versioning level for encryption */ @@ -117,7 +117,7 @@ struct ext2fs { uint32_t e4fs_first_errtime; /* first time an error happened */ uint32_t e4fs_first_errino; /* inode involved in first error */ uint64_t e4fs_first_errblk; /* block involved of first error */ - uint8_t e4fs_first_errfunc[32]; /* function where error happened */ + uint8_t e4fs_first_errfunc[32];/* function where error happened */ uint32_t e4fs_first_errline; /* line number where error happened */ uint32_t e4fs_last_errtime; /* most recent time of an error */ uint32_t e4fs_last_errino; /* inode involved in last error */ @@ -127,10 +127,10 @@ struct ext2fs { uint8_t e4fs_mount_opts[64]; uint32_t e4fs_usrquota_inum; /* inode for tracking user quota */ uint32_t e4fs_grpquota_inum; /* inode for tracking group quota */ - uint32_t e4fs_overhead_clusters; /* overhead blocks/clusters */ + uint32_t e4fs_overhead_clusters;/* overhead blocks/clusters */ uint32_t e4fs_backup_bgs[2]; /* groups with sparse_super2 SBs */ - uint8_t e4fs_encrypt_algos[4]; /* encryption algorithms in use */ - uint8_t e4fs_encrypt_pw_salt[16]; /* salt used for string2key */ + uint8_t e4fs_encrypt_algos[4];/* encryption algorithms in use */ + uint8_t e4fs_encrypt_pw_salt[16];/* salt used for string2key */ uint32_t e4fs_lpf_ino; /* location of the lost+found inode */ uint32_t e4fs_proj_quota_inum; /* inode for tracking project quota */ uint32_t e4fs_chksum_seed; /* checksum seed */ From owner-svn-src-all@freebsd.org Tue Jun 7 18:23:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98504B6E27A; Tue, 7 Jun 2016 18:23:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D48A16FC; Tue, 7 Jun 2016 18:23:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57INMNb094062; Tue, 7 Jun 2016 18:23:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57INMkX094061; Tue, 7 Jun 2016 18:23:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606071823.u57INMkX094061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Jun 2016 18:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301560 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 18:23:23 -0000 Author: pfg Date: Tue Jun 7 18:23:22 2016 New Revision: 301560 URL: https://svnweb.freebsd.org/changeset/base/301560 Log: ext2fs: rearrange ext4_bmapext(). While here assign error a bit later. Reviewed by: Damjan Jovanovich Obtained from: NetBSD Modified: head/sys/fs/ext2fs/ext2_bmap.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Tue Jun 7 17:08:34 2016 (r301559) +++ head/sys/fs/ext2fs/ext2_bmap.c Tue Jun 7 18:23:22 2016 (r301560) @@ -97,7 +97,7 @@ ext4_bmapext(struct vnode *vp, int32_t b struct ext4_extent *ep; struct ext4_extent_path path = { .ep_bp = NULL }; daddr_t lbn; - int error = 0; + int error; ip = VTOI(vp); fs = ip->i_e2fs; @@ -105,9 +105,9 @@ ext4_bmapext(struct vnode *vp, int32_t b if (runp != NULL) *runp = 0; - if (runb != NULL) *runb = 0; + error = 0; ext4_ext_find_extent(fs, ip, lbn, &path); if (path.ep_is_sparse) { @@ -118,27 +118,26 @@ ext4_bmapext(struct vnode *vp, int32_t b if (runb != NULL) *runb = lbn - path.ep_sparse_ext.e_blk; } else { - ep = path.ep_ext; - if (ep == NULL) + if ( path.ep_ext == NULL) { error = EIO; - else { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - - if (*bnp == 0) - *bnp = -1; - - if (runp != NULL) - *runp = ep->e_len - (lbn - ep->e_blk) - 1; - if (runb != NULL) - *runb = lbn - ep->e_blk; + goto out; } + ep = path.ep_ext; + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + + if (*bnp == 0) + *bnp = -1; + + if (runp != NULL) + *runp = ep->e_len - (lbn - ep->e_blk) - 1; + if (runb != NULL) + *runb = lbn - ep->e_blk; } - if (path.ep_bp != NULL) { +out: + if (path.ep_bp != NULL) brelse(path.ep_bp); - path.ep_bp = NULL; - } return (error); } From owner-svn-src-all@freebsd.org Tue Jun 7 18:50:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1763BB6E7A0; Tue, 7 Jun 2016 18:50:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C254C1350; Tue, 7 Jun 2016 18:50:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57Iobvl004410; Tue, 7 Jun 2016 18:50:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57Ioa1b004408; Tue, 7 Jun 2016 18:50:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606071850.u57Ioa1b004408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 7 Jun 2016 18:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301561 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 18:50:38 -0000 Author: andrew Date: Tue Jun 7 18:50:36 2016 New Revision: 301561 URL: https://svnweb.freebsd.org/changeset/base/301561 Log: Start to clean MIDR values using the CPUID scheme. We don't need to know the exact CPU we are running on to set the cpu functions. Relax the check to ignore the CPU revision. Even so this may still be too specific. Reviewed by: mmel Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D6504 Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/include/armreg.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Tue Jun 7 18:23:22 2016 (r301560) +++ head/sys/arm/arm/cpufunc.c Tue Jun 7 18:50:36 2016 (r301561) @@ -761,25 +761,19 @@ set_cpufuncs() } #endif /* CPU_ARM1176 */ #if defined(CPU_CORTEXA) || defined(CPU_KRAIT) - if (cputype == CPU_ID_CORTEXA5 || - cputype == CPU_ID_CORTEXA7 || - cputype == CPU_ID_CORTEXA8R1 || - cputype == CPU_ID_CORTEXA8R2 || - cputype == CPU_ID_CORTEXA8R3 || - cputype == CPU_ID_CORTEXA9R1 || - cputype == CPU_ID_CORTEXA9R2 || - cputype == CPU_ID_CORTEXA9R3 || - cputype == CPU_ID_CORTEXA9R4 || - cputype == CPU_ID_CORTEXA12R0 || - cputype == CPU_ID_CORTEXA15R0 || - cputype == CPU_ID_CORTEXA15R1 || - cputype == CPU_ID_CORTEXA15R2 || - cputype == CPU_ID_CORTEXA15R3 || - cputype == CPU_ID_KRAIT300R0 || - cputype == CPU_ID_KRAIT300R1 ) { + switch(cputype & CPU_ID_SCHEME_MASK) { + case CPU_ID_CORTEXA5: + case CPU_ID_CORTEXA7: + case CPU_ID_CORTEXA8: + case CPU_ID_CORTEXA9: + case CPU_ID_CORTEXA12: + case CPU_ID_CORTEXA15: + case CPU_ID_KRAIT300: cpufuncs = cortexa_cpufuncs; get_cachetype_cp15(); goto out; + default: + break; } #endif /* CPU_CORTEXA */ Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Tue Jun 7 18:23:22 2016 (r301560) +++ head/sys/arm/include/armreg.h Tue Jun 7 18:50:36 2016 (r301561) @@ -72,10 +72,16 @@ #define CPU_ID_IMPLEMENTOR_MASK 0xff000000 #define CPU_ID_ARM_LTD 0x41000000 /* 'A' */ #define CPU_ID_DEC 0x44000000 /* 'D' */ -#define CPU_ID_INTEL 0x69000000 /* 'i' */ +#define CPU_ID_MOTOROLA 0x4D000000 /* 'M' */ +#define CPU_ID_QUALCOM 0x51000000 /* 'Q' */ #define CPU_ID_TI 0x54000000 /* 'T' */ +#define CPU_ID_MARVELL 0x56000000 /* 'V' */ +#define CPU_ID_INTEL 0x69000000 /* 'i' */ #define CPU_ID_FARADAY 0x66000000 /* 'f' */ +#define CPU_ID_VARIANT_SHIFT 20 +#define CPU_ID_VARIANT_MASK 0x00f00000 + /* How to decide what format the CPUID is in. */ #define CPU_ID_ISOLD(x) (((x) & 0x0000f000) == 0x00000000) #define CPU_ID_IS7(x) (((x) & 0x0000f000) == 0x00007000) @@ -92,7 +98,6 @@ #define CPU_ID_ARCH_V5TEJ 0x00060000 #define CPU_ID_ARCH_V6 0x00070000 #define CPU_ID_CPUID_SCHEME 0x000f0000 -#define CPU_ID_VARIANT_MASK 0x00f00000 /* Next three nybbles are part number */ #define CPU_ID_PARTNO_MASK 0x0000fff0 @@ -123,22 +128,35 @@ #define CPU_ID_ARM1136JS 0x4107b360 #define CPU_ID_ARM1136JSR1 0x4117b360 #define CPU_ID_ARM1176JZS 0x410fb760 -#define CPU_ID_CORTEXA5 0x410fc050 -#define CPU_ID_CORTEXA7 0x410fc070 -#define CPU_ID_CORTEXA8R1 0x411fc080 -#define CPU_ID_CORTEXA8R2 0x412fc080 -#define CPU_ID_CORTEXA8R3 0x413fc080 -#define CPU_ID_CORTEXA9R1 0x411fc090 -#define CPU_ID_CORTEXA9R2 0x412fc090 -#define CPU_ID_CORTEXA9R3 0x413fc090 -#define CPU_ID_CORTEXA9R4 0x414fc090 -#define CPU_ID_CORTEXA12R0 0x410fc0d0 -#define CPU_ID_CORTEXA15R0 0x410fc0f0 -#define CPU_ID_CORTEXA15R1 0x411fc0f0 -#define CPU_ID_CORTEXA15R2 0x412fc0f0 -#define CPU_ID_CORTEXA15R3 0x413fc0f0 -#define CPU_ID_KRAIT300R0 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */ -#define CPU_ID_KRAIT300R1 0x511f06f0 + +/* CPUs that follow the CPUID scheme */ +#define CPU_ID_SCHEME_MASK \ + (CPU_ID_IMPLEMENTOR_MASK | CPU_ID_ARCH_MASK | CPU_ID_PARTNO_MASK) + +#define CPU_ID_CORTEXA5 (CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 0xc050) +#define CPU_ID_CORTEXA7 (CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 0xc070) +#define CPU_ID_CORTEXA8 (CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 0xc080) +#define CPU_ID_CORTEXA8R1 (CPU_ID_CORTEXA8 | (1 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA8R2 (CPU_ID_CORTEXA8 | (2 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA8R3 (CPU_ID_CORTEXA8 | (3 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA9 (CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 0xc090) +#define CPU_ID_CORTEXA9R1 (CPU_ID_CORTEXA9 | (1 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA9R2 (CPU_ID_CORTEXA9 | (2 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA9R3 (CPU_ID_CORTEXA9 | (3 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA9R4 (CPU_ID_CORTEXA9 | (4 << CPU_ID_VARIANT_SHIFT)) +/* XXX: Cortx-A12 is the old name for this part, it has been renamed the A17 */ +#define CPU_ID_CORTEXA12 (CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 0xc0d0) +#define CPU_ID_CORTEXA12R0 (CPU_ID_CORTEXA12 | (0 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA15 (CPU_ID_ARM_LTD | CPU_ID_CPUID_SCHEME | 0xc0f0) +#define CPU_ID_CORTEXA15R0 (CPU_ID_CORTEXA15 | (0 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA15R1 (CPU_ID_CORTEXA15 | (1 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA15R2 (CPU_ID_CORTEXA15 | (2 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_CORTEXA15R3 (CPU_ID_CORTEXA15 | (3 << CPU_ID_VARIANT_SHIFT)) + +#define CPU_ID_KRAIT300 (CPU_ID_QUALCOM | CPU_ID_CPUID_SCHEME | 0x06f0) +/* Snapdragon S4 Pro/APQ8064 */ +#define CPU_ID_KRAIT300R0 (CPU_ID_KRAIT300 | (0 << CPU_ID_VARIANT_SHIFT)) +#define CPU_ID_KRAIT300R1 (CPU_ID_KRAIT300 | (1 << CPU_ID_VARIANT_SHIFT)) #define CPU_ID_TI925T 0x54029250 #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ From owner-svn-src-all@freebsd.org Tue Jun 7 19:08:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 187D4B6ED69; Tue, 7 Jun 2016 19:08:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD7041E6B; Tue, 7 Jun 2016 19:08:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57J8EkX011735; Tue, 7 Jun 2016 19:08:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57J8EZI011734; Tue, 7 Jun 2016 19:08:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606071908.u57J8EZI011734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 7 Jun 2016 19:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301562 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 19:08:15 -0000 Author: cem Date: Tue Jun 7 19:08:13 2016 New Revision: 301562 URL: https://svnweb.freebsd.org/changeset/base/301562 Log: Fix a minor leak in ACPI thermal Introduced in r301518. Reported by: Coverity CID: 1356266 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/acpica/acpi_thermal.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Tue Jun 7 18:50:36 2016 (r301561) +++ head/sys/dev/acpica/acpi_thermal.c Tue Jun 7 19:08:13 2016 (r301562) @@ -335,8 +335,10 @@ acpi_tz_startup(void *arg __unused) int devcount, error, i; devclass_get_devices(acpi_tz_devclass, &devs, &devcount); - if (devcount == 0) + if (devcount == 0) { + free(devs, M_TEMP); return; + } /* * Create thread to service all of the thermal zones. From owner-svn-src-all@freebsd.org Tue Jun 7 19:49:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F860B6D5B6; Tue, 7 Jun 2016 19:49:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 204951F24; Tue, 7 Jun 2016 19:49:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57Jn84K027276; Tue, 7 Jun 2016 19:49:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57Jn8R0027275; Tue, 7 Jun 2016 19:49:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606071949.u57Jn8R0027275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 7 Jun 2016 19:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301563 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 19:49:09 -0000 Author: cem Date: Tue Jun 7 19:49:08 2016 New Revision: 301563 URL: https://svnweb.freebsd.org/changeset/base/301563 Log: iflib: Fix potential leak in iflib_if_transmit Due to an accidental mismatch between allocation and release in the slow path of iflib_if_transmit, if a caller passed 9-16 mbufs to the routine, the mbuf array would be leaked. Fix the mismatch by removing the magic numbers in favor of nitems() on the stack array. According to mmacy, this leak is unlikely. Reported by: Coverity Discussed with: mmacy CID: 1356040 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Jun 7 19:08:13 2016 (r301562) +++ head/sys/net/iflib.c Tue Jun 7 19:49:08 2016 (r301563) @@ -3085,7 +3085,7 @@ iflib_if_transmit(if_t ifp, struct mbuf next = next->m_nextpkt; } while (next != NULL); - if (count > 8) + if (count > nitems(marr)) if ((mp = malloc(count*sizeof(struct mbuf *), M_IFLIB, M_NOWAIT)) == NULL) { /* XXX check nextpkt */ m_freem(m); @@ -3112,7 +3112,7 @@ iflib_if_transmit(if_t ifp, struct mbuf m_freem(mp[i]); ifmp_ring_check_drainage(txq->ift_br[0], TX_BATCH_SIZE); } - if (count > 16) + if (count > nitems(marr)) free(mp, M_IFLIB); return (err); From owner-svn-src-all@freebsd.org Tue Jun 7 20:00:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DC5FB6DA62; Tue, 7 Jun 2016 20:00:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BA2518DA; Tue, 7 Jun 2016 20:00:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57K0KGv031329; Tue, 7 Jun 2016 20:00:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57K0KN0031328; Tue, 7 Jun 2016 20:00:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606072000.u57K0KN0031328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 7 Jun 2016 20:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301564 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 20:00:21 -0000 Author: cem Date: Tue Jun 7 20:00:20 2016 New Revision: 301564 URL: https://svnweb.freebsd.org/changeset/base/301564 Log: nfs_clvfsops: Prevent strdup of stack garbage with bogus mount specs If strlen(hostp) was zero, the stack array 'nam' would never be initialized before being strdup()ed. Fix this by initializing it to the empty string. It's possible some external condition makes this case impossible, in which case, an assertion instead of this workaround is appropriate. Introduced in r299848. Reported by: Coverity CID: 1355336 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jun 7 19:49:08 2016 (r301563) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jun 7 20:00:20 2016 (r301564) @@ -806,7 +806,8 @@ nfs_mount_parse_from(struct vfsoptlist * nam[len + offset++] = ':'; memmove(nam + len + offset, spec, speclen); nam[len + speclen + offset] = '\0'; - } + } else + nam[0] = '\0'; /* * XXX: IPv6 From owner-svn-src-all@freebsd.org Tue Jun 7 20:14:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7754B6E0CE; Tue, 7 Jun 2016 20:14:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 671AE1146; Tue, 7 Jun 2016 20:14:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57KE840038205; Tue, 7 Jun 2016 20:14:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57KE83m038204; Tue, 7 Jun 2016 20:14:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606072014.u57KE83m038204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 7 Jun 2016 20:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301565 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 20:14:09 -0000 Author: andrew Date: Tue Jun 7 20:14:08 2016 New Revision: 301565 URL: https://svnweb.freebsd.org/changeset/base/301565 Log: Switch arm64 to use intrng by default. The old interrupt handling code can still be used, however this is expected to be removed soon. Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Deleted: head/sys/arm64/conf/GENERIC-INTRNG Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Jun 7 20:00:20 2016 (r301564) +++ head/sys/arm64/conf/GENERIC Tue Jun 7 20:14:08 2016 (r301565) @@ -70,6 +70,7 @@ options RACCT # Resource accounting f options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options RCTL # Resource limits options SMP +options INTRNG # Debugging support. Always need this: options KDB # Enable kernel debugger support. From owner-svn-src-all@freebsd.org Tue Jun 7 20:16:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF7EB6E188; Tue, 7 Jun 2016 20:16:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49DC12E9; Tue, 7 Jun 2016 20:16:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57KG28M038311; Tue, 7 Jun 2016 20:16:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57KG2Dj038310; Tue, 7 Jun 2016 20:16:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606072016.u57KG2Dj038310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 7 Jun 2016 20:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301566 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 20:16:03 -0000 Author: cem Date: Tue Jun 7 20:16:01 2016 New Revision: 301566 URL: https://svnweb.freebsd.org/changeset/base/301566 Log: nfs_clvfsops: Fix leading whitespace introduced in r299848 Replace spaces with tabs. No functional change. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jun 7 20:14:08 2016 (r301565) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jun 7 20:16:01 2016 (r301566) @@ -763,37 +763,37 @@ nfs_mount_parse_from(struct vfsoptlist * /* * This part comes from sbin/mount_nfs/mount_nfs.c:getnfsargs(). */ - if (*spec == '[' && (delimp = strchr(spec + 1, ']')) != NULL && - *(delimp + 1) == ':') { - hostp = spec + 1; - spec = delimp + 2; - have_bracket = 1; - } else if ((delimp = strrchr(spec, ':')) != NULL) { - hostp = spec; - spec = delimp + 1; - } else if ((delimp = strrchr(spec, '@')) != NULL) { - printf("%s: path@server syntax is deprecated, " + if (*spec == '[' && (delimp = strchr(spec + 1, ']')) != NULL && + *(delimp + 1) == ':') { + hostp = spec + 1; + spec = delimp + 2; + have_bracket = 1; + } else if ((delimp = strrchr(spec, ':')) != NULL) { + hostp = spec; + spec = delimp + 1; + } else if ((delimp = strrchr(spec, '@')) != NULL) { + printf("%s: path@server syntax is deprecated, " "use server:path\n", __func__); - hostp = delimp + 1; - } else { - printf("%s: no : nfs-name\n", __func__); - return (EINVAL); - } - *delimp = '\0'; - - /* - * If there has been a trailing slash at mounttime it seems - * that some mountd implementations fail to remove the mount - * entries from their mountlist while unmounting. - */ - for (speclen = strlen(spec); - speclen > 1 && spec[speclen - 1] == '/'; - speclen--) - spec[speclen - 1] = '\0'; - if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { - printf("%s: %s:%s: name too long", __func__, hostp, spec); - return (EINVAL); - } + hostp = delimp + 1; + } else { + printf("%s: no : nfs-name\n", __func__); + return (EINVAL); + } + *delimp = '\0'; + + /* + * If there has been a trailing slash at mounttime it seems + * that some mountd implementations fail to remove the mount + * entries from their mountlist while unmounting. + */ + for (speclen = strlen(spec); + speclen > 1 && spec[speclen - 1] == '/'; + speclen--) + spec[speclen - 1] = '\0'; + if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { + printf("%s: %s:%s: name too long", __func__, hostp, spec); + return (EINVAL); + } /* Make both '@' and ':' notations equal */ if (*hostp != '\0') { len = strlen(hostp); From owner-svn-src-all@freebsd.org Tue Jun 7 20:26:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC29EB6E3F7; Tue, 7 Jun 2016 20:26:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9169E198B; Tue, 7 Jun 2016 20:26:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57KQ0M8042360; Tue, 7 Jun 2016 20:26:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57KQ0FR042359; Tue, 7 Jun 2016 20:26:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606072026.u57KQ0FR042359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 7 Jun 2016 20:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301567 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 20:26:02 -0000 Author: cem Date: Tue Jun 7 20:26:00 2016 New Revision: 301567 URL: https://svnweb.freebsd.org/changeset/base/301567 Log: iflib: Improve cleanup on iflib_queues_alloc error path Fix some memory leaks. Some may remain. Reported by: Coverity Discussed with: mmacy CIDs: 1356036, 1356037, 1356038 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Jun 7 20:16:01 2016 (r301566) +++ head/sys/net/iflib.c Tue Jun 7 20:26:00 2016 (r301567) @@ -3863,6 +3863,9 @@ iflib_queues_alloc(if_ctx_t ctx) KASSERT(ntxqs > 0, ("number of queues must be at least 1")); KASSERT(nrxqs > 0, ("number of queues must be at least 1")); + brscp = NULL; + rxq = NULL; + /* Allocate the TX ring struct memory */ if (!(txq = (iflib_txq_t) malloc(sizeof(struct iflib_txq) * @@ -3888,6 +3891,8 @@ iflib_queues_alloc(if_ctx_t ctx) ctx->ifc_txqs = txq; ctx->ifc_rxqs = rxq; + txq = NULL; + rxq = NULL; /* * XXX handle allocation failure @@ -3898,7 +3903,7 @@ iflib_queues_alloc(if_ctx_t ctx) if ((ifdip = malloc(sizeof(struct iflib_dma_info) * ntxqs, M_IFLIB, M_WAITOK|M_ZERO)) == NULL) { device_printf(dev, "failed to allocate iflib_dma_info\n"); err = ENOMEM; - goto fail; + goto err_tx_desc; } txq->ift_ifdi = ifdip; for (j = 0; j < ntxqs; j++, ifdip++) { @@ -3940,7 +3945,7 @@ iflib_queues_alloc(if_ctx_t ctx) if (err) { /* XXX free any allocated rings */ device_printf(dev, "Unable to allocate buf_ring\n"); - goto fail; + goto err_tx_desc; } } } @@ -3951,7 +3956,7 @@ iflib_queues_alloc(if_ctx_t ctx) if ((ifdip = malloc(sizeof(struct iflib_dma_info) * nrxqs, M_IFLIB, M_WAITOK|M_ZERO)) == NULL) { device_printf(dev, "failed to allocate iflib_dma_info\n"); err = ENOMEM; - goto fail; + goto err_tx_desc; } rxq->ifr_ifdi = ifdip; @@ -3975,7 +3980,7 @@ iflib_queues_alloc(if_ctx_t ctx) (iflib_fl_t) malloc(sizeof(struct iflib_fl) * nfree_lists, M_IFLIB, M_NOWAIT | M_ZERO))) { device_printf(dev, "Unable to allocate free list memory\n"); err = ENOMEM; - goto fail; + goto err_tx_desc; } rxq->ifr_fl = fl; for (j = 0; j < nfree_lists; j++) { @@ -4042,10 +4047,16 @@ err_tx_desc: if (ctx->ifc_rxqs != NULL) free(ctx->ifc_rxqs, M_IFLIB); ctx->ifc_rxqs = NULL; -rx_fail: if (ctx->ifc_txqs != NULL) free(ctx->ifc_txqs, M_IFLIB); ctx->ifc_txqs = NULL; +rx_fail: + if (brscp != NULL) + free(brscp, M_IFLIB); + if (rxq != NULL) + free(rxq, M_IFLIB); + if (txq != NULL) + free(txq, M_IFLIB); fail: return (err); } From owner-svn-src-all@freebsd.org Tue Jun 7 20:33:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FDDDB6E6B0; Tue, 7 Jun 2016 20:33:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40F911EDD; Tue, 7 Jun 2016 20:33:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57KXtQZ055565; Tue, 7 Jun 2016 20:33:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57KXtjA055563; Tue, 7 Jun 2016 20:33:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606072033.u57KXtjA055563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 7 Jun 2016 20:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301568 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 20:33:56 -0000 Author: cem Date: Tue Jun 7 20:33:55 2016 New Revision: 301568 URL: https://svnweb.freebsd.org/changeset/base/301568 Log: Fix memory leaks in (a|)daregister introduced in r298002 In the case where cam_iosched_init() fails, the ada and da softcs were leaked. Instead, free them. Reported by: Coverity CID: 1356039 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Jun 7 20:26:00 2016 (r301567) +++ head/sys/cam/ata/ata_da.c Tue Jun 7 20:33:55 2016 (r301568) @@ -1672,6 +1672,7 @@ adaregister(struct cam_periph *periph, v if (cam_iosched_init(&softc->cam_iosched, periph) != 0) { printf("adaregister: Unable to probe new device. " "Unable to allocate iosched memory\n"); + free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 7 20:26:00 2016 (r301567) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 7 20:33:55 2016 (r301568) @@ -2377,6 +2377,7 @@ daregister(struct cam_periph *periph, vo if (cam_iosched_init(&softc->cam_iosched, periph) != 0) { printf("daregister: Unable to probe new device. " "Unable to allocate iosched memory\n"); + free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } From owner-svn-src-all@freebsd.org Tue Jun 7 21:40:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B917FB6E544; Tue, 7 Jun 2016 21:40:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FBB81D07; Tue, 7 Jun 2016 21:40:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u57Legki077647; Tue, 7 Jun 2016 21:40:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u57Leg8V077646; Tue, 7 Jun 2016 21:40:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606072140.u57Leg8V077646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Jun 2016 21:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301569 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2016 21:40:43 -0000 Author: pfg Date: Tue Jun 7 21:40:42 2016 New Revision: 301569 URL: https://svnweb.freebsd.org/changeset/base/301569 Log: ext2fs: Stop dropping and reacquiring Giant around geom calls. As in UFS r300366. Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Tue Jun 7 20:33:55 2016 (r301568) +++ head/sys/fs/ext2fs/ext2_vfsops.c Tue Jun 7 21:40:42 2016 (r301569) @@ -158,11 +158,9 @@ ext2_mount(struct mount *mp) } fs->e2fs_ronly = 1; vfs_flagopt(opts, "ro", &mp->mnt_flag, MNT_RDONLY); - DROP_GIANT(); g_topology_lock(); g_access(ump->um_cp, 0, -1, 0); g_topology_unlock(); - PICKUP_GIANT(); } if (!error && (mp->mnt_flag & MNT_RELOAD)) error = ext2_reload(mp, td); @@ -187,11 +185,9 @@ ext2_mount(struct mount *mp) return (error); } VOP_UNLOCK(devvp, 0); - DROP_GIANT(); g_topology_lock(); error = g_access(ump->um_cp, 0, 1, 0); g_topology_unlock(); - PICKUP_GIANT(); if (error) return (error); @@ -547,11 +543,9 @@ ext2_mountfs(struct vnode *devvp, struct ronly = vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0); /* XXX: use VOP_ACESS to check FS perms */ - DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "ext2fs", ronly ? 0 : 1); g_topology_unlock(); - PICKUP_GIANT(); VOP_UNLOCK(devvp, 0); if (error) return (error); @@ -559,11 +553,9 @@ ext2_mountfs(struct vnode *devvp, struct /* XXX: should we check for some sectorsize or 512 instead? */ if (((SBSIZE % cp->provider->sectorsize) != 0) || (SBSIZE < cp->provider->sectorsize)) { - DROP_GIANT(); g_topology_lock(); g_vfs_close(cp); g_topology_unlock(); - PICKUP_GIANT(); return (EINVAL); } @@ -683,11 +675,9 @@ out: if (bp) brelse(bp); if (cp != NULL) { - DROP_GIANT(); g_topology_lock(); g_vfs_close(cp); g_topology_unlock(); - PICKUP_GIANT(); } if (ump) { mtx_destroy(EXT2_MTX(ump)); @@ -729,11 +719,9 @@ ext2_unmount(struct mount *mp, int mntfl ext2_sbupdate(ump, MNT_WAIT); } - DROP_GIANT(); g_topology_lock(); g_vfs_close(ump->um_cp); g_topology_unlock(); - PICKUP_GIANT(); vrele(ump->um_devvp); sump = fs->e2fs_clustersum; for (i = 0; i < fs->e2fs_gcount; i++, sump++) From owner-svn-src-all@freebsd.org Wed Jun 8 00:29:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 897F9B6F0DE; Wed, 8 Jun 2016 00:29:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55D0C1981; Wed, 8 Jun 2016 00:29:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u580Tmqk039554; Wed, 8 Jun 2016 00:29:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u580TmEW039553; Wed, 8 Jun 2016 00:29:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606080029.u580TmEW039553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Jun 2016 00:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301570 - head/gnu/lib/libsupc++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 00:29:49 -0000 Author: pfg Date: Wed Jun 8 00:29:48 2016 New Revision: 301570 URL: https://svnweb.freebsd.org/changeset/base/301570 Log: libsupc++: Fix typo in symbol map. This went mostly unnoticed with the deprecation of the GNU toolchain in tier 1 platforms. Fix it now for the rest. PR: 169901 MFC after: 3 days Modified: head/gnu/lib/libsupc++/Version.map Modified: head/gnu/lib/libsupc++/Version.map ============================================================================== --- head/gnu/lib/libsupc++/Version.map Tue Jun 7 21:40:42 2016 (r301569) +++ head/gnu/lib/libsupc++/Version.map Wed Jun 8 00:29:48 2016 (r301570) @@ -132,7 +132,7 @@ CXXABI_1.3 { GLIBCXX_3.4 { # operator new and new[] - _Znai[jm]; + _Zna[jm]; _Zna[jm]RKSt9nothrow_t; _Znw[jm]; _Znw[jm]RKSt9nothrow_t; From owner-svn-src-all@freebsd.org Wed Jun 8 01:17:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C0C5B6FB65; Wed, 8 Jun 2016 01:17:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6FB11D6; Wed, 8 Jun 2016 01:17:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u581HMtZ057854; Wed, 8 Jun 2016 01:17:22 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u581HMlX057853; Wed, 8 Jun 2016 01:17:22 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606080117.u581HMlX057853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 8 Jun 2016 01:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301571 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 01:17:23 -0000 Author: truckman Date: Wed Jun 8 01:17:22 2016 New Revision: 301571 URL: https://svnweb.freebsd.org/changeset/base/301571 Log: MFC r301139 The (i < PROMPTLEN - 1) test added by r300442 in the code for the default case of \c in the prompt format string is a no-op. We already passed this test at the top of the loop, and i has not yet been incremented in this path. Change this test to (i < PROMPTLEN - 2). Reported by: Coverity CID: 1008328 Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D6552 Modified: stable/10/bin/sh/parser.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/parser.c ============================================================================== --- stable/10/bin/sh/parser.c Wed Jun 8 00:29:48 2016 (r301570) +++ stable/10/bin/sh/parser.c Wed Jun 8 01:17:22 2016 (r301571) @@ -2039,7 +2039,7 @@ getprompt(void *unused __unused) */ default: ps[i] = '\\'; - if (i < PROMPTLEN - 1) + if (i < PROMPTLEN - 2) ps[++i] = *fmt; break; } From owner-svn-src-all@freebsd.org Wed Jun 8 02:03:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEDE5B6D615; Wed, 8 Jun 2016 02:03:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8910116B9; Wed, 8 Jun 2016 02:03:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5823sIb075803; Wed, 8 Jun 2016 02:03:54 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5823rbD075793; Wed, 8 Jun 2016 02:03:53 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606080203.u5823rbD075793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 8 Jun 2016 02:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 02:03:55 -0000 Author: oshogbo Date: Wed Jun 8 02:03:53 2016 New Revision: 301572 URL: https://svnweb.freebsd.org/changeset/base/301572 Log: Add flags to the Casper services. CASPER_SERVICE_STDIO - Casper will not close the first three descriptors (stdin, stdout and stderr) this can be helpful for debugging. CASPER_SERVICE_FD - Capser will not close all other descriptors, this can be useful for a filesystem service. Modified: head/lib/libcasper/libcasper/libcasper_impl.h head/lib/libcasper/libcasper/libcasper_service.c head/lib/libcasper/libcasper/libcasper_service.h head/lib/libcasper/libcasper/service.c head/lib/libcasper/libcasper/zygote.c head/lib/libcasper/services/cap_dns/cap_dns.c head/lib/libcasper/services/cap_grp/cap_grp.c head/lib/libcasper/services/cap_pwd/cap_pwd.c head/lib/libcasper/services/cap_random/cap_random.c head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Modified: head/lib/libcasper/libcasper/libcasper_impl.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper_impl.h Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/libcasper/libcasper_impl.h Wed Jun 8 02:03:53 2016 (r301572) @@ -46,11 +46,11 @@ bool fd_is_valid(int fd); /* Private service functions. */ struct service *service_alloc(const char *name, service_limit_func_t *limitfunc, - service_command_func_t *commandfunc); + service_command_func_t *commandfunc, uint64_t flags); void service_free(struct service *service); void service_message(struct service *service, struct service_connection *sconn); -void service_start(struct service *service, int sock); +void service_start(struct service *service, int sock, int procfd); const char *service_name(struct service *service); /* Private service connection functions. */ Modified: head/lib/libcasper/libcasper/libcasper_service.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/libcasper/libcasper_service.c Wed Jun 8 02:03:53 2016 (r301572) @@ -73,7 +73,7 @@ service_find(const char *name) struct casper_service * service_register(const char *name, service_limit_func_t *limitfunc, - service_command_func_t *commandfunc) + service_command_func_t *commandfunc, uint64_t flags) { struct casper_service *casserv; @@ -88,7 +88,8 @@ service_register(const char *name, servi if (casserv == NULL) return (NULL); - casserv->cs_service = service_alloc(name, limitfunc, commandfunc); + casserv->cs_service = service_alloc(name, limitfunc, commandfunc, + flags); if (casserv->cs_service == NULL) { free(casserv); return (NULL); @@ -141,11 +142,10 @@ service_execute(int chanfd) exit(1); service = (struct service *)(uintptr_t)nvlist_take_number(nvl, "service"); - //XXX: We should remove this? procfd = nvlist_take_descriptor(nvl, "procfd"); nvlist_destroy(nvl); - service_start(service, chanfd); + service_start(service, chanfd, procfd); /* Not reached. */ exit(1); } @@ -199,7 +199,7 @@ service_register_core(int fd) struct service_connection *sconn; casserv = service_register(CORE_CASPER_NAME, casper_limit, - casper_command); + casper_command, 0); sconn = service_connection_add(casserv->cs_service, fd, NULL); if (sconn == NULL) { close(fd); Modified: head/lib/libcasper/libcasper/libcasper_service.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.h Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/libcasper/libcasper_service.h Wed Jun 8 02:03:53 2016 (r301572) @@ -40,21 +40,25 @@ struct nvlist; typedef struct nvlist nvlist_t; #endif +#define CASPER_SERVICE_STDIO 0x00000001 +#define CASPER_SERVICE_FD 0x00000002 + typedef int service_limit_func_t(const nvlist_t *, const nvlist_t *); typedef int service_command_func_t(const char *cmd, const nvlist_t *, nvlist_t *, nvlist_t *); struct casper_service *service_register(const char *name, - service_limit_func_t *limitfunc, service_command_func_t *commandfunc); + service_limit_func_t *limitfunc, service_command_func_t *commandfunc, + uint64_t flags); #define __constructor __attribute__((constructor)) -#define CREATE_SERVICE(name, limit_func, command_func) \ +#define CREATE_SERVICE(name, limit_func, command_func, flags) \ static __constructor void \ init_casper_service(void) \ { \ \ - (void)service_register(name, limit_func, \ - command_func); \ + (void)service_register(name, limit_func, command_func, \ + flags); \ } #endif /* !_LIBCASPER_SERVICE_H_ */ Modified: head/lib/libcasper/libcasper/service.c ============================================================================== --- head/lib/libcasper/libcasper/service.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/libcasper/service.c Wed Jun 8 02:03:53 2016 (r301572) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -78,6 +79,7 @@ struct service_connection { struct service { int s_magic; char *s_name; + uint64_t s_flags; service_limit_func_t *s_limit; service_command_func_t *s_command; TAILQ_HEAD(, service_connection) s_connections; @@ -85,7 +87,7 @@ struct service { struct service * service_alloc(const char *name, service_limit_func_t *limitfunc, - service_command_func_t *commandfunc) + service_command_func_t *commandfunc, uint64_t flags) { struct service *service; @@ -99,6 +101,7 @@ service_alloc(const char *name, service_ } service->s_limit = limitfunc; service->s_command = commandfunc; + service->s_flags = flags; TAILQ_INIT(&service->s_connections); service->s_magic = SERVICE_MAGIC; @@ -338,8 +341,59 @@ service_name(struct service *service) return (service->s_name); } +static void +stdnull(void) +{ + int fd; + + fd = open(_PATH_DEVNULL, O_RDWR); + if (fd == -1) + errx(1, "Unable to open %s", _PATH_DEVNULL); + + if (setsid() == -1) + errx(1, "Unable to detach from session"); + + if (dup2(fd, STDIN_FILENO) == -1) + errx(1, "Unable to cover stdin"); + if (dup2(fd, STDOUT_FILENO) == -1) + errx(1, "Unable to cover stdout"); + if (dup2(fd, STDERR_FILENO) == -1) + errx(1, "Unable to cover stderr"); + + close(fd); +} + +static void +service_clean(int sock, int procfd, uint64_t flags) +{ + int fd, maxfd, minfd; + + assert(sock > STDERR_FILENO); + assert(procfd > STDERR_FILENO); + assert(sock != procfd); + + if ((flags & CASPER_SERVICE_STDIO) == 0) + stdnull(); + + if ((flags & CASPER_SERVICE_FD) == 0) { + if (procfd > sock) { + maxfd = procfd; + minfd = sock; + } else { + maxfd = sock; + minfd = procfd; + } + + for (fd = STDERR_FILENO + 1; fd < maxfd; fd++) { + if (fd != minfd) + close(fd); + } + closefrom(maxfd + 1); + } +} + void -service_start(struct service *service, int sock) +service_start(struct service *service, int sock, int procfd) { struct service_connection *sconn, *sconntmp; fd_set fds; @@ -348,6 +402,8 @@ service_start(struct service *service, i assert(service != NULL); assert(service->s_magic == SERVICE_MAGIC); setproctitle("%s", service->s_name); + service_clean(sock, procfd, service->s_flags); + if (service_connection_add(service, sock, NULL) == NULL) exit(1); Modified: head/lib/libcasper/libcasper/zygote.c ============================================================================== --- head/lib/libcasper/libcasper/zygote.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/libcasper/zygote.c Wed Jun 8 02:03:53 2016 (r301572) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -51,28 +50,6 @@ __FBSDID("$FreeBSD$"); /* Zygote info. */ static int zygote_sock = -1; -static void -stdnull(void) -{ - int fd; - - fd = open(_PATH_DEVNULL, O_RDWR); - if (fd == -1) - errx(1, "Unable to open %s", _PATH_DEVNULL); - - if (setsid() == -1) - errx(1, "Unable to detach from session"); - - if (dup2(fd, STDIN_FILENO) == -1) - errx(1, "Unable to cover stdin"); - if (dup2(fd, STDOUT_FILENO) == -1) - errx(1, "Unable to cover stdout"); - if (dup2(fd, STDERR_FILENO) == -1) - errx(1, "Unable to cover stderr"); - - close(fd); -} - int zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp) { @@ -113,7 +90,7 @@ zygote_clone(zygote_func_t *func, int *c static void zygote_main(int sock) { - int error, fd, procfd; + int error, procfd; int chanfd[2]; nvlist_t *nvlin, *nvlout; zygote_func_t *func; @@ -123,11 +100,6 @@ zygote_main(int sock) setproctitle("zygote"); - stdnull(); - for (fd = STDERR_FILENO + 1; fd < sock; fd++) - close(fd); - closefrom(sock + 1); - for (;;) { nvlin = nvlist_recv(sock, 0); if (nvlin == NULL) { Modified: head/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/services/cap_dns/cap_dns.c Wed Jun 8 02:03:53 2016 (r301572) @@ -759,4 +759,4 @@ dns_command(const char *cmd, const nvlis return (error); } -CREATE_SERVICE("system.dns", dns_limit, dns_command); +CREATE_SERVICE("system.dns", dns_limit, dns_command, 0); Modified: head/lib/libcasper/services/cap_grp/cap_grp.c ============================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/services/cap_grp/cap_grp.c Wed Jun 8 02:03:53 2016 (r301572) @@ -786,4 +786,4 @@ grp_command(const char *cmd, const nvlis return (error); } -CREATE_SERVICE("system.grp", grp_limit, grp_command); +CREATE_SERVICE("system.grp", grp_limit, grp_command, 0); Modified: head/lib/libcasper/services/cap_pwd/cap_pwd.c ============================================================================== --- head/lib/libcasper/services/cap_pwd/cap_pwd.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/services/cap_pwd/cap_pwd.c Wed Jun 8 02:03:53 2016 (r301572) @@ -780,4 +780,4 @@ pwd_command(const char *cmd, const nvlis return (error); } -CREATE_SERVICE("system.pwd", pwd_limit, pwd_command); +CREATE_SERVICE("system.pwd", pwd_limit, pwd_command, 0); Modified: head/lib/libcasper/services/cap_random/cap_random.c ============================================================================== --- head/lib/libcasper/services/cap_random/cap_random.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/services/cap_random/cap_random.c Wed Jun 8 02:03:53 2016 (r301572) @@ -114,4 +114,4 @@ random_command(const char *cmd, const nv return (0); } -CREATE_SERVICE("system.random", NULL, random_command); +CREATE_SERVICE("system.random", NULL, random_command, 0); Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.c ============================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Wed Jun 8 01:17:22 2016 (r301571) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Wed Jun 8 02:03:53 2016 (r301572) @@ -290,4 +290,4 @@ sysctl_command(const char *cmd, const nv return (0); } -CREATE_SERVICE("system.sysctl", sysctl_limit, sysctl_command); +CREATE_SERVICE("system.sysctl", sysctl_limit, sysctl_command, 0); From owner-svn-src-all@freebsd.org Wed Jun 8 02:09:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24BE0B6D6A2; Wed, 8 Jun 2016 02:09:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E375C18E7; Wed, 8 Jun 2016 02:09:15 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5829FV9076021; Wed, 8 Jun 2016 02:09:15 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5829Ecd076017; Wed, 8 Jun 2016 02:09:14 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606080209.u5829Ecd076017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 8 Jun 2016 02:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301573 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 02:09:16 -0000 Author: oshogbo Date: Wed Jun 8 02:09:14 2016 New Revision: 301573 URL: https://svnweb.freebsd.org/changeset/base/301573 Log: Introduce the PD_CLOEXEC for pdfork(2). Reviewed by: mjg Modified: head/lib/libc/sys/pdfork.2 head/sys/kern/kern_fork.c head/sys/kern/sys_procdesc.c head/sys/sys/procdesc.h Modified: head/lib/libc/sys/pdfork.2 ============================================================================== --- head/lib/libc/sys/pdfork.2 Wed Jun 8 02:03:53 2016 (r301572) +++ head/lib/libc/sys/pdfork.2 Wed Jun 8 02:09:14 2016 (r301573) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2014 +.Dd June 8, 2016 .Dt PDFORK 2 .Os .Sh NAME @@ -80,6 +80,10 @@ This option is not permitted in capability mode (see .Xr cap_enter 2 ) . .El +.Bl -tag -width ".Dv PD_DAEMON" +.It Dv PD_CLOEXEC +Set close-on-exec on process descriptor. +.El .Pp .Fn pdgetpid queries the process ID (PID) in the process descriptor Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Jun 8 02:03:53 2016 (r301572) +++ head/sys/kern/kern_fork.c Wed Jun 8 02:09:14 2016 (r301573) @@ -827,6 +827,10 @@ fork1(struct thread *td, struct fork_req /* Must provide a place to put a procdesc if creating one. */ if (fr->fr_pd_fd == NULL) return (EINVAL); + + /* Check if we are using supported flags. */ + if ((fr->fr_pd_flags & ~PD_ALLOWED_AT_FORK) != 0) + return (EINVAL); } p1 = td->td_proc; @@ -878,8 +882,8 @@ fork1(struct thread *td, struct fork_req * later. */ if (flags & RFPROCDESC) { - error = falloc_caps(td, &fp_procdesc, fr->fr_pd_fd, 0, - fr->fr_pd_fcaps); + error = procdesc_falloc(td, &fp_procdesc, fr->fr_pd_fd, + fr->fr_pd_flags, fr->fr_pd_fcaps); if (error != 0) goto fail2; } Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Wed Jun 8 02:03:53 2016 (r301572) +++ head/sys/kern/sys_procdesc.c Wed Jun 8 02:09:14 2016 (r301573) @@ -243,6 +243,22 @@ procdesc_new(struct proc *p, int flags) } /* + * Create a new process decriptor for the process that refers to it. + */ +int +procdesc_falloc(struct thread *td, struct file **resultfp, int *resultfd, + int flags, struct filecaps *fcaps) +{ + int fflags; + + fflags = 0; + if (flags & PD_CLOEXEC) + fflags = O_CLOEXEC; + + return (falloc_caps(td, resultfp, resultfd, fflags, fcaps)); +} + +/* * Initialize a file with a process descriptor. */ void Modified: head/sys/sys/procdesc.h ============================================================================== --- head/sys/sys/procdesc.h Wed Jun 8 02:03:53 2016 (r301572) +++ head/sys/sys/procdesc.h Wed Jun 8 02:09:14 2016 (r301573) @@ -101,6 +101,9 @@ void procdesc_finit(struct procdesc *, pid_t procdesc_pid(struct file *); void procdesc_reap(struct proc *); +int procdesc_falloc(struct thread *, struct file **, int *, int, + struct filecaps *); + #else /* !_KERNEL */ #include @@ -127,5 +130,8 @@ __END_DECLS * Flags which can be passed to pdfork(2). */ #define PD_DAEMON 0x00000001 /* Don't exit when procdesc closes. */ +#define PD_CLOEXEC 0x00000002 /* Close file descriptor on exec. */ + +#define PD_ALLOWED_AT_FORK (PD_DAEMON | PD_CLOEXEC) #endif /* !_SYS_PROCDESC_H_ */ From owner-svn-src-all@freebsd.org Wed Jun 8 02:14:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC472B6D864; Wed, 8 Jun 2016 02:14:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8EB11CFC; Wed, 8 Jun 2016 02:14:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u582E5PY079621; Wed, 8 Jun 2016 02:14:05 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u582E5af079620; Wed, 8 Jun 2016 02:14:05 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606080214.u582E5af079620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 8 Jun 2016 02:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301574 - head/usr.bin/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 02:14:07 -0000 Author: truckman Date: Wed Jun 8 02:14:05 2016 New Revision: 301574 URL: https://svnweb.freebsd.org/changeset/base/301574 Log: Fix a (false positive?) Argument cannot be negative coverity defect. Rather than guarding close(fd) with an fd >= 0 test and setting fd to -1 when it is closed to avoid a potential double-close, just move the close() call after the conditional "goto make_token". This moves the close() call totally outside the loop to avoid the possibility of calling it twice. This should also prevent a Coverity warning about checking fd for validity after it was previously passed to read(). Reported by: Coverity CID: 1355335 MFC after: 1 week X-MFC with: r299484 Modified: head/usr.bin/random/randomize_fd.c Modified: head/usr.bin/random/randomize_fd.c ============================================================================== --- head/usr.bin/random/randomize_fd.c Wed Jun 8 02:09:14 2016 (r301573) +++ head/usr.bin/random/randomize_fd.c Wed Jun 8 02:14:05 2016 (r301574) @@ -199,17 +199,14 @@ make_token: } } - if (fd >= 0) { - (void)close(fd); - fd = -1; - } - /* Necessary evil to compensate for files that don't end with a newline */ if (bufc != i) { i--; goto make_token; } + (void)close(fd); + free(buf); for (i = numnode; i > 0; i--) { From owner-svn-src-all@freebsd.org Wed Jun 8 02:37:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1738CB6DC5A; Wed, 8 Jun 2016 02:37:25 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFA131678; Wed, 8 Jun 2016 02:37:24 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u582bNnT087017; Wed, 8 Jun 2016 02:37:23 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u582bNgS087015; Wed, 8 Jun 2016 02:37:23 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201606080237.u582bNgS087015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 8 Jun 2016 02:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301575 - head/sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 02:37:25 -0000 Author: kevlo Date: Wed Jun 8 02:37:23 2016 New Revision: 301575 URL: https://svnweb.freebsd.org/changeset/base/301575 Log: - Replace the magic numbers with something more readable. - Reset DMA indexes after disabling DMA. Modified: head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860reg.h Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Wed Jun 8 02:14:05 2016 (r301574) +++ head/sys/dev/ral/rt2860.c Wed Jun 8 02:37:23 2016 (r301575) @@ -900,7 +900,7 @@ rt2860_ampdu_rx_stop(struct ieee80211com } #endif -int +static int rt2860_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct rt2860_vap *rvp = RT2860_VAP(vap); @@ -3824,9 +3824,16 @@ rt2860_init_locked(struct rt2860_softc * /* disable DMA */ tmp = RAL_READ(sc, RT2860_WPDMA_GLO_CFG); - tmp &= 0xff0; + tmp &= ~(RT2860_RX_DMA_BUSY | RT2860_RX_DMA_EN | RT2860_TX_DMA_BUSY | + RT2860_TX_DMA_EN); + tmp |= RT2860_TX_WB_DDONE; RAL_WRITE(sc, RT2860_WPDMA_GLO_CFG, tmp); + /* reset DMA indexes */ + RAL_WRITE(sc, RT2860_WPDMA_RST_IDX, RT2860_RST_DRX_IDX0 | + RT2860_RST_DTX_IDX5 | RT2860_RST_DTX_IDX4 | RT2860_RST_DTX_IDX3 | + RT2860_RST_DTX_IDX2 | RT2860_RST_DTX_IDX1 | RT2860_RST_DTX_IDX0); + /* PBF hardware reset */ RAL_WRITE(sc, RT2860_SYS_CTRL, 0xe1f); RAL_BARRIER_WRITE(sc); @@ -3858,7 +3865,9 @@ rt2860_init_locked(struct rt2860_softc * rt2860_stop_locked(sc); return; } - tmp &= 0xff0; + tmp &= ~(RT2860_RX_DMA_BUSY | RT2860_RX_DMA_EN | RT2860_TX_DMA_BUSY | + RT2860_TX_DMA_EN); + tmp |= RT2860_TX_WB_DDONE; RAL_WRITE(sc, RT2860_WPDMA_GLO_CFG, tmp); /* reset Rx ring and all 6 Tx rings */ @@ -3958,7 +3967,9 @@ rt2860_init_locked(struct rt2860_softc * rt2860_stop_locked(sc); return; } - tmp &= 0xff0; + tmp &= ~(RT2860_RX_DMA_BUSY | RT2860_RX_DMA_EN | RT2860_TX_DMA_BUSY | + RT2860_TX_DMA_EN); + tmp |= RT2860_TX_WB_DDONE; RAL_WRITE(sc, RT2860_WPDMA_GLO_CFG, tmp); /* disable interrupts mitigation */ Modified: head/sys/dev/ral/rt2860reg.h ============================================================================== --- head/sys/dev/ral/rt2860reg.h Wed Jun 8 02:14:05 2016 (r301574) +++ head/sys/dev/ral/rt2860reg.h Wed Jun 8 02:37:23 2016 (r301575) @@ -257,6 +257,15 @@ #define RT2860_TX_DMA_BUSY (1 << 1) #define RT2860_TX_DMA_EN (1 << 0) +/* flags for register WPDMA_RST_IDX */ +#define RT2860_RST_DRX_IDX0 (1 << 16) +#define RT2860_RST_DTX_IDX5 (1 << 5) +#define RT2860_RST_DTX_IDX4 (1 << 4) +#define RT2860_RST_DTX_IDX3 (1 << 3) +#define RT2860_RST_DTX_IDX2 (1 << 2) +#define RT2860_RST_DTX_IDX1 (1 << 1) +#define RT2860_RST_DTX_IDX0 (1 << 0) + /* possible flags for register DELAY_INT_CFG */ #define RT2860_TXDLY_INT_EN (1U << 31) #define RT2860_TXMAX_PINT_SHIFT 24 @@ -1233,7 +1242,7 @@ static const struct rt2860_rate { { 20, 0xba }, \ { 21, 0xdb }, \ { 24, 0x16 }, \ - { 25, 0x01 }, \ + { 25, 0x03 }, \ { 29, 0x1f } #define RT5390_DEF_RF \ From owner-svn-src-all@freebsd.org Wed Jun 8 02:39:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50FB9B6DCD9; Wed, 8 Jun 2016 02:39:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23AC7183E; Wed, 8 Jun 2016 02:39:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u582dALo087122; Wed, 8 Jun 2016 02:39:10 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u582dABV087121; Wed, 8 Jun 2016 02:39:10 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201606080239.u582dABV087121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 8 Jun 2016 02:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301576 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 02:39:11 -0000 Author: kevlo Date: Wed Jun 8 02:39:10 2016 New Revision: 301576 URL: https://svnweb.freebsd.org/changeset/base/301576 Log: Fix a style bug. Modified: head/sys/fs/ext2fs/ext2_bmap.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Wed Jun 8 02:37:23 2016 (r301575) +++ head/sys/fs/ext2fs/ext2_bmap.c Wed Jun 8 02:39:10 2016 (r301576) @@ -118,7 +118,7 @@ ext4_bmapext(struct vnode *vp, int32_t b if (runb != NULL) *runb = lbn - path.ep_sparse_ext.e_blk; } else { - if ( path.ep_ext == NULL) { + if (path.ep_ext == NULL) { error = EIO; goto out; } From owner-svn-src-all@freebsd.org Wed Jun 8 03:08:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE961B6E3E0; Wed, 8 Jun 2016 03:08:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE4481C2B; Wed, 8 Jun 2016 03:08:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5838bP4098577; Wed, 8 Jun 2016 03:08:37 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5838bcQ098576; Wed, 8 Jun 2016 03:08:37 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606080308.u5838bcQ098576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 8 Jun 2016 03:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301577 - stable/10/etc/periodic/daily X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 03:08:39 -0000 Author: cy Date: Wed Jun 8 03:08:37 2016 New Revision: 301577 URL: https://svnweb.freebsd.org/changeset/base/301577 Log: MFC r301102: Don't rely on $ntpd_enable to periodically fetch the latest leapfile. Suggested by: cperciva Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 02:39:10 2016 (r301576) +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:08:37 2016 (r301577) @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd fetch) & + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & ;; *) - service ntpd fetch + service ntpd onefetch ;; esac ;; From owner-svn-src-all@freebsd.org Wed Jun 8 03:09:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0690BB6E459; Wed, 8 Jun 2016 03:09:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCF381D9E; Wed, 8 Jun 2016 03:09:31 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5839V96098661; Wed, 8 Jun 2016 03:09:31 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5839VjX098660; Wed, 8 Jun 2016 03:09:31 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606080309.u5839VjX098660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 8 Jun 2016 03:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301578 - stable/9/etc/periodic/daily X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 03:09:32 -0000 Author: cy Date: Wed Jun 8 03:09:30 2016 New Revision: 301578 URL: https://svnweb.freebsd.org/changeset/base/301578 Log: MFC r301102: Don't rely on $ntpd_enable to periodically fetch the latest leapfile. Suggested by: cperciva Modified: stable/9/etc/periodic/daily/480.leapfile-ntpd Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- stable/9/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:08:37 2016 (r301577) +++ stable/9/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:09:30 2016 (r301578) @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd fetch) & + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & ;; *) - service ntpd fetch + service ntpd onefetch ;; esac ;; From owner-svn-src-all@freebsd.org Wed Jun 8 04:18:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E735B6F1F9; Wed, 8 Jun 2016 04:18:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D50119DC; Wed, 8 Jun 2016 04:18:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u584IvxW024496; Wed, 8 Jun 2016 04:18:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u584IvjY024494; Wed, 8 Jun 2016 04:18:57 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201606080418.u584IvjY024494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 8 Jun 2016 04:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301579 - in head: sbin/ifconfig share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 04:18:58 -0000 Author: araujo Date: Wed Jun 8 04:18:57 2016 New Revision: 301579 URL: https://svnweb.freebsd.org/changeset/base/301579 Log: Bump date on ifconfig(8) and vlan(4) to reflect the changes made on revision r301496. Modified: head/sbin/ifconfig/ifconfig.8 head/share/man/man4/vlan.4 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Jun 8 03:09:30 2016 (r301578) +++ head/sbin/ifconfig/ifconfig.8 Wed Jun 8 04:18:57 2016 (r301579) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 29, 2016 +.Dd June 8, 2016 .Dt IFCONFIG 8 .Os .Sh NAME Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Wed Jun 8 03:09:30 2016 (r301578) +++ head/share/man/man4/vlan.4 Wed Jun 8 04:18:57 2016 (r301579) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd June 8, 2016 .Dt VLAN 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Jun 8 04:37:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B17F1B6F4F0; Wed, 8 Jun 2016 04:37:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7620B11A7; Wed, 8 Jun 2016 04:37:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u584b3LH031547; Wed, 8 Jun 2016 04:37:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u584b3Pj031546; Wed, 8 Jun 2016 04:37:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606080437.u584b3Pj031546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Jun 2016 04:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301580 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 04:37:04 -0000 Author: kib Date: Wed Jun 8 04:37:03 2016 New Revision: 301580 URL: https://svnweb.freebsd.org/changeset/base/301580 Log: Old process credentials for setuid execve must not be dereferenced when the process credentials were not changed. This can happen if an error occured trying to activate the setuid binary. And on error, if new credentials were not yet assigned, they must be freed to not create the leak. Use oldcred == NULL as the predicate to detect credential reassignment. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Jun 8 04:18:57 2016 (r301579) +++ head/sys/kern/kern_exec.c Wed Jun 8 04:37:03 2016 (r301580) @@ -806,8 +806,11 @@ interpret: /* * Set the new credentials. */ - if (imgp->newcred != NULL) + if (imgp->newcred != NULL) { proc_set_cred(p, imgp->newcred); + crfree(oldcred); + oldcred = NULL; + } /* * Store the vp for use in procfs. This vnode was referenced by namei @@ -918,8 +921,9 @@ exec_fail: SDT_PROBE1(proc, , , exec__failure, error); } - if (imgp->newcred != NULL) - crfree(oldcred); + if (imgp->newcred != NULL && oldcred != NULL) + crfree(imgp->newcred); + #ifdef MAC mac_execve_exit(imgp); mac_execve_interpreter_exit(interpvplabel); From owner-svn-src-all@freebsd.org Wed Jun 8 04:49:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49C19B6F6BE; Wed, 8 Jun 2016 04:49:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE4E618D5; Wed, 8 Jun 2016 04:49:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u584nL1e035413; Wed, 8 Jun 2016 04:49:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u584nLS7035412; Wed, 8 Jun 2016 04:49:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606080449.u584nLS7035412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Jun 2016 04:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301581 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 04:49:22 -0000 Author: kib Date: Wed Jun 8 04:49:20 2016 New Revision: 301581 URL: https://svnweb.freebsd.org/changeset/base/301581 Log: MFC r300691: Fix issues found by Coverity in the rtld-elf.c:gethints(). Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Wed Jun 8 04:37:03 2016 (r301580) +++ stable/10/libexec/rtld-elf/rtld.c Wed Jun 8 04:49:20 2016 (r301581) @@ -1623,14 +1623,16 @@ static const char * gethints(bool nostdlib) { static char *hints, *filtered_path; - struct elfhints_hdr hdr; + static struct elfhints_hdr hdr; struct fill_search_info_args sargs, hargs; struct dl_serinfo smeta, hmeta, *SLPinfo, *hintinfo; struct dl_serpath *SLPpath, *hintpath; char *p; + struct stat hint_stat; unsigned int SLPndx, hintndx, fndx, fcount; int fd; size_t flen; + uint32_t dl; bool skip; /* First call, read the hints file */ @@ -1640,19 +1642,38 @@ gethints(bool nostdlib) if ((fd = open(ld_elf_hints_path, O_RDONLY | O_CLOEXEC)) == -1) return (NULL); + + /* + * Check of hdr.dirlistlen value against type limit + * intends to pacify static analyzers. Further + * paranoia leads to checks that dirlist is fully + * contained in the file range. + */ if (read(fd, &hdr, sizeof hdr) != sizeof hdr || hdr.magic != ELFHINTS_MAGIC || - hdr.version != 1) { + hdr.version != 1 || hdr.dirlistlen > UINT_MAX / 2 || + fstat(fd, &hint_stat) == -1) { +cleanup1: close(fd); + hdr.dirlistlen = 0; return (NULL); } + dl = hdr.strtab; + if (dl + hdr.dirlist < dl) + goto cleanup1; + dl += hdr.dirlist; + if (dl + hdr.dirlistlen < dl) + goto cleanup1; + dl += hdr.dirlistlen; + if (dl > hint_stat.st_size) + goto cleanup1; p = xmalloc(hdr.dirlistlen + 1); + if (lseek(fd, hdr.strtab + hdr.dirlist, SEEK_SET) == -1 || read(fd, p, hdr.dirlistlen + 1) != - (ssize_t)hdr.dirlistlen + 1) { + (ssize_t)hdr.dirlistlen + 1 || p[hdr.dirlistlen] != '\0') { free(p); - close(fd); - return (NULL); + goto cleanup1; } hints = p; close(fd); @@ -1685,7 +1706,7 @@ gethints(bool nostdlib) hargs.serinfo = &hmeta; path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); - path_enumerate(p, fill_search_info, &hargs); + path_enumerate(hints, fill_search_info, &hargs); SLPinfo = xmalloc(smeta.dls_size); hintinfo = xmalloc(hmeta.dls_size); @@ -1704,7 +1725,7 @@ gethints(bool nostdlib) hargs.strspace = (char *)&hintinfo->dls_serpath[hmeta.dls_cnt]; path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); - path_enumerate(p, fill_search_info, &hargs); + path_enumerate(hints, fill_search_info, &hargs); /* * Now calculate the difference between two sets, by excluding From owner-svn-src-all@freebsd.org Wed Jun 8 05:32:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E84D0B6FE91; Wed, 8 Jun 2016 05:32:40 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B60821D39; Wed, 8 Jun 2016 05:32:40 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u585Wd3K063024; Wed, 8 Jun 2016 05:32:39 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u585Wd6D063023; Wed, 8 Jun 2016 05:32:39 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606080532.u585Wd6D063023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 8 Jun 2016 05:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301582 - head/bin/setfacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 05:32:41 -0000 Author: truckman Date: Wed Jun 8 05:32:39 2016 New Revision: 301582 URL: https://svnweb.freebsd.org/changeset/base/301582 Log: Explicitly NUL terminate the buffer filled by fread(). The fix in r300649 was not sufficient to convince Coverity that the buffer was NUL terminated, even with the buffer pre-zeroed. Swap the size and nmemb arguments to fread() so that a valid lenght is returned, which we can use to terminate the string in the buffer at the correct location. This should also quiet the complaint about the return value of fread() not being checked. Reported by: Coverity CID: 1019054, 1009614 MFC after: 1 week Modified: head/bin/setfacl/file.c Modified: head/bin/setfacl/file.c ============================================================================== --- head/bin/setfacl/file.c Wed Jun 8 04:49:20 2016 (r301581) +++ head/bin/setfacl/file.c Wed Jun 8 05:32:39 2016 (r301582) @@ -43,13 +43,12 @@ acl_t get_acl_from_file(const char *filename) { FILE *file; + size_t len; char buf[BUFSIZ+1]; if (filename == NULL) err(1, "(null) filename in get_acl_from_file()"); - bzero(&buf, sizeof(buf)); - if (strcmp(filename, "-") == 0) { if (have_stdin != 0) err(1, "cannot specify more than one stdin"); @@ -61,7 +60,8 @@ get_acl_from_file(const char *filename) err(1, "fopen() %s failed", filename); } - fread(buf, sizeof(buf) - 1, (size_t)1, file); + len = fread(buf, (size_t)1, sizeof(buf) - 1, file); + buf[len] = '\0'; if (ferror(file) != 0) { fclose(file); err(1, "error reading from %s", filename); From owner-svn-src-all@freebsd.org Wed Jun 8 05:34:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1EEBB6FF02; Wed, 8 Jun 2016 05:34:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CEA71EB0; Wed, 8 Jun 2016 05:34:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u585YMI2063147; Wed, 8 Jun 2016 05:34:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u585YM1x063142; Wed, 8 Jun 2016 05:34:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606080534.u585YM1x063142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 8 Jun 2016 05:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301583 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 05:34:23 -0000 Author: sephe Date: Wed Jun 8 05:34:22 2016 New Revision: 301583 URL: https://svnweb.freebsd.org/changeset/base/301583 Log: hyperv/vmbus: Busdma-fy MNF and event flags. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6744 Modified: head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 8 05:32:39 2016 (r301582) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 8 05:34:22 2016 (r301583) @@ -62,17 +62,16 @@ static void VmbusProcessChannelEvent(voi static void vmbus_channel_set_event(hv_vmbus_channel *channel) { - hv_vmbus_monitor_page *monitor_page; - if (channel->offer_msg.monitor_allocated) { + struct vmbus_softc *sc = vmbus_get_softc(); + hv_vmbus_monitor_page *monitor_page; + /* Each uint32_t represents 32 channels */ synch_set_bit((channel->offer_msg.child_rel_id & 31), - ((uint32_t *)hv_vmbus_g_connection.send_interrupt_page + ((uint32_t *)sc->vmbus_tx_evtflags + ((channel->offer_msg.child_rel_id >> 5)))); - monitor_page = (hv_vmbus_monitor_page *) - hv_vmbus_g_connection.monitor_page_2; - + monitor_page = sc->vmbus_mnf2; synch_set_bit(channel->monitor_bit, (uint32_t *)&monitor_page-> trigger_group[channel->monitor_group].u.pending); Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 8 05:32:39 2016 (r301582) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 8 05:34:22 2016 (r301583) @@ -74,8 +74,8 @@ hv_vmbus_get_next_version(uint32_t curre * Negotiate the highest supported hypervisor version. */ static int -hv_vmbus_negotiate_version(hv_vmbus_channel_msg_info *msg_info, - uint32_t version) +hv_vmbus_negotiate_version(struct vmbus_softc *sc, + hv_vmbus_channel_msg_info *msg_info, uint32_t version) { int ret = 0; hv_vmbus_channel_initiate_contact *msg; @@ -86,14 +86,9 @@ hv_vmbus_negotiate_version(hv_vmbus_chan msg->header.message_type = HV_CHANNEL_MESSAGE_INITIATED_CONTACT; msg->vmbus_version_requested = version; - msg->interrupt_page = hv_get_phys_addr( - hv_vmbus_g_connection.interrupt_page); - - msg->monitor_page_1 = hv_get_phys_addr( - hv_vmbus_g_connection.monitor_page_1); - - msg->monitor_page_2 = hv_get_phys_addr( - hv_vmbus_g_connection.monitor_page_2); + msg->interrupt_page = sc->vmbus_evtflags_dma.hv_paddr; + msg->monitor_page_1 = sc->vmbus_mnf1_dma.hv_paddr; + msg->monitor_page_2 = sc->vmbus_mnf2_dma.hv_paddr; /** * Add to list before we send the request since we may receive the @@ -150,7 +145,7 @@ hv_vmbus_negotiate_version(hv_vmbus_chan * Send a connect request on the partition service connection */ int -hv_vmbus_connect(void) +hv_vmbus_connect(struct vmbus_softc *sc) { int ret = 0; uint32_t version; @@ -176,34 +171,6 @@ hv_vmbus_connect(void) mtx_init(&hv_vmbus_g_connection.channel_lock, "vmbus channel", NULL, MTX_DEF); - /** - * Setup the vmbus event connection for channel interrupt abstraction - * stuff - */ - hv_vmbus_g_connection.interrupt_page = malloc( - PAGE_SIZE, M_DEVBUF, - M_WAITOK | M_ZERO); - - hv_vmbus_g_connection.recv_interrupt_page = - hv_vmbus_g_connection.interrupt_page; - - hv_vmbus_g_connection.send_interrupt_page = - ((uint8_t *) hv_vmbus_g_connection.interrupt_page + - (PAGE_SIZE >> 1)); - - /** - * Set up the monitor notification facility. The 1st page for - * parent->child and the 2nd page for child->parent - */ - hv_vmbus_g_connection.monitor_page_1 = malloc( - PAGE_SIZE, - M_DEVBUF, - M_WAITOK | M_ZERO); - hv_vmbus_g_connection.monitor_page_2 = malloc( - PAGE_SIZE, - M_DEVBUF, - M_WAITOK | M_ZERO); - msg_info = (hv_vmbus_channel_msg_info*) malloc(sizeof(hv_vmbus_channel_msg_info) + sizeof(hv_vmbus_channel_initiate_contact), @@ -217,7 +184,7 @@ hv_vmbus_connect(void) version = HV_VMBUS_VERSION_CURRENT; do { - ret = hv_vmbus_negotiate_version(msg_info, version); + ret = hv_vmbus_negotiate_version(sc, msg_info, version); if (ret == EWOULDBLOCK) { /* * We timed out. @@ -251,14 +218,6 @@ hv_vmbus_connect(void) mtx_destroy(&hv_vmbus_g_connection.channel_lock); mtx_destroy(&hv_vmbus_g_connection.channel_msg_lock); - if (hv_vmbus_g_connection.interrupt_page != NULL) { - free(hv_vmbus_g_connection.interrupt_page, M_DEVBUF); - hv_vmbus_g_connection.interrupt_page = NULL; - } - - free(hv_vmbus_g_connection.monitor_page_1, M_DEVBUF); - free(hv_vmbus_g_connection.monitor_page_2, M_DEVBUF); - if (msg_info) { sema_destroy(&msg_info->wait_sema); free(msg_info, M_DEVBUF); @@ -281,8 +240,6 @@ hv_vmbus_disconnect(void) ret = hv_vmbus_post_message(&msg, sizeof(hv_vmbus_channel_unload)); - free(hv_vmbus_g_connection.interrupt_page, M_DEVBUF); - mtx_destroy(&hv_vmbus_g_connection.channel_msg_lock); free(hv_vmbus_g_connection.channels, M_DEVBUF); @@ -343,14 +300,13 @@ vmbus_event_proc(struct vmbus_softc *sc, } void -vmbus_event_proc_compat(struct vmbus_softc *sc __unused, int cpu) +vmbus_event_proc_compat(struct vmbus_softc *sc, int cpu) { struct vmbus_evtflags *eventf; eventf = VMBUS_PCPU_GET(sc, event_flags, cpu) + VMBUS_SINT_MESSAGE; if (atomic_testandclear_long(&eventf->evt_flags[0], 0)) { - vmbus_event_flags_proc( - hv_vmbus_g_connection.recv_interrupt_page, + vmbus_event_flags_proc(sc->vmbus_rx_evtflags, VMBUS_CHAN_MAX_COMPAT >> VMBUS_EVTFLAG_SHIFT); } } @@ -395,14 +351,14 @@ int hv_vmbus_post_message(void *buffer, int hv_vmbus_set_event(hv_vmbus_channel *channel) { + struct vmbus_softc *sc = vmbus_get_softc(); int ret = 0; uint32_t child_rel_id = channel->offer_msg.child_rel_id; /* Each uint32_t represents 32 channels */ synch_set_bit(child_rel_id & 31, - (((uint32_t *)hv_vmbus_g_connection.send_interrupt_page - + (child_rel_id >> 5)))); + (((uint32_t *)sc->vmbus_tx_evtflags + (child_rel_id >> 5)))); ret = hv_vmbus_signal_event(channel->signal_event_param); return (ret); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 8 05:32:39 2016 (r301582) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 8 05:34:22 2016 (r301583) @@ -244,25 +244,7 @@ typedef enum { typedef struct { hv_vmbus_connect_state connect_state; uint32_t next_gpadl_handle; - /** - * Represents channel interrupts. Each bit position - * represents a channel. - * When a channel sends an interrupt via VMBUS, it - * finds its bit in the send_interrupt_page, set it and - * calls Hv to generate a port event. The other end - * receives the port event and parse the - * recv_interrupt_page to see which bit is set - */ - void *interrupt_page; - void *send_interrupt_page; - void *recv_interrupt_page; - /* - * 2 pages - 1st page for parent->child - * notification and 2nd is child->parent - * notification - */ - void *monitor_page_1; - void *monitor_page_2; + TAILQ_HEAD(, hv_vmbus_channel_msg_info) channel_msg_anchor; struct mtx channel_msg_lock; /** @@ -440,7 +422,8 @@ int hv_vmbus_child_device_unregister( /** * Connection interfaces */ -int hv_vmbus_connect(void); +struct vmbus_softc; +int hv_vmbus_connect(struct vmbus_softc *); int hv_vmbus_disconnect(void); int hv_vmbus_post_message(void *buffer, size_t buf_size); int hv_vmbus_set_event(hv_vmbus_channel *channel); Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Wed Jun 8 05:32:39 2016 (r301582) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Jun 8 05:34:22 2016 (r301583) @@ -309,30 +309,50 @@ vmbus_synic_teardown(void *arg) static int vmbus_dma_alloc(struct vmbus_softc *sc) { + bus_dma_tag_t parent_dtag; + uint8_t *evtflags; int cpu; + parent_dtag = bus_get_dma_tag(sc->vmbus_dev); CPU_FOREACH(cpu) { void *ptr; /* * Per-cpu messages and event flags. */ - ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), - PAGE_SIZE, 0, PAGE_SIZE, - VMBUS_PCPU_PTR(sc, message_dma, cpu), + ptr = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, + PAGE_SIZE, VMBUS_PCPU_PTR(sc, message_dma, cpu), BUS_DMA_WAITOK | BUS_DMA_ZERO); if (ptr == NULL) return ENOMEM; VMBUS_PCPU_GET(sc, message, cpu) = ptr; - ptr = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), - PAGE_SIZE, 0, PAGE_SIZE, - VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), + ptr = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, + PAGE_SIZE, VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), BUS_DMA_WAITOK | BUS_DMA_ZERO); if (ptr == NULL) return ENOMEM; VMBUS_PCPU_GET(sc, event_flags, cpu) = ptr; } + + evtflags = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, + PAGE_SIZE, &sc->vmbus_evtflags_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (evtflags == NULL) + return ENOMEM; + sc->vmbus_rx_evtflags = (u_long *)evtflags; + sc->vmbus_tx_evtflags = evtflags + (PAGE_SIZE / 2); + sc->vmbus_evtflags = evtflags; + + sc->vmbus_mnf1 = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, + PAGE_SIZE, &sc->vmbus_mnf1_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (sc->vmbus_mnf1 == NULL) + return ENOMEM; + + sc->vmbus_mnf2 = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, + PAGE_SIZE, &sc->vmbus_mnf2_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (sc->vmbus_mnf2 == NULL) + return ENOMEM; + return 0; } @@ -341,6 +361,21 @@ vmbus_dma_free(struct vmbus_softc *sc) { int cpu; + if (sc->vmbus_evtflags != NULL) { + hyperv_dmamem_free(&sc->vmbus_evtflags_dma, sc->vmbus_evtflags); + sc->vmbus_evtflags = NULL; + sc->vmbus_rx_evtflags = NULL; + sc->vmbus_tx_evtflags = NULL; + } + if (sc->vmbus_mnf1 != NULL) { + hyperv_dmamem_free(&sc->vmbus_mnf1_dma, sc->vmbus_mnf1); + sc->vmbus_mnf1 = NULL; + } + if (sc->vmbus_mnf2 != NULL) { + hyperv_dmamem_free(&sc->vmbus_mnf2_dma, sc->vmbus_mnf2); + sc->vmbus_mnf2 = NULL; + } + CPU_FOREACH(cpu) { if (VMBUS_PCPU_GET(sc, message, cpu) != NULL) { hyperv_dmamem_free( @@ -609,8 +644,7 @@ vmbus_bus_init(void) /* * Connect to VMBus in the root partition */ - ret = hv_vmbus_connect(); - + ret = hv_vmbus_connect(sc); if (ret != 0) goto cleanup; Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Jun 8 05:32:39 2016 (r301582) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Jun 8 05:34:22 2016 (r301583) @@ -51,7 +51,7 @@ struct vmbus_pcpu_data { struct vmbus_message *message; /* shared messages */ uint32_t vcpuid; /* virtual cpuid */ int event_flags_cnt;/* # of event flags */ - struct vmbus_evtflags *event_flags; /* shared event flags */ + struct vmbus_evtflags *event_flags; /* event flags from host */ /* Rarely used fields */ struct hyperv_dma message_dma; /* busdma glue */ @@ -63,12 +63,26 @@ struct vmbus_pcpu_data { struct vmbus_softc { void (*vmbus_event_proc)(struct vmbus_softc *, int); + void *vmbus_tx_evtflags; + /* event flags to host */ + void *vmbus_mnf2; /* monitored by host */ + + u_long *vmbus_rx_evtflags; + /* compat evtflgs from host */ struct vmbus_pcpu_data vmbus_pcpu[MAXCPU]; /* Rarely used fields */ device_t vmbus_dev; int vmbus_idtvec; uint32_t vmbus_flags; /* see VMBUS_FLAG_ */ + + /* Shared memory for vmbus_{rx,tx}_evtflags */ + void *vmbus_evtflags; + struct hyperv_dma vmbus_evtflags_dma; + + void *vmbus_mnf1; /* monitored by VM, unused */ + struct hyperv_dma vmbus_mnf1_dma; + struct hyperv_dma vmbus_mnf2_dma; }; #define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */ From owner-svn-src-all@freebsd.org Wed Jun 8 06:33:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D4E1B6FCED; Wed, 8 Jun 2016 06:33:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA141B94; Wed, 8 Jun 2016 06:33:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u586XuS3085309; Wed, 8 Jun 2016 06:33:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u586XuDt085308; Wed, 8 Jun 2016 06:33:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201606080633.u586XuDt085308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 8 Jun 2016 06:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301584 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 06:33:57 -0000 Author: delphij Date: Wed Jun 8 06:33:55 2016 New Revision: 301584 URL: https://svnweb.freebsd.org/changeset/base/301584 Log: Apply mergemaster r255428: Pass -n (do not emit comments) when saving mtree information for future mergemaster(8) runs. MFC after: 3 days Modified: head/release/scripts/mm-mtree.sh Modified: head/release/scripts/mm-mtree.sh ============================================================================== --- head/release/scripts/mm-mtree.sh Wed Jun 8 05:34:22 2016 (r301583) +++ head/release/scripts/mm-mtree.sh Wed Jun 8 06:33:55 2016 (r301584) @@ -147,7 +147,7 @@ find -d ${TEMPROOT} -type d -empty -dele # Build the mtree database in a temporary location. MTREENEW=`mktemp -t mergemaster.mtree` -mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null +mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" From owner-svn-src-all@freebsd.org Wed Jun 8 07:33:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4610B6E995; Wed, 8 Jun 2016 07:33:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87395165E; Wed, 8 Jun 2016 07:33:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u587XH9Z007555; Wed, 8 Jun 2016 07:33:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u587XHpb007552; Wed, 8 Jun 2016 07:33:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606080733.u587XHpb007552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 07:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301585 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 07:33:18 -0000 Author: trasz Date: Wed Jun 8 07:33:17 2016 New Revision: 301585 URL: https://svnweb.freebsd.org/changeset/base/301585 Log: Add iser(4) manual page. Obtained from: Mellanox Technologies MFC after: 1 month Added: head/share/man/man4/iser.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/iscsi.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Jun 8 06:33:55 2016 (r301584) +++ head/share/man/man4/Makefile Wed Jun 8 07:33:17 2016 (r301585) @@ -863,7 +863,7 @@ _dtrace_udp.4= dtrace_udp.4 .if ${MK_ISCSI} != "no" MAN+= iscsi.4 MAN+= iscsi_initiator.4 - +MAN+= iser.4 .endif .if ${MK_TESTS} != "no" Modified: head/share/man/man4/iscsi.4 ============================================================================== --- head/share/man/man4/iscsi.4 Wed Jun 8 06:33:55 2016 (r301584) +++ head/share/man/man4/iscsi.4 Wed Jun 8 07:33:17 2016 (r301585) @@ -107,6 +107,7 @@ While the connection is down all input/o retried after the connection is reestablished. .El .Sh SEE ALSO +.Xr iser 4 , .Xr iscsi.conf 5 , .Xr iscsictl 8 , .Xr iscsid 8 Added: head/share/man/man4/iser.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/iser.4 Wed Jun 8 07:33:17 2016 (r301585) @@ -0,0 +1,93 @@ +.\" Copyright (c) 2015, Mellanox Technologies, Inc. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.\" $FreeBSD$ +.Dd June 6, 2016 +.Dt ISER 4 +.Os +.Sh NAME +.Nm iser +.Nd iSCSI Extensions for RDMA driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iser" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +iser_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +(iSCSI Extensions for RDMA) initiator driver extends the iSCSI protocol to RDMA. +It permits data to be transferred directly into and out of SCSI buffers +without intermediate data copies. +iSER uses the RDMA protocol suite to supply higher bandwidth for +block storage transfers (zero copy behavior). To that fact, it eliminates the +TCP/IP processing overhead while preserving the compatibility with iSCSI protocol. +The initiator is the iSCSI/iSER client, which connects to an iSCSI/iSER target, +providing local access to a remote block device. +The userland component is provided by +.Xr iscsid 8 +and both the kernel and userland are configured using +.Xr iscsictl 8 . +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va kern.iser.debug +Verbosity level for log messages from the +.Nm +driver. +Set to 0 to disable logging or 1 to warn about potential problems. +Larger values enable info and debugging output. +Defaults to 0. +.El +.Sh SEE ALSO +.Xr iscsi 4 , +.Xr iscsi.conf 5 , +.Xr iscsictl 8 , +.Xr iscsid 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm +subsystem was developed by +.An Max Gurtovoy Aq Mt maxg@mellanox.com +and +.An Sagi Grimberg Aq Mt sagig@mellanox.com +under sponsorship from Mellanox Technologies. From owner-svn-src-all@freebsd.org Wed Jun 8 07:36:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ADF5B6EA0A; Wed, 8 Jun 2016 07:36:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7D611843; Wed, 8 Jun 2016 07:36:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u587a0Su007706; Wed, 8 Jun 2016 07:36:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u587a0IE007705; Wed, 8 Jun 2016 07:36:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606080736.u587a0IE007705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 07:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301586 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 07:36:02 -0000 Author: trasz Date: Wed Jun 8 07:36:00 2016 New Revision: 301586 URL: https://svnweb.freebsd.org/changeset/base/301586 Log: Pacify igor(8) and make it easier to find via "man -k iser". MFC after: 1 month Modified: head/share/man/man4/iser.4 Modified: head/share/man/man4/iser.4 ============================================================================== --- head/share/man/man4/iser.4 Wed Jun 8 07:33:17 2016 (r301585) +++ head/share/man/man4/iser.4 Wed Jun 8 07:36:00 2016 (r301586) @@ -1,5 +1,5 @@ .\" Copyright (c) 2015, Mellanox Technologies, Inc. All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -8,7 +8,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" 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 @@ -20,7 +20,7 @@ .\" 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 June 6, 2016 @@ -28,7 +28,7 @@ .Os .Sh NAME .Nm iser -.Nd iSCSI Extensions for RDMA driver +.Nd iSCSI Extensions for RDMA (iSER) driver .Sh SYNOPSIS To compile this driver into the kernel, place the following line in the @@ -50,7 +50,8 @@ The It permits data to be transferred directly into and out of SCSI buffers without intermediate data copies. iSER uses the RDMA protocol suite to supply higher bandwidth for -block storage transfers (zero copy behavior). To that fact, it eliminates the +block storage transfers (zero copy behavior). +To that fact, it eliminates the TCP/IP processing overhead while preserving the compatibility with iSCSI protocol. The initiator is the iSCSI/iSER client, which connects to an iSCSI/iSER target, providing local access to a remote block device. From owner-svn-src-all@freebsd.org Wed Jun 8 07:39:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30EAFB6EAC9; Wed, 8 Jun 2016 07:39:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E606F1B32; Wed, 8 Jun 2016 07:39:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u587duki007986; Wed, 8 Jun 2016 07:39:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u587ducq007984; Wed, 8 Jun 2016 07:39:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606080739.u587ducq007984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 07:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301587 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 07:39:57 -0000 Author: trasz Date: Wed Jun 8 07:39:55 2016 New Revision: 301587 URL: https://svnweb.freebsd.org/changeset/base/301587 Log: Improve documentation for usfs(4) and usb_template(4). Reviewed by: hselasky (earlier version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D6740 Modified: head/share/man/man4/usb_template.4 head/share/man/man4/usfs.4 Modified: head/share/man/man4/usb_template.4 ============================================================================== --- head/share/man/man4/usb_template.4 Wed Jun 8 07:36:00 2016 (r301586) +++ head/share/man/man4/usb_template.4 Wed Jun 8 07:39:55 2016 (r301587) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 18, 2014 +.Dd June 8, 2016 .Dt USB_TEMPLATE 4 .Os . @@ -32,7 +32,7 @@ . .Nm usb_template . -.Nd "USB templates" +.Nd "USB device side templates" . . .Sh SYNOPSIS @@ -59,19 +59,33 @@ configuration descriptors, one or more U or more USB endpoint descriptors, USB strings and additional USB descriptors. . -The USB template module currently has templates for USB Mass Storage, -USB CDC Ethernet and Message Transfer Protocol. +USB templates are selected using the +.Va hw.usb.template +sysctl and tunable. . -USB templates are currently selected using the "hw.usb.template" -sysctl. -. -The "hw.usb.template" value can be changed at any time, but will not +The +.Va hw.usb.template +value can be changed at any time, but will not have any effect until the USB device has been re-enumerated. . -. +Available templates are: +.Bl -column -offset 3n "Value" +.It Em Value Ta Em Description +.It Dv 0 Ta USB Mass Storage +.It Dv 1 Ta CDC Ethernet +.It Dv 2 Ta Media Transfer Protocol (MTP) +.It Dv 3 Ta USB serial port +.It Dv 4 Ta USB audio +.It Dv 5 Ta USB keyboard +.It Dv 6 Ta USB mouse +.It Dv 7 Ta USB phone +.It Dv 8 Ta CDC Ethernet and serial port +.It Dv 9 Ta USB MIDI +.El . .Sh SEE ALSO -.Xr usb 4 +.Xr usb 4 , +.Xr usfs 4 .Sh STANDARDS The .Nm Modified: head/share/man/man4/usfs.4 ============================================================================== --- head/share/man/man4/usfs.4 Wed Jun 8 07:36:00 2016 (r301586) +++ head/share/man/man4/usfs.4 Wed Jun 8 07:39:55 2016 (r301587) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2014 +.Dd June 8, 2016 .Dt USFS 4 .Os .Sh NAME @@ -50,12 +50,17 @@ usfs_load="YES" The .Nm driver provides support for emulating an USB mass storage device when -the USB stack is activated in USB device side mode. +the USB stack is activated in USB device side mode (the +.Xr usb_template 4 +module is loaded and the +.Va hw.usb.template +sysctl is set to 0). .Pp Upon attach the driver creates a RAM disk which can be read and written. .Sh SEE ALSO .Xr umass 4 , -.Xr usb 4 +.Xr usb 4 , +.Xr usb_template 4 .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Wed Jun 8 07:47:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A487B6EF12; Wed, 8 Jun 2016 07:47:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F10102F; Wed, 8 Jun 2016 07:47:23 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u587lMk7011487; Wed, 8 Jun 2016 07:47:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u587lMe6011482; Wed, 8 Jun 2016 07:47:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606080747.u587lMe6011482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 8 Jun 2016 07:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301588 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 07:47:23 -0000 Author: sephe Date: Wed Jun 8 07:47:21 2016 New Revision: 301588 URL: https://svnweb.freebsd.org/changeset/base/301588 Log: hyperv/vmbus: Change tx_evtflags type to u_long to match vmbus_evtflags MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6745 Modified: head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_reg.h head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 8 07:39:55 2016 (r301587) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 8 07:47:21 2016 (r301588) @@ -37,12 +37,16 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include #include + #include #include #include #include +#include #include static int vmbus_channel_create_gpadl_header( @@ -65,11 +69,11 @@ vmbus_channel_set_event(hv_vmbus_channel if (channel->offer_msg.monitor_allocated) { struct vmbus_softc *sc = vmbus_get_softc(); hv_vmbus_monitor_page *monitor_page; + uint32_t chanid = channel->offer_msg.child_rel_id; - /* Each uint32_t represents 32 channels */ - synch_set_bit((channel->offer_msg.child_rel_id & 31), - ((uint32_t *)sc->vmbus_tx_evtflags - + ((channel->offer_msg.child_rel_id >> 5)))); + atomic_set_long( + &sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT], + 1UL << (chanid & VMBUS_EVTFLAG_MASK)); monitor_page = sc->vmbus_mnf2; synch_set_bit(channel->monitor_bit, Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 8 07:39:55 2016 (r301587) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 8 07:47:21 2016 (r301588) @@ -353,12 +353,10 @@ hv_vmbus_set_event(hv_vmbus_channel *cha { struct vmbus_softc *sc = vmbus_get_softc(); int ret = 0; - uint32_t child_rel_id = channel->offer_msg.child_rel_id; + uint32_t chanid = channel->offer_msg.child_rel_id; - /* Each uint32_t represents 32 channels */ - - synch_set_bit(child_rel_id & 31, - (((uint32_t *)sc->vmbus_tx_evtflags + (child_rel_id >> 5)))); + atomic_set_long(&sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT], + 1UL << (chanid & VMBUS_EVTFLAG_MASK)); ret = hv_vmbus_signal_event(channel->signal_event_param); return (ret); Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Wed Jun 8 07:39:55 2016 (r301587) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Jun 8 07:47:21 2016 (r301588) @@ -340,7 +340,7 @@ vmbus_dma_alloc(struct vmbus_softc *sc) if (evtflags == NULL) return ENOMEM; sc->vmbus_rx_evtflags = (u_long *)evtflags; - sc->vmbus_tx_evtflags = evtflags + (PAGE_SIZE / 2); + sc->vmbus_tx_evtflags = (u_long *)(evtflags + (PAGE_SIZE / 2)); sc->vmbus_evtflags = evtflags; sc->vmbus_mnf1 = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, Modified: head/sys/dev/hyperv/vmbus/vmbus_reg.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_reg.h Wed Jun 8 07:39:55 2016 (r301587) +++ head/sys/dev/hyperv/vmbus/vmbus_reg.h Wed Jun 8 07:47:21 2016 (r301588) @@ -66,6 +66,7 @@ CTASSERT(sizeof(struct vmbus_message) == #define VMBUS_EVTFLAG_SHIFT 5 #endif #define VMBUS_EVTFLAG_LEN (1 << VMBUS_EVTFLAG_SHIFT) +#define VMBUS_EVTFLAG_MASK (VMBUS_EVTFLAG_LEN - 1) #define VMBUS_EVTFLAGS_SIZE 256 struct vmbus_evtflags { Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Jun 8 07:39:55 2016 (r301587) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Wed Jun 8 07:47:21 2016 (r301588) @@ -63,7 +63,7 @@ struct vmbus_pcpu_data { struct vmbus_softc { void (*vmbus_event_proc)(struct vmbus_softc *, int); - void *vmbus_tx_evtflags; + u_long *vmbus_tx_evtflags; /* event flags to host */ void *vmbus_mnf2; /* monitored by host */ From owner-svn-src-all@freebsd.org Wed Jun 8 08:50:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA3DB6E274; Wed, 8 Jun 2016 08:50:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73F531FB5; Wed, 8 Jun 2016 08:50:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u588odOb034399; Wed, 8 Jun 2016 08:50:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u588oZJO033781; Wed, 8 Jun 2016 08:50:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606080850.u588oZJO033781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 08:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301589 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 08:50:40 -0000 Author: trasz Date: Wed Jun 8 08:50:35 2016 New Revision: 301589 URL: https://svnweb.freebsd.org/changeset/base/301589 Log: Fix a bunch of "sentence not on new line" warnings from igor(1). MFC after: 1 month Modified: head/share/man/man4/ahci.4 head/share/man/man4/apic.4 head/share/man/man4/atp.4 head/share/man/man4/atrtc.4 head/share/man/man4/bcma.4 head/share/man/man4/bhnd.4 head/share/man/man4/bhyve.4 head/share/man/man4/bpf.4 head/share/man/man4/cmx.4 head/share/man/man4/cxgbe.4 head/share/man/man4/devctl.4 head/share/man/man4/fdt.4 head/share/man/man4/fdtbus.4 head/share/man/man4/hpet.4 head/share/man/man4/hptrr.4 head/share/man/man4/inet.4 head/share/man/man4/ipmi.4 head/share/man/man4/ksyms.4 head/share/man/man4/mdio.4 head/share/man/man4/mfi.4 head/share/man/man4/mpt.4 head/share/man/man4/nand.4 head/share/man/man4/ng_atm.4 head/share/man/man4/ng_bridge.4 head/share/man/man4/ng_car.4 head/share/man/man4/ng_deflate.4 head/share/man/man4/ng_hub.4 head/share/man/man4/ng_netflow.4 head/share/man/man4/ng_pptpgre.4 head/share/man/man4/ng_pred1.4 head/share/man/man4/nvd.4 head/share/man/man4/nvme.4 head/share/man/man4/nvram2env.4 head/share/man/man4/proto.4 head/share/man/man4/psm.4 head/share/man/man4/pts.4 head/share/man/man4/sdhci.4 head/share/man/man4/sfxge.4 head/share/man/man4/siba.4 head/share/man/man4/siftr.4 head/share/man/man4/simplebus.4 head/share/man/man4/snd_hda.4 head/share/man/man4/stf.4 head/share/man/man4/u3g.4 head/share/man/man4/virtio_scsi.4 head/share/man/man4/witness.4 Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ahci.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -141,7 +141,8 @@ API or emulated .Xr ses 4 device for localization and status reporting purposes. Supporting AHCI controllers may transmit that information to the backplane -controllers via SGPIO interface. Backplane controllers interpret received +controllers via SGPIO interface. +Backplane controllers interpret received statuses in some way (IBPI standard) to report them using present indicators. .Sh HARDWARE The Modified: head/share/man/man4/apic.4 ============================================================================== --- head/share/man/man4/apic.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/apic.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -43,7 +43,8 @@ The following tunable is settable from t .Xr loader 8 : .Bl -ohang .It Va hint.apic. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. +controls event timers functionality support. +Setting to 0, disables it. Default value is 1. .It Va hint.apic. Ns Ar X Ns Va .disabled Set this to 1 to disable APIC support, falling back to the legacy PIC. Modified: head/share/man/man4/atp.4 ============================================================================== --- head/share/man/man4/atp.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/atp.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -50,7 +50,8 @@ atp_load="YES" The .Nm driver provides support for the Apple Internal Trackpad device found in many -Apple laptops. Older (Fountain/Geyser) and the newer (Wellspring) trackpad +Apple laptops. +Older (Fountain/Geyser) and the newer (Wellspring) trackpad families are all supported through a unified driver. .Pp The driver simulates a three\-button mouse using multi\-finger tap detection. Modified: head/share/man/man4/atrtc.4 ============================================================================== --- head/share/man/man4/atrtc.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/atrtc.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -37,7 +37,8 @@ The following tunable is settable from t .Xr loader 8 : .Bl -ohang .It Va hint.atrtc. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. +controls event timers functionality support. +Setting to 0, disables it. Default value is 1. .El .Sh DESCRIPTION Modified: head/share/man/man4/bcma.4 ============================================================================== --- head/share/man/man4/bcma.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/bcma.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -55,7 +55,8 @@ in later Broadcom Home Networking Divisi embedded systems. .Pp A common interconnect connects all of the backplane's functional -blocks. These functional blocks, known as cores, use the ARM AMBA AXI or +blocks. +These functional blocks, known as cores, use the ARM AMBA AXI or APB interface to communicate with devices attached to the interconnect. .Pp The IP cores used in Modified: head/share/man/man4/bhnd.4 ============================================================================== --- head/share/man/man4/bhnd.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/bhnd.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -52,8 +52,8 @@ devices. .Pp The Broadcom HND device family consists of SoCs (System On a Chip) and host-connected chipsets based on a common library of Broadcom IP -cores connected via an internal hardware bus architecture. Drivers -for these cores are implemented against the unified +cores connected via an internal hardware bus architecture. +Drivers for these cores are implemented against the unified .Nm interface. .Pp Modified: head/share/man/man4/bhyve.4 ============================================================================== --- head/share/man/man4/bhyve.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/bhyve.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -38,8 +38,8 @@ .Cd "/boot/kernel/vmm.ko" .Sh DESCRIPTION .Nm -is a virtual machine monitor that is hosted by FreeBSD. It is used to host -unmodified guest operating systems on top of FreeBSD. +is a virtual machine monitor that is hosted by FreeBSD. +It is used to host unmodified guest operating systems on top of FreeBSD. .Pp .Nm relies heavily on hardware assist provided by the CPU and chipset to virtualize Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/bpf.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -577,7 +577,8 @@ output via the interface is successful. When .Dv BPF_D_INOUT direction is set, injected outgoing packet is not returned by BPF to avoid -duplication. This flag is initialized to zero by default. +duplication. +This flag is initialized to zero by default. .It Dv BIOCLOCK Set the locked flag on the .Nm Modified: head/share/man/man4/cmx.4 ============================================================================== --- head/share/man/man4/cmx.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/cmx.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -42,7 +42,8 @@ driver provides support for the PCCARD b smartcard reader. The driver provides a character device special file based .Em Chip/Smart Card Interface Devices (CCID) -interface. The driver implements what the vendor calls the +interface. +The driver implements what the vendor calls the .Em Synchronous API onto the smartcard reader device. .Pp @@ -51,8 +52,9 @@ Reading and writing is synchronous, mean directly corresponds to a complete CCID command sent to the device, while the following .Xr read 2 -will return the complete answer from the reader. There is no -support for partial reads or writes. There is no upper limit on +will return the complete answer from the reader. +There is no support for partial reads or writes. +There is no upper limit on CCID request or response sizes, but the complete CCID request must be sent to the driver in .Xr write 2 @@ -64,7 +66,8 @@ Non-blocking I/O, .Xr select 2 and .Xr poll 2 -are supported and work as expected. An open file descriptor +are supported and work as expected. +An open file descriptor will always be ready for writing, but only ready for reading if the device indicates that it has data available. .Sh FILES @@ -112,9 +115,9 @@ Early testing and bug fixes by .An -nosplit The way the .Nm -driver talks to the CardMan 4040 is a bit rough. Due to the -complete lack of hardware documentation other than vendor drivers +driver talks to the CardMan 4040 is a bit rough. +Due to the complete lack of hardware documentation other than vendor drivers for other operating systems, the gory details of the device's -I/O registers are not understood very well. There may be error -conditions which can only be solved by physically reinserting the -reader. +I/O registers are not understood very well. +There may be error conditions which can only be solved by physically +reinserting the reader. Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/cxgbe.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -270,11 +270,13 @@ The default is -1 which lets the driver 0 or 1 explicitly disable or enable this feature. .It Va hw.cxgbe.allow_mbufs_in_cluster 1 allows the driver to lay down one or more mbufs within the receive buffer -opportunistically. This is the default. +opportunistically. +This is the default. 0 prohibits the driver from doing so. .It Va hw.cxgbe.largest_rx_cluster .It Va hw.cxgbe.safest_rx_cluster -Sizes of rx clusters. Each of these must be set to one of the sizes available +Sizes of rx clusters. +Each of these must be set to one of the sizes available (usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater than or equal to safest_rx_cluster. The defaults are 16384 and 4096 respectively. Modified: head/share/man/man4/devctl.4 ============================================================================== --- head/share/man/man4/devctl.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/devctl.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -75,7 +75,8 @@ Listening programs are expected to cope. .Pp The sysctl .Va hw.bus.devctl_queue -can be used to control queue length. It is set to 0 to disable +can be used to control queue length. +It is set to 0 to disable .Nm when no .Xr devd 8 Modified: head/share/man/man4/fdt.4 ============================================================================== --- head/share/man/man4/fdt.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/fdt.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -41,19 +41,20 @@ .Sh DESCRIPTION .Em Flattened Device Tree is a mechanism for describing computer hardware resources, which cannot be -probed or self enumerated, in a uniform and portable way. The primary -consumers of this technology are +probed or self enumerated, in a uniform and portable way. +The primary consumers of this technology are .Em embedded systems, where a lot of designs are based on similar chips, but have different assignment of pins, memory layout, addresses bindings, interrupts routing and other resources. .Pp Configuration data, which cannot be self discovered in run-time, has to be -supplied from external source. The concept of a flattened device tree is a +supplied from external source. +The concept of a flattened device tree is a platform and architecture independent approach for resolving such problems. The idea is inherited from Open Firmware IEEE 1275 device-tree notion, and has -been successfully adopted by the embedded industry. The scheme works in the -following way: +been successfully adopted by the embedded industry. +The scheme works in the following way: .Bl -bullet .It Hardware platform resources are @@ -72,7 +73,8 @@ from this [externally supplied] blob, wh any information about the underlying platform hardware resources in the kernel. .It The flattened device tree mechanism in principle does not depend on any -particular first-stage bootloader or firmware features. The only overall +particular first-stage bootloader or firmware features. +The only overall requirement for the environment is to provide a complete device tree description to the kernel. .El @@ -89,8 +91,8 @@ maintenance. .It Va Device tree source (DTS) The device tree source is a text file which describes hardware resources of a computer system in a human-readable form, with certain hierarchical structure -(a tree). The default location for DTS files -in the +(a tree). +The default location for DTS files in the .Fx source repository is .Pa sys/boot/fdt/dts @@ -140,7 +142,8 @@ kernel level. .It Va options FDT The primary option for enabling .Nm -support in the kernel. It covers all low-level and infrastructure parts of +support in the kernel. +It covers all low-level and infrastructure parts of .Nm kernel support, which primarily are the .Xr fdtbus 4 @@ -149,16 +152,18 @@ and drivers, as well as helper routines and libraries. .It Va makeoptions FDT_DTS_FILE=.dts Specifies a preferred (default) device tree source (DTS) file for a given -kernel. The indicated DTS file will be converted (compiled) into a binary form -along with building the kernel itself. The DTS file name is relative -to the default location of DTS sources i.e. +kernel. +The indicated DTS file will be converted (compiled) into a binary form +along with building the kernel itself. +The DTS file name is relative to the default location of DTS sources i.e. .Pa sys/boot/fdt/dts . This makeoption is not mandatory unless FDT_DTB_STATIC is also defined (see below). .It Va options FDT_DTB_STATIC Typically, the device tree blob (DTB) is a stand-alone file, physically separate from the kernel, but this option lets statically embed a -DTB file into a kernel image. Note that when this is specified the +DTB file into a kernel image. +Note that when this is specified the FDT_DTS_FILE makeoption becomes mandatory (as there needs to be a DTS file specified in order to embed it into the kernel image). .El @@ -182,5 +187,6 @@ support first appeared in The .Nm support was developed by Semihalf under sponsorship from the FreeBSD -Foundation. This manual page was written by +Foundation. +This manual page was written by .An Rafal Jaworowski . Modified: head/share/man/man4/fdtbus.4 ============================================================================== --- head/share/man/man4/fdtbus.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/fdtbus.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -43,7 +43,8 @@ abstract bus driver is the primary conne .Xr fdt 4 hardware resources description and .Fx -native newbus device drivers framework. For an embedded system +native newbus device drivers framework. +For an embedded system .Nm represents peripherals typically found on a highly integrated chip (system-on-chip). @@ -84,5 +85,6 @@ support first appeared in The .Nm support was developed by Semihalf under sponsorship from the FreeBSD -Foundation. This manual page was written by +Foundation. +This manual page was written by .An Rafal Jaworowski . Modified: head/share/man/man4/hpet.4 ============================================================================== --- head/share/man/man4/hpet.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/hpet.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -42,16 +42,19 @@ The following tunables are settable from .Xr loader 8 : .Bl -ohang .It Va hint.hpet. Ns Ar X Ns Va .allowed_irqs -is a 32bit mask. Each set bit allows driver to use respective IRQ, +is a 32bit mask. +Each set bit allows driver to use respective IRQ, if BIOS also set respective capability bit in comparator's configuration register. Default value is 0xffff0000, except some known broken hardware. .It Va hint.hpet. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. +controls event timers functionality support. +Setting to 0, disables it. Default value is 1. .It Va hint.hpet. Ns Ar X Ns Va .legacy_route -controls "LegacyReplacement Route" mode. If enabled, HPET will steal IRQ0 of -i8254 timer and IRQ8 of RTC. Before using it, make sure that respective +controls "LegacyReplacement Route" mode. +If enabled, HPET will steal IRQ0 of i8254 timer and IRQ8 of RTC. +Before using it, make sure that respective drivers are not using interrupts, by setting also: .Bd -literal hint.attimer.0.clock=0 @@ -77,8 +80,8 @@ Depending on hardware capabilities and c delivered as regular I/O APIC interrupt (ISA or PCI) in range from 0 to 31, or as Front Side Bus interrupt, alike to PCI MSI interrupts, or in so called "LegacyReplacement Route" HPET can steal IRQ0 of i8254 and IRQ8 of the RTC. -Interrupt can be either edge- or level-triggered. In last case they could be -safely shared with PCI IRQs. +Interrupt can be either edge- or level-triggered. +In last case they could be safely shared with PCI IRQs. Driver prefers to use FSB interrupts, if supported, to avoid sharing. If it is not possible, it uses single sharable IRQ from PCI range. Other modes (LegacyReplacement and ISA IRQs) require special care to setup, @@ -89,9 +92,10 @@ and irrelevant to CPU power states. .Pp Depending on hardware capabilities and configuration, driver can expose each comparator as separate event timer or group them into one or several per-CPU -event timers. In last case interrupt of every of those comparators within -group is bound to specific CPU core. This is possible only when each -of these comparators has own unsharable IRQ. +event timers. +In last case interrupt of every of those comparators within +group is bound to specific CPU core. +This is possible only when each of these comparators has own unsharable IRQ. .Sh SEE ALSO .Xr acpi 4 , .Xr apic 4 , Modified: head/share/man/man4/hptrr.4 ============================================================================== --- head/share/man/man4/hptrr.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/hptrr.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -51,7 +51,8 @@ The following tunables are settable from .Bl -ohang .It Va hw.hptrr.attach_generic set to 1 to permit driver attach to chips with generic Marvell (non-HighPoint) -PCI identification. These chips are also supported by +PCI identification. +These chips are also supported by .Xr ata 4 and .Xr mvs 4 . Modified: head/share/man/man4/inet.4 ============================================================================== --- head/share/man/man4/inet.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/inet.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -149,8 +149,8 @@ as argument. .It Dv SIOCGIFBRDADDR .It Dv SIOCGIFDSTADDR .It Dv SIOCGIFNETMASK -Return address information from interface. The returned value -is in +Return address information from interface. +The returned value is in .Ft struct ifreq . This way of address information retrieval is obsoleted, a preferred way is to use Modified: head/share/man/man4/ipmi.4 ============================================================================== --- head/share/man/man4/ipmi.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ipmi.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -63,8 +63,8 @@ If the .Ar port and .Ar spacing -are not specified the interface type default will be used. Only specify -either the +are not specified the interface type default will be used. +Only specify either the .Ar port for I/O access or .Ar maddr Modified: head/share/man/man4/ksyms.4 ============================================================================== --- head/share/man/man4/ksyms.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ksyms.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -39,16 +39,18 @@ The .Pa /dev/ksyms character device provides a read-only interface to a snapshot of the kernel -symbol table. The in-kernel symbol manager is designed to be able to handle +symbol table. +The in-kernel symbol manager is designed to be able to handle many types of symbols tables, however, only .Xr elf 5 -symbol tables are supported by this device. The ELF format image contains two +symbol tables are supported by this device. +The ELF format image contains two sections: a symbol table and a corresponding string table. .Bl -tag -width indent -offset indent .It Dv Symbol Table The SYMTAB section contains the symbol table entries present in the current -running kernel, including the symbol table entries of any loaded modules. The -symbols are ordered by the kernel module load time starting with kernel file +running kernel, including the symbol table entries of any loaded modules. +The symbols are ordered by the kernel module load time starting with kernel file symbols first, followed by the first loaded module's symbols and so on. .It Dv String Table The STRTAB section contains the symbol name strings from the kernel and any @@ -97,14 +99,16 @@ of will fail if: .Bl -tag -width Er .It Bq Er EBUSY -The device is already open. A process must close +The device is already open. +A process must close .Pa /dev/ksyms before it can be opened again. .It Bq Er ENOMEM There is a resource shortage in the kernel. .It Bq Er ENXIO The driver was unsuccessful in creating a snapshot of the kernel symbol -table. This may occur if the kernel was in the process of loading or +table. +This may occur if the kernel was in the process of loading or unloading a module. .El .Sh SEE ALSO @@ -133,13 +137,19 @@ driver was written by .An Stacey Son Aq Mt sson@FreeBSD.org . .Sh BUGS Because files can be dynamically linked into the kernel at any time the symbol -information can vary. When you open the +information can vary. +When you open the .Pa /dev/ksyms -file, you have access to an ELF image which represents a snapshot of the state of the kernel symbol information at that instant in time. Keeping the device open does not block the loading or unloading of kernel modules. To get a new snapshot you must close and re-open the device. +file, you have access to an ELF image which represents a snapshot of the state +of the kernel symbol information at that instant in time. +Keeping the device open does not block the loading or unloading of kernel +modules. +To get a new snapshot you must close and re-open the device. .Pp A process is only allowed to open the .Pa /dev/ksyms -file once at a time. The process must close the +file once at a time. +The process must close the .Pa /dev/ksyms before it is allowed to open it again. .Pp Modified: head/share/man/man4/mdio.4 ============================================================================== --- head/share/man/man4/mdio.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/mdio.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -32,7 +32,8 @@ external PHY devices. .Tn MDIO is one of two signal interfaces that comprise the Media Independent Interface (MII) defined by the IEEE 802.3 -Standard. The +Standard. +The .Xr miibus 4 driver provides support for devices that require full .Tn MII Modified: head/share/man/man4/mfi.4 ============================================================================== --- head/share/man/man4/mfi.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/mfi.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -75,8 +75,9 @@ then the driver will allow mounted volum .Pp A tunable is provided to adjust the .Nm -driver's behaviour when attaching to a card. By default the driver will -attach to all known cards with high probe priority. If the tunable +driver's behaviour when attaching to a card. +By default the driver will attach to all known cards with high probe priority. +If the tunable .Va hw.mfi.mrsas_enable is set to 1, then the driver will reduce its probe priority to allow Modified: head/share/man/man4/mpt.4 ============================================================================== --- head/share/man/man4/mpt.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/mpt.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -132,7 +132,8 @@ The controller chips are also present on many new AMD/Opteron based systems, like the Sun 4100. Note that this controller can drive both SAS and SATA -drives or a mix of them at the same time. The Integrated RAID Mirroring +drives or a mix of them at the same time. +The Integrated RAID Mirroring available for these controllers is poorly supported at best. .Pp The Modified: head/share/man/man4/nand.4 ============================================================================== --- head/share/man/man4/nand.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/nand.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -43,27 +43,29 @@ The framework consists of a set of interfaces that aim to provide an extensible, object oriented environement for NAND controllers and NAND Flash memory chips from various hardware vendors, and to allow for uniform and flexible -management of the NAND devices. It comprises of the following major -components: +management of the NAND devices. +It comprises of the following major components: .Bl -bullet .It NAND Flash controller (NFC) interface. .Pp Defines methods which allow to send commands as well as send/receive data -between the controller and a NAND chip. Back-end drivers for specific NAND +between the controller and a NAND chip. +Back-end drivers for specific NAND controllers plug into this interface and implement low-level routines for a given NAND controller. .Pp -This layer implements basic functionality of a NAND Flash controller. It -allows to send command and address to chip, drive CS (chip select line), as -well as read/write to the selected NAND chip. This layer is independent of +This layer implements basic functionality of a NAND Flash controller. +It allows to send command and address to chip, drive CS (chip select line), +as well as read/write to the selected NAND chip. +This layer is independent of NAND chip devices actually connected to the controller. .It NAND chip interface. .Pp -Provides basic operations like read page, program page, erase block. Currently -three generic classes of drivers are available, which provide support for the -following chips: +Provides basic operations like read page, program page, erase block. +Currently three generic classes of drivers are available, which provide +support for the following chips: .Bl -bullet .It large page @@ -74,7 +76,8 @@ ONFI-compliant .El .Pp This layer implements basic operations to be performed on a NAND chip, like -read, program, erase, get status etc. Since these operations use specific +read, program, erase, get status etc. +Since these operations use specific commands (depending on the vendor), each chip has potentially its own implementation of the commands set. .Pp @@ -87,9 +90,10 @@ This layer is responsible for enumeratin establishing the hierarchy between chips and their supervising controllers. .Pp Its main purpose is detecting type of NAND chips connected to a given chip -select (CS line). It also allows manages locking access to the NAND -controller. NANDbus passes requests from an active chip to the chip +select (CS line). +It also allows manages locking access to the NAND controller. +NANDbus passes requests from an active chip to the chip controller. .It NAND character / GEOM device. .Pp Modified: head/share/man/man4/ng_atm.4 ============================================================================== --- head/share/man/man4/ng_atm.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_atm.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -325,8 +325,8 @@ struct ngm_atm_cpcs_term { }; .Ed .It Dv NGM_ATM_GET_STATS Pq Ic getstats -This command returns a message, containing node statistics. The -structure of the message is: +This command returns a message, containing node statistics. +The structure of the message is: .Bd -literal struct ngm_atm_stats { uint64_t in_packets; Modified: head/share/man/man4/ng_bridge.4 ============================================================================== --- head/share/man/man4/ng_bridge.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_bridge.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -186,8 +186,8 @@ This command sets the persistent flag on .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN -control message, or when all hooks have been disconnected. Setting the -persistent flag via a +control message, or when all hooks have been disconnected. +Setting the persistent flag via a .Dv NGM_BRIDGE_SET_PERSISTENT control message disables automatic node shutdown when the last hook gets disconnected. Modified: head/share/man/man4/ng_car.4 ============================================================================== --- head/share/man/man4/ng_car.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_car.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -109,7 +109,8 @@ links with bandwidth * delay product les consumes additional system resources for queue processing. .El By default, all information rates are measured in bits per second and bursts -are measured in bytes. But when NG_CAR_COUNT_PACKETS option is enabled, +are measured in bytes. +But when NG_CAR_COUNT_PACKETS option is enabled, rates are measured in packets per second and bursts are in packets. .Sh CONTROL MESSAGES This node type supports the generic control messages and the following Modified: head/share/man/man4/ng_deflate.4 ============================================================================== --- head/share/man/man4/ng_deflate.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_deflate.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -154,5 +154,6 @@ control message, or when hook have been .An Alexander Motin Aq Mt mav@alkar.net .Sh BUGS Due to nature of netgraph PPP implementation there are possible race conditions -between data packet and ResetAck CCP packet in case of packet loss. As result, +between data packet and ResetAck CCP packet in case of packet loss. +As result, packet loss can produce bigger performance degradation than supposed by protocol. Modified: head/share/man/man4/ng_hub.4 ============================================================================== --- head/share/man/man4/ng_hub.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_hub.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -54,8 +54,8 @@ This command sets the persistent flag on .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN -control message, or when all hooks have been disconnected. Setting the -persistent flag via a +control message, or when all hooks have been disconnected. +Setting the persistent flag via a .Dv NGM_HUB_SET_PERSISTENT control message disables automatic node shutdown when the last hook gets disconnected. Modified: head/share/man/man4/ng_netflow.4 ============================================================================== --- head/share/man/man4/ng_netflow.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_netflow.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -74,8 +74,9 @@ plus two export hooks: .Va export (for NetFlow version 5) and .Va export9 -(for NetFlow version 9). Export can be done simultaneously for all supported -export hooks. By default (ingress NetFlow enabled) node does NetFlow accounting of data +(for NetFlow version 9). +Export can be done simultaneously for all supported export hooks. +By default (ingress NetFlow enabled) node does NetFlow accounting of data received on .Va iface* hooks. @@ -196,7 +197,8 @@ struct ng_netflow_setconfig { }; .Ed .Pp -Configuration is a bitmask of several options. Option NG_NETFLOW_CONF_INGRESS +Configuration is a bitmask of several options. +Option NG_NETFLOW_CONF_INGRESS enabled by default enables ingress NetFlow generation (for data coming from ifaceX hook). Option Modified: head/share/man/man4/ng_pptpgre.4 ============================================================================== --- head/share/man/man4/ng_pptpgre.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_pptpgre.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -84,7 +84,8 @@ Connection to the lower protocol layers This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_PPTPGRE_SET_CONFIG Pq Ic setconfig -This command resets and configures hook for a session. If corresponding +This command resets and configures hook for a session. +If corresponding session_hhhh hook is not connected, upper hook will be configured. This command takes a .Vt "struct ng_pptpgre_conf" Modified: head/share/man/man4/ng_pred1.4 ============================================================================== --- head/share/man/man4/ng_pred1.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/ng_pred1.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -141,5 +141,6 @@ control message, or when hook have been .An Alexander Motin Aq Mt mav@alkar.net .Sh BUGS Due to nature of netgraph PPP implementation there are possible race conditions -between data packet and ResetAck CCP packet in case of packet loss. As result, +between data packet and ResetAck CCP packet in case of packet loss. +As result, packet loss can produce bigger performance degradation than supposed by protocol. Modified: head/share/man/man4/nvd.4 ============================================================================== --- head/share/man/man4/nvd.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/nvd.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -77,8 +77,9 @@ disks and cannot be partitioned. .Sh CONFIGURATION The .Nm -driver defines a system-wide maximum delete size for NVMe devices. The -default is 1GB. To select a different value, set the following tunable in +driver defines a system-wide maximum delete size for NVMe devices. +The default is 1GB. +To select a different value, set the following tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.nvd.delete_max= Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/nvme.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -89,7 +89,8 @@ not 0, and this driver follows that conv By default, .Nm will create an I/O queue pair for each CPU, provided enough MSI-X vectors -and NVMe queue pairs can be allocated. If not enough vectors or queue +and NVMe queue pairs can be allocated. +If not enough vectors or queue pairs are available, nvme(4) will use a smaller number of queue pairs and assign multiple CPUs per queue pair. .Pp Modified: head/share/man/man4/nvram2env.4 ============================================================================== --- head/share/man/man4/nvram2env.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/nvram2env.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -35,11 +35,11 @@ .Sh DESCRIPTION .Nm implements a simple method of reading the NVRAM-like data and information -stored in flash and storing it in the kernel environment. It can then be -used by various device drivers at boot-time. +stored in flash and storing it in the kernel environment. +It can then be used by various device drivers at boot-time. .Pp -The NVRAM-like data is an array of zero terminated strings. Each string contains -the string name, "=" delimiter and the string value. +The NVRAM-like data is an array of zero terminated strings. +Each string contains the string name, "=" delimiter and the string value. .Pp .Nm copies the environment values into kernel environment using the kernel setenv call. @@ -63,13 +63,14 @@ maxsize - maximum size of data block. flags - control flags, used to select nvram type and enable/disable CRC check. .Bl -tag -width indent .It Fa 0x0001 -Avoid CRC checking. Currently CRC checking is not implemented, so to be future +Avoid CRC checking. +Currently CRC checking is not implemented, so to be future compatible, please set it to "1". .It Fa 0x0002 Use format "Generic", skip uint32_t field, then zero terminating array of strings. .It Fa 0x0004 -Use Broadcom CFE format. uint32_t signature "FLSH", uint32_t size, +Use Broadcom CFE format, uint32_t signature "FLSH", uint32_t size, three unused fields uint32_t, then data. .It Fa 0x0008 Use U-Boot format, uint32_t crc, then zero terminating array of strings. Modified: head/share/man/man4/proto.4 ============================================================================== --- head/share/man/man4/proto.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/proto.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -108,7 +108,8 @@ system call can be used for the .Dv PROTO_IOC_REGION request. This ioctl request returns the extend of the resource covered by this -device special file. The extend is returned in the following structure: +device special file. +The extend is returned in the following structure: .Bd -literal struct proto_ioc_region { unsigned long address; @@ -200,8 +201,8 @@ The field is set on output with the key of the DMA tag. The tag is created with the constraints given by the .Va tag -sub-structure. These constraints correspond roughly to those that can be -given to the +sub-structure. +These constraints correspond roughly to those that can be given to the .Xr bus_dma_tag_create 9 function. .It PROTO_IOC_BUSDMA_TAG_DERIVE @@ -387,7 +388,8 @@ or .Pa mem representing I/O port or memory mapped I/O space (resp.) .Pp -ISA devices do not have a location. Instead, they are identified by the +ISA devices do not have a location. +Instead, they are identified by the first I/O port address or first memory mapped I/O address. Consequently, all device special files corresponding to an ISA device are located under Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/psm.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -110,7 +110,8 @@ The movement of the roller is reported a 8 byte data packets are sent to the user program at this level. .Pp At the operation level two, data from the pointing device is passed to the -user program as is. Conversely, command from the user program is passed +user program as is. +Conversely, command from the user program is passed to the pointing device as is and the user program is responsible for status validation and error recovery. Modern PS/2 type pointing devices often use proprietary data format. @@ -352,7 +353,8 @@ to .Em 0 at boot-time. Currently, this is only supported on Synaptics touchpads with Extended -support disabled. The behaviour may be changed after boot by setting +support disabled. +The behaviour may be changed after boot by setting the sysctl with the same name and by restarting .Xr moused 8 using Modified: head/share/man/man4/pts.4 ============================================================================== --- head/share/man/man4/pts.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/pts.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -119,9 +119,11 @@ remote login with proper back-flushing o used by other similar programs. .It Dv TIOCGPTN Obtain device unit number, which can be used to generate the filename of -the pseudo-terminal slave device. This +the pseudo-terminal slave device. +This .Xr ioctl 2 -should not be used directly. Instead, the +should not be used directly. +Instead, the .Xr ptsname 3 function should be used. .It Dv TIOCPTMASTER @@ -129,7 +131,8 @@ Determine whether the file descriptor is master device. This .Xr ioctl 2 -should not be used directly. It is used to implement routines like +should not be used directly. +It is used to implement routines like .Xr grantpt 3 . .El .Sh FILES Modified: head/share/man/man4/sdhci.4 ============================================================================== --- head/share/man/man4/sdhci.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/sdhci.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -58,8 +58,8 @@ detaches it on card removing. .Sh HARDWARE The .Nm -driver supports different specification compatible chips. The following -chips have been verified to work: +driver supports different specification compatible chips. +The following chips have been verified to work: .Pp .Bl -bullet -compact .It Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/sfxge.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -153,8 +153,8 @@ from loss, because reducing the ACK rate .It Va hw.sfxge.mcdi_logging Enable logging of MCDI protocol messages (only available if enabled at compile-time). .It Va hw.sfxge.N.mcdi_logging -Enable or disable logging of MCDI protocol messages on a per-port basis. The default for each -port will be the value of +Enable or disable logging of MCDI protocol messages on a per-port basis. +The default for each port will be the value of .Va hw.sfxge.mcdi_logging. The logging may also be enabled or disabled after the driver is loaded using the sysctl .Va dev.sfxge.%d.mcdi_logging. Modified: head/share/man/man4/siba.4 ============================================================================== --- head/share/man/man4/siba.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/siba.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -54,7 +54,8 @@ interblock communications architecture f Networking Division wireless chipsets and embedded systems. .Pp A common interconnect connects all of the Silicon Backplane's functional -blocks. These functional blocks, known as cores, use the Open Core Protocol +blocks. +These functional blocks, known as cores, use the Open Core Protocol (OCP) interface to communicate with agents attached to the Silicon Backplane. .Pp @@ -86,7 +87,6 @@ driver was originally written by .An Bruce M. Simpson Aq Mt bms@FreeBSD.org and .An Weongyo Jeong Aq Mt weongyo@FreeBSD.org . - The driver was rewritten for .Fx 11.0 by Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/siftr.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -84,8 +84,8 @@ In the IPv4-only (default) mode, standar "136.186.229.95") is used to format IPv4 addresses for logging. In IPv6 mode, standard dotted decimal notation is used to format IPv4 addresses, and standard colon-separated hex notation (see RFC 4291) is used to format IPv6 -addresses for logging. Note that SIFTR uses uncompressed notation to format IPv6 -addresses. +addresses for logging. +Note that SIFTR uses uncompressed notation to format IPv6 addresses. For example, the address "fe80::20f:feff:fea2:531b" would be logged as "fe80:0:0:0:20f:feff:fea2:531b". .Ss Run-time Configuration @@ -143,8 +143,9 @@ present in the example log messages in t line continuation and is not part of the actual log message. .Pp The first type of log message is written to the file when the module is -enabled and starts collecting data from the running kernel. The text below -shows an example module enable log. The fields are tab delimited key-value +enabled and starts collecting data from the running kernel. +The text below shows an example module enable log. +The fields are tab delimited key-value pairs which describe some basic information about the system. .Bd -literal -offset indent enable_time_secs=1238556193 enable_time_usecs=462104 \\ @@ -289,8 +290,8 @@ The maximum segment size for the flow, i The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick timer. -Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are -reported in the enable log message. +Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. +TCP_RTT_SCALE and HZ are reported in the enable log message. .El .Bl -tag -offset indent -width Va .It Va 18 @@ -307,8 +308,8 @@ for information about the various flags. .It Va 20 The current retransmission timeout length for the flow, in units of HZ, where HZ is the kernel's tick timer. -Divide by HZ to get the timeout length in seconds. HZ is reported in the -enable log message. +Divide by HZ to get the timeout length in seconds. +HZ is reported in the enable log message. .El .Bl -tag -offset indent -width Va .It Va 21 @@ -339,7 +340,8 @@ The current number of segments in the re .It Va 27 Flowid for the connection. A caveat: Zero '0' either represents a valid flowid or a default value when it's -not being set. There is no easy way to differentiate without looking at actual +not being set. +There is no easy way to differentiate without looking at actual network interface card and drivers being used. .El .Bl -tag -offset indent -width Va @@ -715,7 +717,8 @@ variable will create the new file and al to disk again. The new log file path must differ from the path to the deleted file. .It -The hash table used within the code is sized to hold 65536 flows. This is not a +The hash table used within the code is sized to hold 65536 flows. +This is not a hard limit, because chaining is used to handle collisions within the hash table structure. However, we suspect (based on analogies with other hash table performance data) Modified: head/share/man/man4/simplebus.4 ============================================================================== --- head/share/man/man4/simplebus.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/simplebus.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -51,7 +51,8 @@ controller, connectivity controllers, ac .Pp The driver is generic and common for all flattened device tree nodes claiming .Pa simple-bus -compatibility. It iterates over direct descendants of the +compatibility. +It iterates over direct descendants of the .Pa simple-bus node, instantiates newbus children and assigns resources to them, based on the configuration data retrieved from the nodes properties in @@ -78,5 +79,6 @@ support first appeared in The .Nm support was developed by Semihalf under sponsorship from the FreeBSD -Foundation. This manual page was written by +Foundation. +This manual page was written by .An Rafal Jaworowski . Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/snd_hda.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -322,8 +322,8 @@ driver. .It Va misc Misc bits. Can be specified as a number from 0 to 15. -Bit 0 has a special meaning. When set it means that jack detection is -not implemented in hardware. +Bit 0 has a special meaning. +When set it means that jack detection is not implemented in hardware. .El .Ss Runtime Configuration The following @@ -411,8 +411,8 @@ Here we can see, that the nodes with ID connectors (Jack, Front), nids 20, 24 and 26 are rear panel connectors (Jack, Rear) and nid 21 is a built-in speaker (Fixed, Onboard). Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" -connectivity. So the pin count and description matches to connectors that -we have. +connectivity. +So the pin count and description matches to connectors that we have. .Pp Using association (as) and sequence (seq) fields values pins are grouped into 3 associations: @@ -473,8 +473,8 @@ hint.hdac.0.cad0.nid21.config="as=2" will swap line-out and speaker functions. So the .Li pcm0 -device will play to the line-out and headphones jacks. Line-out will -be muted on the headphones jack connection. +device will play to the line-out and headphones jacks. +Line-out will be muted on the headphones jack connection. Recording on .Li pcm0 will go from two external microphones and line-in jacks. @@ -576,7 +576,8 @@ PC speaker input other random inputs .El .Pp -Controls have different precision. Some could be just an on/off triggers. +Controls have different precision. +Some could be just an on/off triggers. Most of controls use logarithmic scale. .Sh HARDWARE The Modified: head/share/man/man4/stf.4 ============================================================================== --- head/share/man/man4/stf.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/stf.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -189,8 +189,9 @@ The default value is shown next to each .Bl -tag -width indent .It Va net.link.stf.permit_rfc1918 : No 0 The RFC3056 requires the use of globally unique 32-bit IPv4 -addresses. This sysctl variable controls the behaviour of this -requirement. When it set to not 0, +addresses. +This sysctl variable controls the behaviour of this requirement. +When it set to not 0, .Nm stf allows the use of private IPv4 addresses described in the RFC1918. This may be useful for an Intranet environment or when some mechanisms Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Wed Jun 8 07:47:21 2016 (r301588) +++ head/share/man/man4/u3g.4 Wed Jun 8 08:50:35 2016 (r301589) @@ -91,8 +91,9 @@ In some of these devices a mass storage .Xr umass 4 driver is present which contains Windows and Mac OS X drivers. The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires -additional commands to switch it to modem mode. If your device is not -switching automatically, please try to add quirks. See +additional commands to switch it to modem mode. +If your device is not switching automatically, please try to add quirks. +See .Xr usbconfig 8 and .Xr usb_quirk 4 . *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 8 09:19:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8424B6EED2; Wed, 8 Jun 2016 09:19:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C26691EBF; Wed, 8 Jun 2016 09:19:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u589JmuT044708; Wed, 8 Jun 2016 09:19:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u589JmiC044699; Wed, 8 Jun 2016 09:19:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606080919.u589JmiC044699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 09:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301590 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 09:19:50 -0000 Author: trasz Date: Wed Jun 8 09:19:47 2016 New Revision: 301590 URL: https://svnweb.freebsd.org/changeset/base/301590 Log: Fix a bunch of "sentence not on new line" warnings in section 9. MFC after: 1 month Modified: head/share/man/man9/bpf.9 head/share/man/man9/firmware.9 head/share/man/man9/lock.9 head/share/man/man9/locking.9 head/share/man/man9/sysctl.9 head/share/man/man9/timeout.9 head/share/man/man9/usbdi.9 head/share/man/man9/vn_fullpath.9 head/share/man/man9/zone.9 Modified: head/share/man/man9/bpf.9 ============================================================================== --- head/share/man/man9/bpf.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/bpf.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -256,8 +256,8 @@ Pointer to .Pq Vt "struct ifnet *" is passed as the first argument, interface .Fa dlt -follows. Last argument indicates listener is attached (1) or -detached (0). +follows. +Last argument indicates listener is attached (1) or detached (0). Note that handler is invoked with .Nm global lock held, which implies restriction on sleeping and calling Modified: head/share/man/man9/firmware.9 ============================================================================== --- head/share/man/man9/firmware.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/firmware.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -97,7 +97,8 @@ by calling the function .Fn firmware_get with the .Nm imagename -they want as an argument. If a matching image is not already registered, +they want as an argument. +If a matching image is not already registered, the firmware subsystem will try to load it using the mechanisms specified below (typically, a kernel module with @@ -127,7 +128,8 @@ pointer to the image requested. .Fn firmware_unregister tries to unregister the firmware image .Nm imagename -from the system. The function is successful and returns 0 +from the system. +The function is successful and returns 0 if there are no pending references to the image, otherwise it does not unregister the image and returns EBUSY. .Pp @@ -148,7 +150,8 @@ already mounted. On success, .Fn firmware_get returns a pointer to the image description and increases the reference count -for this image. On failure, the function returns NULL. +for this image. +On failure, the function returns NULL. .Pp .Fn firmware_put drops a reference to a firmware image. Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/lock.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -215,7 +215,8 @@ The flag allows exclusive requests to pr even if the current thread owns shared locks. This is safe since shared lock is guaranteed to not recurse, and is used when thread is known to held unrelated shared locks, to not cause -unnecessary starvation. An example is +unnecessary starvation. +An example is .Dv vp locking in VFS .Xr lookup 9 , Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/locking.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -335,7 +335,8 @@ running inside an interrupt thread. .El .Ss Interaction table The following table shows what you can and can not do while holding -one of the locking primitives discussed. Note that +one of the locking primitives discussed. +Note that .Dq sleep includes .Fn sema_wait , Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/sysctl.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -628,7 +628,8 @@ system boot. .It Dv CTLFLAG_NOFETCH In case the node is marked as a tunable using the CTLFLAG_[XX]TUN, this flag will prevent fetching the initial value from the system -environment. Typically this flag should only be used for very early +environment. +Typically this flag should only be used for very early low level system setup code, and not by common drivers and modules. .El .Pp @@ -780,7 +781,8 @@ Use positive logic instead: .Va foobar_enable . .Pp A temporary sysctl node OID that should not be relied upon must be designated -as such by a leading underscore character in its name. For example: +as such by a leading underscore character in its name. +For example: .Va _dirty_hack . .Sh SEE ALSO .Xr sysctl 3 , Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/timeout.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -268,7 +268,8 @@ then that lock must be held when this fu Note that when stopping multiple callouts that use the same lock it is possible to get multiple return's of zero and multiple calls to the .Fa drain -function, depending upon which CPU's the callouts are running. The +function, depending upon which CPU's the callouts are running. +The .Fa drain function itself is called from the context of the completing callout i.e. softclock or hardclock, just like a callout itself. @@ -813,7 +814,8 @@ and .Fn callout_drain functions return a value of one if the callout was still pending when it was called, a zero if the callout could not be stopped and a negative one is it -was either not running or haas already completed. The +was either not running or haas already completed. +The .Fn timeout function returns a .Ft struct callout_handle Modified: head/share/man/man9/usbdi.9 ============================================================================== --- head/share/man/man9/usbdi.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/usbdi.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -157,7 +157,8 @@ available. .Fa udev is a pointer to "struct usb_device". .Fa ifaces -is an array of interface index numbers to use. See "if_index". +is an array of interface index numbers to use. +See "if_index". .Fa pxfer is a pointer to an array of USB transfer pointers that are initialized to NULL, and then pointed to allocated USB transfers. @@ -171,9 +172,10 @@ is the private softc pointer, which will "xfer->priv_sc". .Fa priv_mtx is the private mutex protecting the transfer structure and the -softc. This pointer is used to initialize "xfer->priv_mtx". -This function returns -zero upon success. A non-zero return value indicates failure. +softc. +This pointer is used to initialize "xfer->priv_mtx". +This function returns zero upon success. +A non-zero return value indicates failure. . .Pp . @@ -245,8 +247,8 @@ pointer. . The USB callback has three states. . -USB_ST_SETUP, USB_ST_TRANSFERRED and USB_ST_ERROR. USB_ST_SETUP is the -initial state. +USB_ST_SETUP, USB_ST_TRANSFERRED and USB_ST_ERROR. +USB_ST_SETUP is the initial state. . After the callback has been called with this state it will always be called back at a later stage in one of the other two states. @@ -323,7 +325,8 @@ The SETUP packet is always pointed to by length is set by .Fn usbd_xfer_frame_len also if there should not be -sent any SETUP packet! If an USB control transfer has no DATA stage, +sent any SETUP packet! +If an USB control transfer has no DATA stage, then the number of frames should be set to 1. . Else the default number of frames is 2. @@ -440,10 +443,12 @@ Depending on the endpoint type, this fie "0" use the default interrupt interval based on endpoint descriptor. "Else" use the given value for polling rate. .It UE_ISOCHRONOUS -"0" use default. "Else" the value is ignored. +"0" use default. +"Else" the value is ignored. .It UE_BULK .It UE_CONTROL -"0" no transfer pre-delay. "Else" a delay as given by this field in +"0" no transfer pre-delay. +"Else" a delay as given by this field in milliseconds is inserted before the hardware is started when "usbd_transfer_submit()" is called. .Pp @@ -453,14 +458,14 @@ pre-delay has elapsed! . .Pp .Fa timeout -field, if non-zero, will set the transfer timeout in milliseconds. If -the "timeout" field is zero and the transfer type is ISOCHRONOUS a +field, if non-zero, will set the transfer timeout in milliseconds. +If the "timeout" field is zero and the transfer type is ISOCHRONOUS a timeout of 250ms will be used. . .Pp .Fa frames -field sets the maximum number of frames. If zero is specified it will -yield the following results: +field sets the maximum number of frames. +If zero is specified it will yield the following results: .Bl -tag -width "UE_INTERRUPT" .It UE_BULK xfer->nframes = 1; @@ -469,7 +474,8 @@ xfer->nframes = 1; .It UE_CONTROL xfer->nframes = 2; .It UE_ISOCHRONOUS -Not allowed. Will cause an error. +Not allowed. +Will cause an error. .El . .Pp @@ -486,26 +492,29 @@ be used when setting up the given USB tr .Pp .Fa flags field has type "struct usb_xfer_flags" and allows one to set initial -flags an USB transfer. Valid flags are: +flags an USB transfer. +Valid flags are: .Bl -tag -width "force_short_xfer" .It force_short_xfer -This flag forces the last transmitted USB packet to be short. A short -packet has a length of less than "xfer->max_packet_size", which -derives from "wMaxPacketSize". This flag can be changed during -operation. +This flag forces the last transmitted USB packet to be short. +A short packet has a length of less than "xfer->max_packet_size", which +derives from "wMaxPacketSize". +This flag can be changed during operation. .It short_xfer_ok This flag allows the received transfer length, "xfer->actlen" to be -less than "xfer->sumlen" upon completion of a transfer. This flag can -be changed during operation. +less than "xfer->sumlen" upon completion of a transfer. +This flag can be changed during operation. .It short_frames_ok -This flag allows the reception of multiple short USB frames. This flag +This flag allows the reception of multiple short USB frames. +This flag only has effect for BULK and INTERRUPT endpoints and if the number of -frames received is greater than 1. This flag can be changed during -operation. +frames received is greater than 1. +This flag can be changed during operation. .It pipe_bof This flag causes a failing USB transfer to remain first in the PIPE queue except in the case of "xfer->error" equal to -"USB_ERR_CANCELLED". No other USB transfers in the affected PIPE queue +"USB_ERR_CANCELLED". +No other USB transfers in the affected PIPE queue will be started until either: .Bl -tag -width "X" .It 1 @@ -569,8 +578,8 @@ This flag can be changed during operatio . . .It no_pipe_ok -Setting this flag causes the USB_ERR_NO_PIPE error to be ignored. This -flag can not be changed during operation. +Setting this flag causes the USB_ERR_NO_PIPE error to be ignored. +This flag can not be changed during operation. . . .It stall_pipe @@ -614,7 +623,8 @@ request structure. . .Pp .Fa callback -pointer sets the USB callback. This field is mandatory. +pointer sets the USB callback. +This field is mandatory. . . .Sh USB LINUX COMPAT LAYER @@ -635,7 +645,8 @@ module complies with the USB 2.0 standar The .Nm usb module has been inspired by the NetBSD USB stack initially written by -Lennart Augustsson. The +Lennart Augustsson. +The .Nm usb module was written by .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org . Modified: head/share/man/man9/vn_fullpath.9 ============================================================================== --- head/share/man/man9/vn_fullpath.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/vn_fullpath.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -73,7 +73,8 @@ The thread performing the call; this poi the process and its file descriptor structure, in order to identify the root vnode to use. .It Fa vp -The vnode to search for. No need to be locked by the caller. +The vnode to search for. +No need to be locked by the caller. .It Fa retbuf Pointer to a .Vt "char *" Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Wed Jun 8 08:50:35 2016 (r301589) +++ head/share/man/man9/zone.9 Wed Jun 8 09:19:47 2016 (r301590) @@ -320,8 +320,10 @@ The .Fn uma_zone_set_maxaction function sets a function that will be called when the given zone becomes full and fails to allocate an item. -The function will be called with the zone locked. Also, the function -that called the allocation function may have held additional locks. Therefore, +The function will be called with the zone locked. +Also, the function +that called the allocation function may have held additional locks. +Therefore, this function should do very little work (similar to a signal handler). .Pp The From owner-svn-src-all@freebsd.org Wed Jun 8 09:36:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0B74B6F78E; Wed, 8 Jun 2016 09:36:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73C401C94; Wed, 8 Jun 2016 09:36:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u589a8J1052046; Wed, 8 Jun 2016 09:36:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u589a7Ku052037; Wed, 8 Jun 2016 09:36:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606080936.u589a7Ku052037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 09:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301591 - in head/share/man: man3 man4/man4.arm man5 man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 09:36:09 -0000 Author: trasz Date: Wed Jun 8 09:36:07 2016 New Revision: 301591 URL: https://svnweb.freebsd.org/changeset/base/301591 Log: Last few instances of "sentence not on new line". MFC after: 1 month Modified: head/share/man/man3/tree.3 head/share/man/man4/man4.arm/cgem.4 head/share/man/man4/man4.arm/mge.4 head/share/man/man5/devfs.rules.5 head/share/man/man5/nandfs.5 head/share/man/man5/quota.user.5 head/share/man/man5/rc.conf.5 head/share/man/man8/nanobsd.8 Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man3/tree.3 Wed Jun 8 09:36:07 2016 (r301591) @@ -424,12 +424,14 @@ Individual prototypes can be declared wi .Fn RB_PROTOTYPE_PREV , and .Fn RB_PROTOTYPE_MINMAX -in case not all functions are required. The individual prototype macros expect +in case not all functions are required. +The individual prototype macros expect .Fa NAME , .Fa TYPE , and .Fa ATTR -arguments. The +arguments. +The .Fa ATTR argument must be empty for global functions or .Fa static Modified: head/share/man/man4/man4.arm/cgem.4 ============================================================================== --- head/share/man/man4/man4.arm/cgem.4 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man4/man4.arm/cgem.4 Wed Jun 8 09:36:07 2016 (r301591) @@ -278,13 +278,15 @@ When receive checksum offloading is enab with bad TCP/UDP/IP checksums. The bad packets will not be counted in any .Xr netstat 1 -statistics. There are +statistics. +There are .Xr sysctl 8 variables that count packets discarded by the hardware (see below). .Pp The GEM used in the Zynq-7000 has a bug such that the receiver can -potentially freeze up under a high load. The issue is described in sec. 16.7 +potentially freeze up under a high load. +The issue is described in sec. 16.7 "Known Issues" of the Zynq-7000 SoC Technical Reference Manual (Xilinx UG585 v1.7). The Modified: head/share/man/man4/man4.arm/mge.4 ============================================================================== --- head/share/man/man4/man4.arm/mge.4 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man4/man4.arm/mge.4 Wed Jun 8 09:36:07 2016 (r301591) @@ -90,17 +90,19 @@ The .Nm driver supports interrupts coalescing (IC) so that raising a transmit/receive frame interrupt is delayed, if possible, until a threshold-defined period of -time has elapsed. The following sysctls regulate this behaviour (separately -for each path): +time has elapsed. +The following sysctls regulate this behaviour (separately for each path): .Bl -tag -width indent .It Va dev.mge.X.int_coal.rx_time .It Va dev.mge.X.int_coal.tx_time .Pp Value of 0 disables IC on the given path, value greater than zero corresponds to a real time period and is expressed in units equivalent to 64 ticks of the -MGE clock. Maximum allowed value depends on MGE hardware revision. User -provided values larger than supported will be trimmed to the maximum -supported. More details are available in the reference manual of the device. +MGE clock. +Maximum allowed value depends on MGE hardware revision. +User provided values larger than supported will be trimmed to the maximum +supported. +More details are available in the reference manual of the device. .El .Sh HARDWARE Gigabit Ethernet controllers built into the following Marvell systems-on-chip Modified: head/share/man/man5/devfs.rules.5 ============================================================================== --- head/share/man/man5/devfs.rules.5 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man5/devfs.rules.5 Wed Jun 8 09:36:07 2016 (r301591) @@ -90,7 +90,8 @@ configuration file. .It Pa /etc/devfs.rules Local .Nm -configuration file. Rulesets in here override those in +configuration file. +Rulesets in here override those in .Pa /etc/defaults/devfs.rules with the same ruleset number, otherwise the two files are effectively merged. .El Modified: head/share/man/man5/nandfs.5 ============================================================================== --- head/share/man/man5/nandfs.5 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man5/nandfs.5 Wed Jun 8 09:36:07 2016 (r301591) @@ -109,7 +109,8 @@ partition at the specified mount point d .Xr umount_nandfs 8 .Sh HISTORY The NAND FS concepts are based on NILFS principles and initial implementation -was derived from early read-only NILFS NetBSD code. Since then the NAND FS +was derived from early read-only NILFS NetBSD code. +Since then the NAND FS code diverged significantly and is by no means compatible with NILFS. .Pp The NAND Flash file system first appeared in Modified: head/share/man/man5/quota.user.5 ============================================================================== --- head/share/man/man5/quota.user.5 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man5/quota.user.5 Wed Jun 8 09:36:07 2016 (r301591) @@ -98,7 +98,8 @@ utility will truncate the data files to to store the highest id with either non-zero file usage or non-zero quota limits. .Pp -The data record for id 0 has special meaning. If the +The data record for id 0 has special meaning. +If the .Dq Dv dqb_btime or .Dq Dv dbq_itime Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man5/rc.conf.5 Wed Jun 8 09:36:07 2016 (r301591) @@ -189,7 +189,8 @@ to this directory before running the ser Run the service under this user account. .It Ao Ar name Ac Ns Va _group .Pq Vt str -Run the chrooted service under this system group. Unlike the _user +Run the chrooted service under this system group. +Unlike the _user setting, this setting has no effect if the service is not chrooted. .It Ao Ar name Ac Ns Va _fib .Pq Vt int @@ -944,7 +945,8 @@ interface is desired, .Va pflog_instances is set to the list of .Xr pflogd 8 -instances that should be started at system boot time. If +instances that should be started at system boot time. +If .Va pflog_instances is set, for each whitespace-seperated .Ar element @@ -983,11 +985,13 @@ This variable contains additional flags program. .It Va ftpproxy_instances .Pq Vt str -Empty by default. If multiple instances of +Empty by default. +If multiple instances of .Xr ftp-proxy 8 are desired at boot time, .Va ftpproxy_instances -should contain a whitespace-seperated list of instance names. For each +should contain a whitespace-seperated list of instance names. +For each .Ar element in the list, a variable named .Ao Ar element Ac Ns Va _flags Modified: head/share/man/man8/nanobsd.8 ============================================================================== --- head/share/man/man8/nanobsd.8 Wed Jun 8 09:19:47 2016 (r301590) +++ head/share/man/man8/nanobsd.8 Wed Jun 8 09:36:07 2016 (r301591) @@ -219,7 +219,8 @@ Path to the source tree used to build th .It Va NANO_KERNEL Name of the kernel configuration file used to build the kernel. .It Va NANO_ARCH -Machine processor architecture to build. Defaults to output of +Machine processor architecture to build. +Defaults to output of .Cm uname -p . .It Va NANO_BOOT0CFG Controls the options passed to From owner-svn-src-all@freebsd.org Wed Jun 8 09:40:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26494B6F879; Wed, 8 Jun 2016 09:40:08 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D21E31ECC; Wed, 8 Jun 2016 09:40:07 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u589e7X3052251; Wed, 8 Jun 2016 09:40:07 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u589e7kn052250; Wed, 8 Jun 2016 09:40:07 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606080940.u589e7kn052250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 8 Jun 2016 09:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301592 - head/lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 09:40:08 -0000 Author: truckman Date: Wed Jun 8 09:40:06 2016 New Revision: 301592 URL: https://svnweb.freebsd.org/changeset/base/301592 Log: Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails. If the ai->ai_addrlen <= minsiz test fails, then freeaddrinfo() does not get called to free the memory just allocated by getaddrinfo(). Fix by moving ai->ai_addrlen <= minsiz to a separate nested if block, and keep freeaddrinfo() in the outer block so that freeaddrinfo() will be called whenever getaddrinfo() succeeds. Reported by: Coverity CID: 1273652 Reviewed by: ume MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6756 Modified: head/lib/libc/resolv/res_init.c Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Wed Jun 8 09:36:07 2016 (r301591) +++ head/lib/libc/resolv/res_init.c Wed Jun 8 09:40:06 2016 (r301592) @@ -411,20 +411,21 @@ __res_vinit(res_state statp, int preinit hints.ai_socktype = SOCK_DGRAM; /*dummy*/ hints.ai_flags = AI_NUMERICHOST; sprintf(sbuf, "%u", NAMESERVER_PORT); - if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 && - ai->ai_addrlen <= minsiz) { - if (statp->_u._ext.ext != NULL) { - memcpy(&statp->_u._ext.ext->nsaddrs[nserv], - ai->ai_addr, ai->ai_addrlen); + if (getaddrinfo(cp, sbuf, &hints, &ai) == 0) { + if (ai->ai_addrlen <= minsiz) { + if (statp->_u._ext.ext != NULL) { + memcpy(&statp->_u._ext.ext->nsaddrs[nserv], + ai->ai_addr, ai->ai_addrlen); + } + if (ai->ai_addrlen <= + sizeof(statp->nsaddr_list[nserv])) { + memcpy(&statp->nsaddr_list[nserv], + ai->ai_addr, ai->ai_addrlen); + } else + statp->nsaddr_list[nserv].sin_family = 0; + nserv++; } - if (ai->ai_addrlen <= - sizeof(statp->nsaddr_list[nserv])) { - memcpy(&statp->nsaddr_list[nserv], - ai->ai_addr, ai->ai_addrlen); - } else - statp->nsaddr_list[nserv].sin_family = 0; freeaddrinfo(ai); - nserv++; } } continue; From owner-svn-src-all@freebsd.org Wed Jun 8 10:03:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 835D8B6F22B; Wed, 8 Jun 2016 10:03:01 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4686F13A2; Wed, 8 Jun 2016 10:03:01 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bAaKA-000DKG-1W; Wed, 08 Jun 2016 13:02:58 +0300 Date: Wed, 8 Jun 2016 13:02:58 +0300 From: Slawa Olhovchenkov To: araujo@freebsd.org Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys Message-ID: <20160608100257.GI75625@zxy.spb.ru> References: <201606060951.u569pwOI063390@repo.freebsd.org> <20160606165431.GF75625@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 10:03:01 -0000 On Tue, Jun 07, 2016 at 09:15:31AM +0800, Marcelo Araujo wrote: > Hi, > > Because 802.1p is Layer 2 and on its specification it sets video to 4, what > DSCP does is convert those 3-bits to use on Layer 3 and try to do the CoS > as close as possible with 802.1p. > > What purpose to use 4 for video? > > > > http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus1000/sw/4_0/qos/configuration/guide/nexus1000v_qos/qos_6dscp_val.pdf > > point video is 3. I am see new design guide place video to 4. Thanks. From owner-svn-src-all@freebsd.org Wed Jun 8 10:25:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17D02B6F6A8; Wed, 8 Jun 2016 10:25:18 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA9161EA9; Wed, 8 Jun 2016 10:25:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58APGQO070428; Wed, 8 Jun 2016 10:25:16 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58APGgG070427; Wed, 8 Jun 2016 10:25:16 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606081025.u58APGgG070427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 8 Jun 2016 10:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301596 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 10:25:18 -0000 Author: truckman Date: Wed Jun 8 10:25:16 2016 New Revision: 301596 URL: https://svnweb.freebsd.org/changeset/base/301596 Log: Don't leak olinep if malloc() fails. If malloc() fails to allocate linep, then free olinep (if it exists) before returning to avoid a memory leak. Reported by: Coverity CID: 1016716 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6755 Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Wed Jun 8 10:00:43 2016 (r301595) +++ head/lib/libc/gen/getnetgrent.c Wed Jun 8 10:25:16 2016 (r301596) @@ -614,6 +614,8 @@ read_for_group(const char *group) if (linep == NULL) { free(lp->l_groupname); free(lp); + if (olen > 0) + free(olinep); return (NULL); } if (olen > 0) { From owner-svn-src-all@freebsd.org Wed Jun 8 10:26:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D14FB6F72B; Wed, 8 Jun 2016 10:26:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2931F104F; Wed, 8 Jun 2016 10:26:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58AQJ9X070520; Wed, 8 Jun 2016 10:26:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58AQHmn070504; Wed, 8 Jun 2016 10:26:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606081026.u58AQHmn070504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 10:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301597 - in head/share/man: man4 man5 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 10:26:20 -0000 Author: trasz Date: Wed Jun 8 10:26:17 2016 New Revision: 301597 URL: https://svnweb.freebsd.org/changeset/base/301597 Log: Fix some trailing whitespaces. MFC after: 1 month Modified: head/share/man/man4/bpf.4 head/share/man/man4/cmx.4 head/share/man/man4/inet.4 head/share/man/man4/ixl.4 head/share/man/man4/ixlv.4 head/share/man/man4/mpr.4 head/share/man/man4/oce.4 head/share/man/man4/qlxgbe.4 head/share/man/man4/qlxge.4 head/share/man/man4/unix.4 head/share/man/man4/usfs.4 head/share/man/man4/vale.4 head/share/man/man5/src.conf.5 head/share/man/man9/SYSCALL_MODULE.9 head/share/man/man9/counter.9 Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/bpf.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -24,7 +24,7 @@ .\" 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. -.\" +.\" .\" Copyright (c) 1990 The Regents of the University of California. .\" All rights reserved. .\" Modified: head/share/man/man4/cmx.4 ============================================================================== --- head/share/man/man4/cmx.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/cmx.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -1,7 +1,7 @@ .\" .\" Copyright (c) 2006-2007 Daniel Roethlisberger .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -11,7 +11,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" 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 Modified: head/share/man/man4/inet.4 ============================================================================== --- head/share/man/man4/inet.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/inet.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -134,7 +134,7 @@ The following .Xr ioctl 2 commands are provided for a datagram socket in the Internet domain: .Pp -.Bl -tag -width ".Dv SIOCGIFBRDADDR" -offset indent -compact +.Bl -tag -width ".Dv SIOCGIFBRDADDR" -offset indent -compact .It Dv SIOCAIFADDR Add address to an interface. The command requires Modified: head/share/man/man4/ixl.4 ============================================================================== --- head/share/man/man4/ixl.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/ixl.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -1,29 +1,29 @@ -.\" Copyright (c) 2013-2015, Intel Corporation +.\" Copyright (c) 2013-2015, Intel Corporation .\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without +.\" +.\" 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, +.\" +.\" 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 +.\" +.\" 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. Neither the name of the Intel Corporation nor the names of its -.\" contributors may be used to endorse or promote products derived from +.\" +.\" 3. Neither the name of the Intel Corporation nor the names of its +.\" contributors may be used to endorse or promote products derived from .\" this software without specific prior written permission. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" Modified: head/share/man/man4/ixlv.4 ============================================================================== --- head/share/man/man4/ixlv.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/ixlv.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -1,29 +1,29 @@ -.\" Copyright (c) 2013-2015, Intel Corporation +.\" Copyright (c) 2013-2015, Intel Corporation .\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without +.\" +.\" 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, +.\" +.\" 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 +.\" +.\" 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. Neither the name of the Intel Corporation nor the names of its -.\" contributors may be used to endorse or promote products derived from +.\" +.\" 3. Neither the name of the Intel Corporation nor the names of its +.\" contributors may be used to endorse or promote products derived from .\" this software without specific prior written permission. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" Modified: head/share/man/man4/mpr.4 ============================================================================== --- head/share/man/man4/mpr.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/mpr.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -29,7 +29,7 @@ .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGES. -.\" +.\" .\" mpr driver man page. .\" .\" Author: Ken Merry @@ -250,7 +250,7 @@ hw.mpr.X.debug_level .Pp tunable, either in .Xr loader.conf 5 -or by using +or by using .Xr sysctl 8 . These bits have the described effects: .Bd -literal -offset indent Modified: head/share/man/man4/oce.4 ============================================================================== --- head/share/man/man4/oce.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/oce.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -1,6 +1,6 @@ .\" Copyright (C) 2013 Emulex .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: .\" Modified: head/share/man/man4/qlxgbe.4 ============================================================================== --- head/share/man/man4/qlxgbe.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/qlxgbe.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2013 Qlogic Corportaion +.\" Copyright (c) 2013 Qlogic Corportaion .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/share/man/man4/qlxge.4 ============================================================================== --- head/share/man/man4/qlxge.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/qlxge.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2013-2014 Qlogic Corporation +.\" Copyright (c) 2013-2014 Qlogic Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/unix.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -241,7 +241,7 @@ These will arrive in the form of a fille structure, defined in .In sys/ucred.h as follows: -.Bd -literal +.Bd -literal struct xucred { u_int cr_version; /* structure layout version */ uid_t cr_uid; /* effective user id */ Modified: head/share/man/man4/usfs.4 ============================================================================== --- head/share/man/man4/usfs.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/usfs.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -22,7 +22,7 @@ .\" 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 June 8, 2016 Modified: head/share/man/man4/vale.4 ============================================================================== --- head/share/man/man4/vale.4 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man4/vale.4 Wed Jun 8 10:26:17 2016 (r301597) @@ -21,7 +21,7 @@ .\" 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. -.\" +.\" .\" This document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man5/src.conf.5 Wed Jun 8 10:26:17 2016 (r301597) @@ -486,7 +486,7 @@ Makefile.depend files found in each dire .Pp The build can be started from anywhere, and behaves the same. The initial instance of -.Xr make 1 +.Xr make 1 recursively reads .Va DIRDEPS from Makefile.depend Modified: head/share/man/man9/SYSCALL_MODULE.9 ============================================================================== --- head/share/man/man9/SYSCALL_MODULE.9 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man9/SYSCALL_MODULE.9 Wed Jun 8 10:26:17 2016 (r301597) @@ -84,7 +84,7 @@ and library functions in libc. The MACRO .Fn SYSCALL_MODULE_HELPER -includes +includes .Fn SYSCALL_MODULE and much of its boilerplate code. .Sh EXAMPLES Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Wed Jun 8 10:25:16 2016 (r301596) +++ head/share/man/man9/counter.9 Wed Jun 8 10:26:17 2016 (r301597) @@ -154,7 +154,7 @@ A read of the oid returns value obtained Any write to the oid zeroes it. .It Fn SYSCTL_COUNTER_U64_ARRAY parent nbr name access ptr len descr Declare a static -.Xr sysctl +.Xr sysctl oid that would represent an array of .Nm . The @@ -172,7 +172,7 @@ Any write to the oid zeroes all array el .It Fn SYSCTL_ADD_COUNTER_U64_ARRAY ctx parent nbr name access ptr len descr Create a .Xr sysctl -oid that would represent an array of +oid that would represent an array of .Nm . The .Fa ptr @@ -181,9 +181,9 @@ argument should be a pointer to allocate The .Fa len argument should specify number of elements in the array. -A read of the oid returns len-sized array of -.Vt uint64_t -values obtained through +A read of the oid returns len-sized array of +.Vt uint64_t +values obtained through .Fn counter_u64_fetch . Any write to the oid zeroes all array elements. .El From owner-svn-src-all@freebsd.org Wed Jun 8 10:38:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32559B6F964; Wed, 8 Jun 2016 10:38:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09C4E1691; Wed, 8 Jun 2016 10:38:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Ac1wO074149; Wed, 8 Jun 2016 10:38:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Ac09G074144; Wed, 8 Jun 2016 10:38:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606081038.u58Ac09G074144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 Jun 2016 10:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301598 - in head/share/man: man4 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 10:38:02 -0000 Author: trasz Date: Wed Jun 8 10:38:00 2016 New Revision: 301598 URL: https://svnweb.freebsd.org/changeset/base/301598 Log: Fix typos. MFC after: 1 month Modified: head/share/man/man4/iicbus.4 head/share/man/man4/pf.4 head/share/man/man4/psm.4 head/share/man/man9/EVENTHANDLER.9 head/share/man/man9/kqueue.9 Modified: head/share/man/man4/iicbus.4 ============================================================================== --- head/share/man/man4/iicbus.4 Wed Jun 8 10:26:17 2016 (r301597) +++ head/share/man/man4/iicbus.4 Wed Jun 8 10:38:00 2016 (r301598) @@ -122,7 +122,7 @@ Flattened Device Tree (FDT) data, tunabl or at runtime using .Xr sysctl 8 . When configuration is supplied using more than one method, FDT and -hint data will be overridden by a tunable, which can be overriden by +hint data will be overridden by a tunable, which can be overridden by .Xr sysctl 8 . .Ss Device Hints Set Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Wed Jun 8 10:26:17 2016 (r301597) +++ head/share/man/man4/pf.4 Wed Jun 8 10:38:00 2016 (r301598) @@ -1077,7 +1077,7 @@ struct pfi_kif { }; .Ed .It Dv DIOCSETIFFLAG Fa "struct pfioc_iface *io" -Set the user setable flags (described above) of the +Set the user settable flags (described above) of the .Nm internal interface description. The filtering process is the same as for Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Wed Jun 8 10:26:17 2016 (r301597) +++ head/share/man/man4/psm.4 Wed Jun 8 10:38:00 2016 (r301598) @@ -471,7 +471,7 @@ typedef struct synapticshw { int capPalmDetect; /* can detect a palm */ int capPassthrough; /* can passthrough guest packets */ int capMiddle; /* has a physical middle button */ - int nExtendedButtons; /* has N additionnal buttons */ + int nExtendedButtons; /* has N additional buttons */ int nExtendedQueries; /* supports N extended queries */ } synapticshw_t; .Ed Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Wed Jun 8 10:26:17 2016 (r301597) +++ head/share/man/man9/EVENTHANDLER.9 Wed Jun 8 10:38:00 2016 (r301598) @@ -197,11 +197,11 @@ Callbacks invoked on error of applicatio .It Vt bpf_track Callbacks invoked when a BPF listener attaches to/detaches from network interface. .It Vt cpufreq_levels_changed -Callback invoked when cpu frequence levels have changed. +Callback invoked when cpu frequency levels have changed. .It Vt cpufreq_post_change -Callback invoked after cpu frequence has changed. +Callback invoked after cpu frequency has changed. .It Vt cpufreq_pre_change -Callback invoked before cpu frequence has changed +Callback invoked before cpu frequency has changed. .It Vt dcons_poll Callback invoked to poll for dcons changes. .It Vt dev_clone Modified: head/share/man/man9/kqueue.9 ============================================================================== --- head/share/man/man9/kqueue.9 Wed Jun 8 10:26:17 2016 (r301597) +++ head/share/man/man9/kqueue.9 Wed Jun 8 10:38:00 2016 (r301598) @@ -345,12 +345,12 @@ will have .Dv EV_ONESHOT set so that the .Vt knote -will be returned and removed durning the next scan. +will be returned and removed during the next scan. The .Va f_detach function will be called when the .Vt knote -is deleted durning the next scan. +is deleted during the next scan. This function must not be used when .Va f_isfd is set in From owner-svn-src-all@freebsd.org Wed Jun 8 11:47:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFD39B6FC07; Wed, 8 Jun 2016 11:47:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAC081F5F; Wed, 8 Jun 2016 11:47:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58BlKrg099467; Wed, 8 Jun 2016 11:47:20 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58BlJ8X099462; Wed, 8 Jun 2016 11:47:19 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606081147.u58BlJ8X099462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 8 Jun 2016 11:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 11:47:21 -0000 Author: des Date: Wed Jun 8 11:47:19 2016 New Revision: 301602 URL: https://svnweb.freebsd.org/changeset/base/301602 Log: Replace _pam_verbose_error() with a macro. This was the last difference between our libpam and stock OpenPAM, meaning that it is now possible to replace the base libpam with a hypothetical ports version of OpenPAM. Deleted: head/lib/libpam/libpam/pam_debug_log.c Modified: head/ObsoleteFiles.inc head/lib/libpam/Makefile.inc head/lib/libpam/libpam/Makefile head/lib/libpam/libpam/security/pam_mod_misc.h head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jun 8 11:24:01 2016 (r301601) +++ head/ObsoleteFiles.inc Wed Jun 8 11:47:19 2016 (r301602) @@ -38,6 +38,57 @@ # xargs -n1 | sort | uniq -d; # done +# 20160608: removed pam_verbose_error +OLD_LIBS+=usr/lib/libpam.so.5 +OLD_LIBS+=usr/lib/pam_chroot.so.5 +OLD_LIBS+=usr/lib/pam_deny.so.5 +OLD_LIBS+=usr/lib/pam_echo.so.5 +OLD_LIBS+=usr/lib/pam_exec.so.5 +OLD_LIBS+=usr/lib/pam_ftpusers.so.5 +OLD_LIBS+=usr/lib/pam_group.so.5 +OLD_LIBS+=usr/lib/pam_guest.so.5 +OLD_LIBS+=usr/lib/pam_krb5.so.5 +OLD_LIBS+=usr/lib/pam_ksu.so.5 +OLD_LIBS+=usr/lib/pam_lastlog.so.5 +OLD_LIBS+=usr/lib/pam_login_access.so.5 +OLD_LIBS+=usr/lib/pam_nologin.so.5 +OLD_LIBS+=usr/lib/pam_opie.so.5 +OLD_LIBS+=usr/lib/pam_opieaccess.so.5 +OLD_LIBS+=usr/lib/pam_passwdqc.so.5 +OLD_LIBS+=usr/lib/pam_permit.so.5 +OLD_LIBS+=usr/lib/pam_radius.so.5 +OLD_LIBS+=usr/lib/pam_rhosts.so.5 +OLD_LIBS+=usr/lib/pam_rootok.so.5 +OLD_LIBS+=usr/lib/pam_securetty.so.5 +OLD_LIBS+=usr/lib/pam_self.so.5 +OLD_LIBS+=usr/lib/pam_ssh.so.5 +OLD_LIBS+=usr/lib/pam_tacplus.so.5 +OLD_LIBS+=usr/lib/pam_unix.so.5 +OLD_LIBS+=usr/lib32/libpam.so.5 +OLD_LIBS+=usr/lib32/pam_chroot.so.5 +OLD_LIBS+=usr/lib32/pam_deny.so.5 +OLD_LIBS+=usr/lib32/pam_echo.so.5 +OLD_LIBS+=usr/lib32/pam_exec.so.5 +OLD_LIBS+=usr/lib32/pam_ftpusers.so.5 +OLD_LIBS+=usr/lib32/pam_group.so.5 +OLD_LIBS+=usr/lib32/pam_guest.so.5 +OLD_LIBS+=usr/lib32/pam_krb5.so.5 +OLD_LIBS+=usr/lib32/pam_ksu.so.5 +OLD_LIBS+=usr/lib32/pam_lastlog.so.5 +OLD_LIBS+=usr/lib32/pam_login_access.so.5 +OLD_LIBS+=usr/lib32/pam_nologin.so.5 +OLD_LIBS+=usr/lib32/pam_opie.so.5 +OLD_LIBS+=usr/lib32/pam_opieaccess.so.5 +OLD_LIBS+=usr/lib32/pam_passwdqc.so.5 +OLD_LIBS+=usr/lib32/pam_permit.so.5 +OLD_LIBS+=usr/lib32/pam_radius.so.5 +OLD_LIBS+=usr/lib32/pam_rhosts.so.5 +OLD_LIBS+=usr/lib32/pam_rootok.so.5 +OLD_LIBS+=usr/lib32/pam_securetty.so.5 +OLD_LIBS+=usr/lib32/pam_self.so.5 +OLD_LIBS+=usr/lib32/pam_ssh.so.5 +OLD_LIBS+=usr/lib32/pam_tacplus.so.5 +OLD_LIBS+=usr/lib32/pam_unix.so.5 # 20160523: remove extranous ALTQ files OLD_FILES+=usr/include/altq/altq_codel.h OLD_FILES+=usr/include/altq/altq_fairq.h Modified: head/lib/libpam/Makefile.inc ============================================================================== --- head/lib/libpam/Makefile.inc Wed Jun 8 11:24:01 2016 (r301601) +++ head/lib/libpam/Makefile.inc Wed Jun 8 11:47:19 2016 (r301602) @@ -26,7 +26,7 @@ CFLAGS+= -DOPENPAM_DEBUG -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 6 STATIC_CFLAGS+= -DOPENPAM_STATIC_MODULES Modified: head/lib/libpam/libpam/Makefile ============================================================================== --- head/lib/libpam/libpam/Makefile Wed Jun 8 11:24:01 2016 (r301601) +++ head/lib/libpam/libpam/Makefile Wed Jun 8 11:47:19 2016 (r301602) @@ -100,8 +100,6 @@ SRCS= openpam_asprintf.c \ pam_verror.c \ pam_vinfo.c \ pam_vprompt.c -# Local additions -SRCS+= pam_debug_log.c MAN?= openpam.3 \ openpam_borrow_cred.3 \ Modified: head/lib/libpam/libpam/security/pam_mod_misc.h ============================================================================== --- head/lib/libpam/libpam/security/pam_mod_misc.h Wed Jun 8 11:24:01 2016 (r301601) +++ head/lib/libpam/libpam/security/pam_mod_misc.h Wed Jun 8 11:47:19 2016 (r301602) @@ -39,18 +39,17 @@ #define PAM_OPT_ECHO_PASS "echo_pass" #define PAM_OPT_DEBUG "debug" -__BEGIN_DECLS -void _pam_verbose_error(pam_handle_t *, int, const char *, - const char *, const char *, ...); -__END_DECLS - -#define PAM_LOG(...) \ +#define PAM_LOG(...) \ openpam_log(PAM_LOG_DEBUG, __VA_ARGS__) -#define PAM_RETURN(arg) \ +#define PAM_RETURN(arg) \ return (arg) -#define PAM_VERBOSE_ERROR(...) \ - _pam_verbose_error(pamh, flags, __FILE__, __func__, __VA_ARGS__) +#define PAM_VERBOSE_ERROR(...) \ + do { \ + if (!(flags & PAM_SILENT) && \ + !openpam_get_option(pamh, "no_warn")) \ + pam_error(pamh, __VA_ARGS__); \ + } while (0); #endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 11:24:01 2016 (r301601) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 11:47:19 2016 (r301602) @@ -3209,9 +3209,9 @@ OLD_FILES+=usr/lib/libwind.so OLD_LIBS+=usr/lib/libwind.so.11 OLD_FILES+=usr/lib/libwind_p.a OLD_FILES+=usr/lib/pam_krb5.so -OLD_LIBS+=usr/lib/pam_krb5.so.5 +OLD_LIBS+=usr/lib/pam_krb5.so.6 OLD_FILES+=usr/lib/pam_ksu.so -OLD_LIBS+=usr/lib/pam_ksu.so.5 +OLD_LIBS+=usr/lib/pam_ksu.so.6 OLD_FILES+=usr/lib/private/libheimipcc.a OLD_FILES+=usr/lib/private/libheimipcc.so OLD_LIBS+=usr/lib/private/libheimipcc.so.11 @@ -3286,9 +3286,9 @@ OLD_FILES+=usr/lib32/libwind.so OLD_LIBS+=usr/lib32/libwind.so.11 OLD_FILES+=usr/lib32/libwind_p.a OLD_FILES+=usr/lib32/pam_krb5.so -OLD_LIBS+=usr/lib32/pam_krb5.so.5 +OLD_LIBS+=usr/lib32/pam_krb5.so.6 OLD_FILES+=usr/lib32/pam_ksu.so -OLD_LIBS+=usr/lib32/pam_ksu.so.5 +OLD_LIBS+=usr/lib32/pam_ksu.so.6 OLD_FILES+=usr/lib32/private/libheimipcc.a OLD_FILES+=usr/lib32/private/libheimipcc.so OLD_LIBS+=usr/lib32/private/libheimipcc.so.11 @@ -6397,14 +6397,14 @@ OLD_FILES+=usr/bin/ssh-copy-id OLD_FILES+=usr/bin/ssh-keygen OLD_FILES+=usr/bin/ssh-keyscan OLD_FILES+=usr/lib/pam_ssh.so -OLD_LIBS+=usr/lib/pam_ssh.so.5 +OLD_LIBS+=usr/lib/pam_ssh.so.6 OLD_FILES+=usr/lib/private/libssh.a OLD_FILES+=usr/lib/private/libssh.so OLD_LIBS+=usr/lib/private/libssh.so.5 OLD_FILES+=usr/lib/private/libssh_p.a .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/pam_ssh.so -OLD_LIBS+=usr/lib32/pam_ssh.so.5 +OLD_LIBS+=usr/lib32/pam_ssh.so.6 OLD_FILES+=usr/lib32/private/libssh.a OLD_FILES+=usr/lib32/private/libssh.so OLD_LIBS+=usr/lib32/private/libssh.so.5 From owner-svn-src-all@freebsd.org Wed Jun 8 11:58:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6620B6FDD3; Wed, 8 Jun 2016 11:58:04 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3E551665; Wed, 8 Jun 2016 11:58:04 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Bw3RB003470; Wed, 8 Jun 2016 11:58:03 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Bw3AL003469; Wed, 8 Jun 2016 11:58:03 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201606081158.u58Bw3AL003469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Wed, 8 Jun 2016 11:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301603 - head/contrib/blacklist/bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 11:58:05 -0000 Author: garga (ports committer) Date: Wed Jun 8 11:58:03 2016 New Revision: 301603 URL: https://svnweb.freebsd.org/changeset/base/301603 Log: Move misplaced break statement to right place Reported by: Coverity CID: 1304340 Reviewed by: lidl Differential Revision: https://reviews.freebsd.org/D6749 Sponsored by: Rubicon Communications (Netgate) Modified: head/contrib/blacklist/bin/blacklistctl.c Modified: head/contrib/blacklist/bin/blacklistctl.c ============================================================================== --- head/contrib/blacklist/bin/blacklistctl.c Wed Jun 8 11:47:19 2016 (r301602) +++ head/contrib/blacklist/bin/blacklistctl.c Wed Jun 8 11:58:03 2016 (r301603) @@ -96,10 +96,10 @@ main(int argc, char *argv[]) break; case 'b': blocked = 1; + break; case 'D': dbname = optarg; break; - break; case 'd': debug++; break; From owner-svn-src-all@freebsd.org Wed Jun 8 12:40:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2491B6E166; Wed, 8 Jun 2016 12:40:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AABF51D19; Wed, 8 Jun 2016 12:40:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58CeLoh017733; Wed, 8 Jun 2016 12:40:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58CeLPJ017732; Wed, 8 Jun 2016 12:40:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606081240.u58CeLPJ017732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 8 Jun 2016 12:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301604 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 12:40:23 -0000 Author: arybchik Date: Wed Jun 8 12:40:21 2016 New Revision: 301604 URL: https://svnweb.freebsd.org/changeset/base/301604 Log: sfxge(4): cleanup: add missing probes to ef10_nvram_segment_write_tlv Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Wed Jun 8 11:58:03 2016 (r301603) +++ head/sys/dev/sfxge/common/ef10_nvram.c Wed Jun 8 12:40:21 2016 (r301604) @@ -1658,7 +1658,7 @@ ef10_nvram_partn_write_tlv( * Read a segment from nvram at the given offset into a buffer (segment_data) * and optionally write a new tag to it. */ - static __checkReturn efx_rc_t +static __checkReturn efx_rc_t ef10_nvram_segment_write_tlv( __in efx_nic_t *enp, __in uint32_t partn, @@ -1684,20 +1684,25 @@ ef10_nvram_segment_write_tlv( */ status = ef10_nvram_read_tlv_segment(enp, partn, *partn_offsetp, *seg_datap, *src_remain_lenp); - if (status != 0) - return (EINVAL); + if (status != 0) { + rc = EINVAL; + goto fail1; + } status = ef10_nvram_buf_segment_size(*seg_datap, *src_remain_lenp, &original_segment_size); - if (status != 0) - return (EINVAL); + if (status != 0) { + rc = EINVAL; + goto fail2; + } if (write) { /* Update the contents of the segment in the buffer */ if ((rc = ef10_nvram_buf_write_tlv(*seg_datap, *dest_remain_lenp, tag, data, size, - &modified_segment_size)) != 0) - goto fail1; + &modified_segment_size)) != 0) { + goto fail3; + } *dest_remain_lenp -= modified_segment_size; *seg_datap += modified_segment_size; } else { @@ -1714,6 +1719,10 @@ ef10_nvram_segment_write_tlv( return (0); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-all@freebsd.org Wed Jun 8 12:45:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8CEFB6E413; Wed, 8 Jun 2016 12:45:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A63E5128B; Wed, 8 Jun 2016 12:45:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58CjMMD021631; Wed, 8 Jun 2016 12:45:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58CjMPh021630; Wed, 8 Jun 2016 12:45:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081245.u58CjMPh021630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 12:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301605 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 12:45:24 -0000 Author: ngie Date: Wed Jun 8 12:45:22 2016 New Revision: 301605 URL: https://svnweb.freebsd.org/changeset/base/301605 Log: Bounds check rpcbs_rmtcall(..) to ensure rtype is less than RPCBVERS_STAT Not returning if rtype == RPCBVERS_STAT will cause us to overrun the inf array, as it's defined to be exactly RPCBVERS_STAT elements in rpcb_prot.x: > include/rpc/rpcb_prot.x:typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; The proposed change also matches the rest of the rtype upper bound checks in the file, so the original change was likely a typo. MFC after: 2 weeks Reported by: Coverity CID: 1007567 Reviewed by: truckman Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/rpcb_stat.c Modified: head/usr.sbin/rpcbind/rpcb_stat.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_stat.c Wed Jun 8 12:40:21 2016 (r301604) +++ head/usr.sbin/rpcbind/rpcb_stat.c Wed Jun 8 12:45:22 2016 (r301605) @@ -151,7 +151,7 @@ rpcbs_rmtcall(rpcvers_t rtype, rpcproc_t rpcbs_rmtcalllist *rl; struct netconfig *nconf; - if (rtype > RPCBVERS_STAT) + if (rtype >= RPCBVERS_STAT) return; for (rl = inf[rtype].rmtinfo; rl; rl = rl->next) { From owner-svn-src-all@freebsd.org Wed Jun 8 12:46:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC1CB6E51B; Wed, 8 Jun 2016 12:46:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 908C014B0; Wed, 8 Jun 2016 12:46:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58CksM4021729; Wed, 8 Jun 2016 12:46:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58CksT2021728; Wed, 8 Jun 2016 12:46:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606081246.u58CksT2021728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Jun 2016 12:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301606 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 12:46:56 -0000 Author: bdrewery Date: Wed Jun 8 12:46:54 2016 New Revision: 301606 URL: https://svnweb.freebsd.org/changeset/base/301606 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jun 8 12:45:22 2016 (r301605) +++ head/share/man/man5/src.conf.5 Wed Jun 8 12:46:54 2016 (r301606) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd June 5, 2016 +.Dd June 8, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -190,6 +190,24 @@ as part of the bootstrap process. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +.It Va WITHOUT_BLACKLIST +.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 301554 2016-06-07 16:35:55Z lidl +Set this if you do not want to build blacklistd / blacklistctl. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_BLACKLIST_SUPPORT +.El +.It Va WITHOUT_BLACKLIST_SUPPORT +.\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT 301554 2016-06-07 16:35:55Z lidl +Set to build some programs without blacklistd support, like +.Xr fingerd 8 , +.Xr ftpd 8 , +.Xr rlogind 8 , +.Xr rshd 8 , +and +.Xr sshd 8 . .It Va WITHOUT_BLUETOOTH .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. @@ -486,7 +504,7 @@ Makefile.depend files found in each dire .Pp The build can be started from anywhere, and behaves the same. The initial instance of -.Xr make 1 +.Xr make 1 recursively reads .Va DIRDEPS from Makefile.depend From owner-svn-src-all@freebsd.org Wed Jun 8 13:14:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C46B6B6F175; Wed, 8 Jun 2016 13:14:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91FDE1AB3; Wed, 8 Jun 2016 13:14:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DEqDO032409; Wed, 8 Jun 2016 13:14:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DEqIm032408; Wed, 8 Jun 2016 13:14:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606081314.u58DEqIm032408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 8 Jun 2016 13:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301607 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:14:53 -0000 Author: arybchik Date: Wed Jun 8 13:14:52 2016 New Revision: 301607 URL: https://svnweb.freebsd.org/changeset/base/301607 Log: sfxge(4): host byte order is required for IP ID in TSO descriptors Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Wed Jun 8 12:46:54 2016 (r301606) +++ head/sys/dev/sfxge/sfxge_tx.c Wed Jun 8 13:14:52 2016 (r301607) @@ -992,7 +992,7 @@ static void tso_start(struct sfxge_txq * tso->protocol = TSO_MBUF_PROTO(mbuf); tso->nh_off = mbuf->m_pkthdr.l2hlen; tso->tcph_off = mbuf->m_pkthdr.l3hlen; - tso->packet_id = TSO_MBUF_PACKETID(mbuf); + tso->packet_id = ntohs(TSO_MBUF_PACKETID(mbuf)); #endif #if !SFXGE_TX_PARSE_EARLY @@ -1001,7 +1001,7 @@ static void tso_start(struct sfxge_txq * KASSERT(tso_iph(tso)->ip_p == IPPROTO_TCP, ("TSO required on non-TCP packet")); tso->tcph_off = tso->nh_off + 4 * tso_iph(tso)->ip_hl; - tso->packet_id = tso_iph(tso)->ip_id; + tso->packet_id = ntohs(tso_iph(tso)->ip_id); } else { KASSERT(tso->protocol == htons(ETHERTYPE_IPV6), ("TSO required on non-IP packet")); From owner-svn-src-all@freebsd.org Wed Jun 8 13:21:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5995B6F283; Wed, 8 Jun 2016 13:21:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B78451D7F; Wed, 8 Jun 2016 13:21:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DLHv6032726; Wed, 8 Jun 2016 13:21:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DLHA4032725; Wed, 8 Jun 2016 13:21:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081321.u58DLHA4032725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301608 - stable/10/sys/cddl/boot/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:21:19 -0000 Author: ngie Date: Wed Jun 8 13:21:17 2016 New Revision: 301608 URL: https://svnweb.freebsd.org/changeset/base/301608 Log: MFC r299657: Include arpa/inet.h to get the htonl(3) definition Modified: stable/10/sys/cddl/boot/zfs/lz4.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/boot/zfs/lz4.c ============================================================================== --- stable/10/sys/cddl/boot/zfs/lz4.c Wed Jun 8 13:14:52 2016 (r301607) +++ stable/10/sys/cddl/boot/zfs/lz4.c Wed Jun 8 13:21:17 2016 (r301608) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include + static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); From owner-svn-src-all@freebsd.org Wed Jun 8 13:22:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AA17B6F39A; Wed, 8 Jun 2016 13:22:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E00B4109D; Wed, 8 Jun 2016 13:22:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DMQBm035556; Wed, 8 Jun 2016 13:22:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DMQ3P035555; Wed, 8 Jun 2016 13:22:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081322.u58DMQ3P035555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301609 - stable/9/sys/cddl/boot/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:22:27 -0000 Author: ngie Date: Wed Jun 8 13:22:25 2016 New Revision: 301609 URL: https://svnweb.freebsd.org/changeset/base/301609 Log: MFstable/10 r301608: MFC r299657: Include arpa/inet.h to get the htonl(3) definition Modified: stable/9/sys/cddl/boot/zfs/lz4.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/boot/zfs/lz4.c ============================================================================== --- stable/9/sys/cddl/boot/zfs/lz4.c Wed Jun 8 13:21:17 2016 (r301608) +++ stable/9/sys/cddl/boot/zfs/lz4.c Wed Jun 8 13:22:25 2016 (r301609) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include + static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); From owner-svn-src-all@freebsd.org Wed Jun 8 13:24:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061C7B6F430; Wed, 8 Jun 2016 13:24:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB541125E; Wed, 8 Jun 2016 13:24:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DOhnE036300; Wed, 8 Jun 2016 13:24:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DOhHc036299; Wed, 8 Jun 2016 13:24:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081324.u58DOhHc036299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301610 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:24:44 -0000 Author: ngie Date: Wed Jun 8 13:24:42 2016 New Revision: 301610 URL: https://svnweb.freebsd.org/changeset/base/301610 Log: MFC r299833: Fix fully canonicalized example for `myvariable.27...` `6` doesn't occur in the OID; it was spurious Bump .Dd for the change Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 13:22:25 2016 (r301609) +++ stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 13:24:42 2016 (r301610) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd September 9, 2010 +.Dd May 10, 2016 .Dt BSNMPD 1 .Os .Sh NAME @@ -227,7 +227,7 @@ myvariable.27.foooll.[localhost]."&^!" .Pp results in the oid .Bd -unfilled -offset indent -myvariable.27.6.102.111.111.111.108.108.127.0.0.1.38.94.33 +myvariable.27.102.111.111.111.108.108.127.0.0.1.38.94.33 .Ed .Pp The value of the assignment may be either empty, a string or a number. From owner-svn-src-all@freebsd.org Wed Jun 8 13:25:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78104B6F49B; Wed, 8 Jun 2016 13:25:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48E7913C0; Wed, 8 Jun 2016 13:25:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DPFk4036396; Wed, 8 Jun 2016 13:25:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DPFEw036395; Wed, 8 Jun 2016 13:25:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081325.u58DPFEw036395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301611 - stable/9/contrib/bsnmp/snmpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:25:16 -0000 Author: ngie Date: Wed Jun 8 13:25:15 2016 New Revision: 301611 URL: https://svnweb.freebsd.org/changeset/base/301611 Log: MFstable/10 r301610: MFC r299833: Fix fully canonicalized example for `myvariable.27...` `6` doesn't occur in the OID; it was spurious Bump .Dd for the change Modified: stable/9/contrib/bsnmp/snmpd/bsnmpd.1 Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/9/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 13:24:42 2016 (r301610) +++ stable/9/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 13:25:15 2016 (r301611) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd September 9, 2010 +.Dd May 10, 2016 .Dt BSNMPD 1 .Os .Sh NAME @@ -227,7 +227,7 @@ myvariable.27.foooll.[localhost]."&^!" .Pp results in the oid .Bd -unfilled -offset indent -myvariable.27.6.102.111.111.111.108.108.127.0.0.1.38.94.33 +myvariable.27.102.111.111.111.108.108.127.0.0.1.38.94.33 .Ed .Pp The value of the assignment may be either empty, a string or a number. From owner-svn-src-all@freebsd.org Wed Jun 8 13:32:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E63B6F838; Wed, 8 Jun 2016 13:32:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A4A31AC5; Wed, 8 Jun 2016 13:32:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DW1nR039937; Wed, 8 Jun 2016 13:32:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DW0C3039930; Wed, 8 Jun 2016 13:32:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081332.u58DW0C3039930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301612 - in stable/10: etc/rc.d tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:32:03 -0000 Author: ngie Date: Wed Jun 8 13:32:00 2016 New Revision: 301612 URL: https://svnweb.freebsd.org/changeset/base/301612 Log: MFC r299839,r299840,r299841: r299839: Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol Make zfs and zvol come before all of the items that depended on them previously r299840: Conditionalize etc/rc.d/{zfs,zvol} install on MK_ZFS != no r299841: Remove etc/rc.d/{zfs,zvol} if MK_ZFS != no Modified: stable/10/etc/rc.d/FILESYSTEMS stable/10/etc/rc.d/Makefile stable/10/etc/rc.d/dumpon stable/10/etc/rc.d/var stable/10/etc/rc.d/zfs stable/10/etc/rc.d/zvol stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/FILESYSTEMS ============================================================================== --- stable/10/etc/rc.d/FILESYSTEMS Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/FILESYSTEMS Wed Jun 8 13:32:00 2016 (r301612) @@ -4,7 +4,7 @@ # # PROVIDE: FILESYSTEMS -# REQUIRE: root mountcritlocal cleanvar zfs +# REQUIRE: root mountcritlocal cleanvar # This is a dummy dependency, for services which require file systems # to be mounted before starting. It also serves as the default early / Modified: stable/10/etc/rc.d/Makefile ============================================================================== --- stable/10/etc/rc.d/Makefile Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/Makefile Wed Jun 8 13:32:00 2016 (r301612) @@ -134,8 +134,6 @@ FILES= DAEMON \ ypset \ ypupdated \ ypxfrd \ - zfs \ - zvol .if ${MK_ACCT} != "no" FILES+= accounting @@ -283,6 +281,11 @@ FILES+= hostapd FILES+= wpa_supplicant .endif +.if ${MK_ZFS} != "no" +FILES+= zfs +FILES+= zvol +.endif + FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} Modified: stable/10/etc/rc.d/dumpon ============================================================================== --- stable/10/etc/rc.d/dumpon Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/dumpon Wed Jun 8 13:32:00 2016 (r301612) @@ -4,7 +4,6 @@ # # PROVIDE: dumpon -# REQUIRE: zvol # BEFORE: disks # KEYWORD: nojail Modified: stable/10/etc/rc.d/var ============================================================================== --- stable/10/etc/rc.d/var Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/var Wed Jun 8 13:32:00 2016 (r301612) @@ -28,7 +28,7 @@ # # PROVIDE: var -# REQUIRE: mountcritlocal zfs +# REQUIRE: mountcritlocal # NFS /var is not supported, unless NFS /var is part of diskless NFS / Modified: stable/10/etc/rc.d/zfs ============================================================================== --- stable/10/etc/rc.d/zfs Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/zfs Wed Jun 8 13:32:00 2016 (r301612) @@ -5,6 +5,7 @@ # PROVIDE: zfs # REQUIRE: mountcritlocal +# BEFORE: FILESYSTEMS var . /etc/rc.subr Modified: stable/10/etc/rc.d/zvol ============================================================================== --- stable/10/etc/rc.d/zvol Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/etc/rc.d/zvol Wed Jun 8 13:32:00 2016 (r301612) @@ -5,6 +5,7 @@ # PROVIDE: zvol # REQUIRE: hostid +# BEFORE: dumpon # KEYWORD: nojail . /etc/rc.subr Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 13:25:15 2016 (r301611) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 13:32:00 2016 (r301612) @@ -650,6 +650,8 @@ OLD_DIRS+=usr/share/dtrace OLD_FILES+=boot/gptzfsboot OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader +OLD_FILES+=etc/rc.d/zfs +OLD_FILES+=etc/rc.d/zvol OLD_FILES+=etc/devd/zfs.conf OLD_FILES+=etc/periodic/daily/404.status-zfs OLD_FILES+=etc/periodic/daily/800.scrub-zfs From owner-svn-src-all@freebsd.org Wed Jun 8 13:34:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9A5B6F947; Wed, 8 Jun 2016 13:34:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24B901DD1; Wed, 8 Jun 2016 13:34:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DYr5a040105; Wed, 8 Jun 2016 13:34:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DYr2q040103; Wed, 8 Jun 2016 13:34:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081334.u58DYr2q040103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301613 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:34:54 -0000 Author: ngie Date: Wed Jun 8 13:34:52 2016 New Revision: 301613 URL: https://svnweb.freebsd.org/changeset/base/301613 Log: MFC r299843: Fix broken dependency with routed when MK_ROUTED != no Remove routed as a requirement in NETWORKING, and put it in routed as a BEFORE requirement instead Modified: stable/10/etc/rc.d/NETWORKING stable/10/etc/rc.d/routed Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/NETWORKING ============================================================================== --- stable/10/etc/rc.d/NETWORKING Wed Jun 8 13:32:00 2016 (r301612) +++ stable/10/etc/rc.d/NETWORKING Wed Jun 8 13:34:52 2016 (r301613) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netwait netoptions routing ppp ipfw stf faith -# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge +# REQUIRE: defaultroute mrouted route6d mroute6d resolv bridge # REQUIRE: static_arp static_ndp # This is a dummy dependency, for services which require networking Modified: stable/10/etc/rc.d/routed ============================================================================== --- stable/10/etc/rc.d/routed Wed Jun 8 13:32:00 2016 (r301612) +++ stable/10/etc/rc.d/routed Wed Jun 8 13:34:52 2016 (r301613) @@ -5,6 +5,7 @@ # PROVIDE: routed # REQUIRE: netif routing +# BEFORE: NETWORK # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@freebsd.org Wed Jun 8 13:37:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 886BAB6FA30; Wed, 8 Jun 2016 13:37:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 592EB10D3; Wed, 8 Jun 2016 13:37:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DbIHh040259; Wed, 8 Jun 2016 13:37:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DbIHH040257; Wed, 8 Jun 2016 13:37:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081337.u58DbIHH040257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301614 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:37:19 -0000 Author: ngie Date: Wed Jun 8 13:37:18 2016 New Revision: 301614 URL: https://svnweb.freebsd.org/changeset/base/301614 Log: MFstable/10 r301613: MFC r299843: Fix broken dependency with routed when MK_ROUTED != no Remove routed as a requirement in NETWORKING, and put it in routed as a BEFORE requirement instead Modified: stable/9/etc/rc.d/NETWORKING stable/9/etc/rc.d/routed Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/rc.d/NETWORKING ============================================================================== --- stable/9/etc/rc.d/NETWORKING Wed Jun 8 13:34:52 2016 (r301613) +++ stable/9/etc/rc.d/NETWORKING Wed Jun 8 13:37:18 2016 (r301614) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netoptions routing ppp ipfw stf faith -# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge +# REQUIRE: defaultroute mrouted route6d mroute6d resolv bridge # REQUIRE: static_arp static_ndp # This is a dummy dependency, for services which require networking Modified: stable/9/etc/rc.d/routed ============================================================================== --- stable/9/etc/rc.d/routed Wed Jun 8 13:34:52 2016 (r301613) +++ stable/9/etc/rc.d/routed Wed Jun 8 13:37:18 2016 (r301614) @@ -5,6 +5,7 @@ # PROVIDE: routed # REQUIRE: netif routing +# BEFORE: NETWORK # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@freebsd.org Wed Jun 8 13:40:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB61B6FB02; Wed, 8 Jun 2016 13:40:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CCF71362; Wed, 8 Jun 2016 13:40:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58De7PR040576; Wed, 8 Jun 2016 13:40:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58De74b040574; Wed, 8 Jun 2016 13:40:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081340.u58De74b040574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301615 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:40:08 -0000 Author: ngie Date: Wed Jun 8 13:40:07 2016 New Revision: 301615 URL: https://svnweb.freebsd.org/changeset/base/301615 Log: MFC r299844,r300931: r299844: Make hostid_save depend on hostid r300931: Make netif REQUIRE hostid As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before hostid, and the MAC address generated for any bridge devices will be non-deterministic. Make the MAC address generated be deterministic for bridge devices by explicitly REQUIRE'ing hostid. This fixes up the rest of the PR, inadvertently committed in r299844 PR: 195188 Modified: stable/10/etc/rc.d/hostid_save stable/10/etc/rc.d/netif Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/hostid_save ============================================================================== --- stable/10/etc/rc.d/hostid_save Wed Jun 8 13:37:18 2016 (r301614) +++ stable/10/etc/rc.d/hostid_save Wed Jun 8 13:40:07 2016 (r301615) @@ -4,7 +4,7 @@ # # PROVIDE: hostid_save -# REQUIRE: root +# REQUIRE: hostid root # KEYWORD: nojail . /etc/rc.subr Modified: stable/10/etc/rc.d/netif ============================================================================== --- stable/10/etc/rc.d/netif Wed Jun 8 13:37:18 2016 (r301614) +++ stable/10/etc/rc.d/netif Wed Jun 8 13:40:07 2016 (r301615) @@ -27,7 +27,7 @@ # PROVIDE: netif # REQUIRE: atm1 FILESYSTEMS serial sppp sysctl -# REQUIRE: ipfilter ipfs +# REQUIRE: hostid ipfilter ipfs # KEYWORD: nojailvnet . /etc/rc.subr From owner-svn-src-all@freebsd.org Wed Jun 8 13:41:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB78AB6FBB3; Wed, 8 Jun 2016 13:41:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B914B18B7; Wed, 8 Jun 2016 13:41:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Dfp52043880; Wed, 8 Jun 2016 13:41:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DfpKV043878; Wed, 8 Jun 2016 13:41:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081341.u58DfpKV043878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301616 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:41:53 -0000 Author: ngie Date: Wed Jun 8 13:41:51 2016 New Revision: 301616 URL: https://svnweb.freebsd.org/changeset/base/301616 Log: MFstable/10 r301615: MFC r299844,r300931: r299844: Make hostid_save depend on hostid r300931: Make netif REQUIRE hostid As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before hostid, and the MAC address generated for any bridge devices will be non-deterministic. Make the MAC address generated be deterministic for bridge devices by explicitly REQUIRE'ing hostid. This fixes up the rest of the PR, inadvertently committed in r299844 PR: 195188 Modified: stable/9/etc/rc.d/hostid_save stable/9/etc/rc.d/netif Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/rc.d/hostid_save ============================================================================== --- stable/9/etc/rc.d/hostid_save Wed Jun 8 13:40:07 2016 (r301615) +++ stable/9/etc/rc.d/hostid_save Wed Jun 8 13:41:51 2016 (r301616) @@ -4,7 +4,7 @@ # # PROVIDE: hostid_save -# REQUIRE: root +# REQUIRE: hostid root # KEYWORD: nojail . /etc/rc.subr Modified: stable/9/etc/rc.d/netif ============================================================================== --- stable/9/etc/rc.d/netif Wed Jun 8 13:40:07 2016 (r301615) +++ stable/9/etc/rc.d/netif Wed Jun 8 13:41:51 2016 (r301616) @@ -27,7 +27,7 @@ # PROVIDE: netif # REQUIRE: atm1 FILESYSTEMS serial sppp sysctl -# REQUIRE: ipfilter ipfs +# REQUIRE: hostid ipfilter ipfs # KEYWORD: nojailvnet . /etc/rc.subr From owner-svn-src-all@freebsd.org Wed Jun 8 13:44:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 698BBB6FD5A; Wed, 8 Jun 2016 13:44:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABDB1B3E; Wed, 8 Jun 2016 13:44:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Di1JX044050; Wed, 8 Jun 2016 13:44:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Di1DK044049; Wed, 8 Jun 2016 13:44:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081344.u58Di1DK044049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301617 - stable/10/usr.bin/kdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:44:02 -0000 Author: ngie Date: Wed Jun 8 13:44:01 2016 New Revision: 301617 URL: https://svnweb.freebsd.org/changeset/base/301617 Log: MFC r300428: Fix humanized decoding of struct stat with respect to .st_mtim st_mtim was being incorrectly described as "stime=", not "mtime=". This was introduced with the original feature commit (r176471). PR: 209699 Modified: stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Wed Jun 8 13:41:51 2016 (r301616) +++ stable/10/usr.bin/kdump/kdump.c Wed Jun 8 13:44:01 2016 (r301617) @@ -1750,7 +1750,7 @@ ktrstat(struct stat *statp) printf(".%09ld, ", statp->st_atim.tv_nsec); else printf(", "); - printf("stime="); + printf("mtime="); if (resolv == 0) printf("%jd", (intmax_t)statp->st_mtim.tv_sec); else { From owner-svn-src-all@freebsd.org Wed Jun 8 13:45:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BF39B6FE0F; Wed, 8 Jun 2016 13:45:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68EB11D38; Wed, 8 Jun 2016 13:45:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Dj24C044176; Wed, 8 Jun 2016 13:45:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Dj2In044175; Wed, 8 Jun 2016 13:45:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081345.u58Dj2In044175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301618 - stable/9/usr.bin/kdump X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:45:03 -0000 Author: ngie Date: Wed Jun 8 13:45:02 2016 New Revision: 301618 URL: https://svnweb.freebsd.org/changeset/base/301618 Log: MFstable/10 r301617: MFC r300428: Fix humanized decoding of struct stat with respect to .st_mtim st_mtim was being incorrectly described as "stime=", not "mtime=". This was introduced with the original feature commit (r176471). PR: 209699 Modified: stable/9/usr.bin/kdump/kdump.c Directory Properties: stable/9/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/kdump/ (props changed) Modified: stable/9/usr.bin/kdump/kdump.c ============================================================================== --- stable/9/usr.bin/kdump/kdump.c Wed Jun 8 13:44:01 2016 (r301617) +++ stable/9/usr.bin/kdump/kdump.c Wed Jun 8 13:45:02 2016 (r301618) @@ -1561,7 +1561,7 @@ ktrstat(struct stat *statp) printf(".%09ld, ", statp->st_atim.tv_nsec); else printf(", "); - printf("stime="); + printf("mtime="); if (resolv == 0) printf("%jd", (intmax_t)statp->st_mtim.tv_sec); else { From owner-svn-src-all@freebsd.org Wed Jun 8 13:50:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65C41B6E01D; Wed, 8 Jun 2016 13:50:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36BC71038; Wed, 8 Jun 2016 13:50:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Dnx7s044448; Wed, 8 Jun 2016 13:49:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Dnx8s044447; Wed, 8 Jun 2016 13:49:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081349.u58Dnx8s044447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301619 - stable/10/usr.sbin/rpc.yppasswdd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:50:00 -0000 Author: ngie Date: Wed Jun 8 13:49:59 2016 New Revision: 301619 URL: https://svnweb.freebsd.org/changeset/base/301619 Log: MFC r300430: Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line As a positive side-effect, this eliminates the double semicolons reported by Coverity: the macro contained a trailing semicolon, in addition to the semicolon placed on each line where EXPAND(..) was called. CID: 1194269 Modified: stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 8 13:45:02 2016 (r301618) +++ stable/10/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 8 13:49:59 2016 (r301619) @@ -103,7 +103,10 @@ copy_yp_pass(char *p, int x, int m) } t = buf; -#define EXPAND(e) e = t; while ((*t++ = *p++)); +#define EXPAND(e) do { \ + e = t; \ + while ((*t++ = *p++)); \ +} while (0) EXPAND(yp_password.pw_name); yp_password.pw_fields |= _PWF_NAME; EXPAND(yp_password.pw_passwd); From owner-svn-src-all@freebsd.org Wed Jun 8 13:50:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1D24B6E1B6; Wed, 8 Jun 2016 13:50:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF0C91239; Wed, 8 Jun 2016 13:50:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Domel044561; Wed, 8 Jun 2016 13:50:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DomTb044560; Wed, 8 Jun 2016 13:50:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081350.u58DomTb044560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301620 - stable/9/usr.sbin/rpc.yppasswdd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:50:50 -0000 Author: ngie Date: Wed Jun 8 13:50:48 2016 New Revision: 301620 URL: https://svnweb.freebsd.org/changeset/base/301620 Log: MFstable/10 r301619: MFC r300430: Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line As a positive side-effect, this eliminates the double semicolons reported by Coverity: the macro contained a trailing semicolon, in addition to the semicolon placed on each line where EXPAND(..) was called. CID: 1194269 Modified: stable/9/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rpc.yppasswdd/ (props changed) Modified: stable/9/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- stable/9/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 8 13:49:59 2016 (r301619) +++ stable/9/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 8 13:50:48 2016 (r301620) @@ -103,7 +103,10 @@ copy_yp_pass(char *p, int x, int m) } t = buf; -#define EXPAND(e) e = t; while ((*t++ = *p++)); +#define EXPAND(e) do { \ + e = t; \ + while ((*t++ = *p++)); \ +} while (0) EXPAND(yp_password.pw_name); yp_password.pw_fields |= _PWF_NAME; EXPAND(yp_password.pw_passwd); From owner-svn-src-all@freebsd.org Wed Jun 8 13:57:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 960F8B6E4D0; Wed, 8 Jun 2016 13:57:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 630EC1C03; Wed, 8 Jun 2016 13:57:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58DvIU7048068; Wed, 8 Jun 2016 13:57:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58DvIZ4048067; Wed, 8 Jun 2016 13:57:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201606081357.u58DvIZ4048067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 8 Jun 2016 13:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301621 - head/sys/riscv/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:57:19 -0000 Author: br Date: Wed Jun 8 13:57:18 2016 New Revision: 301621 URL: https://svnweb.freebsd.org/changeset/base/301621 Log: Remove duplicate define. Modified: head/sys/riscv/include/riscvreg.h Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Wed Jun 8 13:50:48 2016 (r301620) +++ head/sys/riscv/include/riscvreg.h Wed Jun 8 13:57:18 2016 (r301621) @@ -124,7 +124,6 @@ #define XLEN 8 #define INSN_SIZE 4 -#define INSN_SIZE 4 #define RISCV_INSN_NOP 0x00000013 #define RISCV_INSN_BREAK 0x00100073 #define RISCV_INSN_RET 0x00008067 From owner-svn-src-all@freebsd.org Wed Jun 8 13:58:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D28EB6E5DD; Wed, 8 Jun 2016 13:58:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A5C81DB1; Wed, 8 Jun 2016 13:58:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Dwl2p048160; Wed, 8 Jun 2016 13:58:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Dwlt1048159; Wed, 8 Jun 2016 13:58:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081358.u58Dwlt1048159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 13:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301622 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 13:58:48 -0000 Author: ngie Date: Wed Jun 8 13:58:47 2016 New Revision: 301622 URL: https://svnweb.freebsd.org/changeset/base/301622 Log: MFC r300620,r300621: r300620: Use reallocf instead of malloc to fix leak with outbuf_pmap The previous code overwrote outbuf_pmap's memory with malloc once per loop iteration, which leaked its memory; use reallocf instead to ensure that memory is properly free'd each loop iteration. Add a outbuf_pmap = NULL in the failure case to avoid a double-free at the bottom of the function. CID: 1038776 r300621: Remove redundant NULLing of outbuf_pmap If reallocf ever failed, outbuf_pmap would already be NULL Modified: stable/10/lib/libc/rpc/clnt_bcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/clnt_bcast.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_bcast.c Wed Jun 8 13:57:18 2016 (r301621) +++ stable/10/lib/libc/rpc/clnt_bcast.c Wed Jun 8 13:58:47 2016 (r301622) @@ -341,7 +341,8 @@ rpc_broadcast_exp(prog, vers, proc, xarg #ifdef PORTMAP if (si.si_af == AF_INET && si.si_proto == IPPROTO_UDP) { udpbufsz = fdlist[fdlistno].dsize; - if ((outbuf_pmap = malloc(udpbufsz)) == NULL) { + outbuf_pmap = reallocf(outbuf_pmap, udpbufsz); + if (outbuf_pmap == NULL) { _close(fd); stat = RPC_SYSTEMERROR; goto done_broad; From owner-svn-src-all@freebsd.org Wed Jun 8 14:01:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CB66B6E7E2; Wed, 8 Jun 2016 14:01:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8DA710F6; Wed, 8 Jun 2016 14:01:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E1hHc048953; Wed, 8 Jun 2016 14:01:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E1h0d048952; Wed, 8 Jun 2016 14:01:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081401.u58E1h0d048952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301623 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:01:44 -0000 Author: ngie Date: Wed Jun 8 14:01:42 2016 New Revision: 301623 URL: https://svnweb.freebsd.org/changeset/base/301623 Log: MFC r300936: Remove the calendar tests if MK_CALENDAR == no when "make delete-old" is run Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 13:58:47 2016 (r301622) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:01:42 2016 (r301623) @@ -548,6 +548,39 @@ OLD_FILES+=usr/share/calendar/uk_UA.KOI8 OLD_DIRS+=usr/share/calendar/uk_UA.KOI8-U OLD_DIRS+=usr/share/calendar OLD_FILES+=usr/share/man/man1/calendar.1.gz +OLD_FILES+=usr/tests/usr.bin/calendar/Kyuafile +OLD_FILES+=usr/tests/usr.bin/calendar/calendar.calibrate +OLD_FILES+=usr/tests/usr.bin/calendar/legacy_test +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.sh +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-7.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-7.out +OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Wed Jun 8 14:02:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64D9FB6E8B2; Wed, 8 Jun 2016 14:02:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 349B212D1; Wed, 8 Jun 2016 14:02:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E2Lnp051736; Wed, 8 Jun 2016 14:02:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E2Lns051735; Wed, 8 Jun 2016 14:02:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606081402.u58E2Lns051735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Jun 2016 14:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301624 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:02:22 -0000 Author: bdrewery Date: Wed Jun 8 14:02:21 2016 New Revision: 301624 URL: https://svnweb.freebsd.org/changeset/base/301624 Log: Don't force filemon for makeman/showconfig Reported by: lidl Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Wed Jun 8 14:01:42 2016 (r301623) +++ head/share/mk/sys.mk Wed Jun 8 14:02:21 2016 (r301624) @@ -55,7 +55,8 @@ META_MODE+= missing-meta=yes META_MODE+= silent=yes .endif .if !exists(/dev/filemon) -.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) +.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) && \ + !make(showconfig) .error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. .endif META_MODE+= nofilemon From owner-svn-src-all@freebsd.org Wed Jun 8 14:05:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB9EDB6E9F3; Wed, 8 Jun 2016 14:05:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB95F1723; Wed, 8 Jun 2016 14:05:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E58fv052027; Wed, 8 Jun 2016 14:05:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E58U7052026; Wed, 8 Jun 2016 14:05:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081405.u58E58U7052026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301625 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:05:10 -0000 Author: ngie Date: Wed Jun 8 14:05:08 2016 New Revision: 301625 URL: https://svnweb.freebsd.org/changeset/base/301625 Log: MFC r300937: Remove the etcupdate tests if MK_RCS == no when "make delete-old" is run etcupdate is conditionally installed based on MK_RCS != no today Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:02:21 2016 (r301624) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:05:08 2016 (r301625) @@ -4166,6 +4166,15 @@ OLD_FILES+=usr/share/man/man1/rcsmerge.1 OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz OLD_FILES+=usr/share/man/man8/etcupdate.8.gz +OLD_FILES+=usr/tests/usr.sbin/etcupdate/Kyuafile +OLD_FILES+=usr/tests/usr.sbin/etcupdate/always_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/conflicts_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/fbsdid_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/ignore_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/preworld_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tests_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tzsetup_test +OLD_DIRS+=usr/tests/usr.sbin/etcupdate .endif #.if ${MK_RESCUE} == no From owner-svn-src-all@freebsd.org Wed Jun 8 14:06:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50B31B6EACC; Wed, 8 Jun 2016 14:06:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06F63196A; Wed, 8 Jun 2016 14:06:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E6Yn8052132; Wed, 8 Jun 2016 14:06:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E6YUT052131; Wed, 8 Jun 2016 14:06:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081406.u58E6YUT052131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301626 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:06:35 -0000 Author: ngie Date: Wed Jun 8 14:06:34 2016 New Revision: 301626 URL: https://svnweb.freebsd.org/changeset/base/301626 Log: MFC r300938: Remove the sa(8) tests if MK_ACCT == no when "make delete-old" is run sa(8) is conditionally installed based on MK_ACCT != no today Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:05:08 2016 (r301625) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 8 14:06:34 2016 (r301626) @@ -12,6 +12,33 @@ OLD_FILES+=usr/sbin/accton OLD_FILES+=usr/sbin/sa OLD_FILES+=usr/share/man/man8/accton.8.gz OLD_FILES+=usr/share/man/man8/sa.8.gz +OLD_FILES+=usr/tests/usr.sbin/sa/Kyuafile +OLD_FILES+=usr/tests/usr.sbin/sa/legacy_test +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-amd64-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-i386-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-amd64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-i386-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-sav.in +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-u.out +OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-usr.in +OLD_FILES+=usr/tests/usr.sbin/sa .endif .if ${MK_ACPI} == no From owner-svn-src-all@freebsd.org Wed Jun 8 14:07:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2428B6EBA2; Wed, 8 Jun 2016 14:07:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7266B1B46; Wed, 8 Jun 2016 14:07:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58E7hGP052232; Wed, 8 Jun 2016 14:07:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58E7hYU052231; Wed, 8 Jun 2016 14:07:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081407.u58E7hYU052231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301627 - stable/10/bin/ls/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:07:44 -0000 Author: ngie Date: Wed Jun 8 14:07:43 2016 New Revision: 301627 URL: https://svnweb.freebsd.org/changeset/base/301627 Log: MFC r300939: Use require.progs with bc instead of require.files with /usr/bin/bc This will make things more flexible if the program path changes in the future, and the test in and of itself doesn't call /usr/bin/bc -- it just calls bc Modified: stable/10/bin/ls/tests/ls_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ls/tests/ls_tests.sh ============================================================================== --- stable/10/bin/ls/tests/ls_tests.sh Wed Jun 8 14:06:34 2016 (r301626) +++ stable/10/bin/ls/tests/ls_tests.sh Wed Jun 8 14:07:43 2016 (r301627) @@ -535,7 +535,7 @@ atf_test_case h_flag h_flag_head() { atf_set "descr" "Verify that -h prints out the humanized units for file sizes with ls -l" - atf_set "require.files" "/usr/bin/bc" + atf_set "require.progs" "bc" } h_flag_body() From owner-svn-src-all@freebsd.org Wed Jun 8 14:15:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ECE2B6EDD8; Wed, 8 Jun 2016 14:15:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B81312BC; Wed, 8 Jun 2016 14:15:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58EFT0u055806; Wed, 8 Jun 2016 14:15:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58EFTEW055804; Wed, 8 Jun 2016 14:15:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606081415.u58EFTEW055804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 8 Jun 2016 14:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301628 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:15:30 -0000 Author: np Date: Wed Jun 8 14:15:29 2016 New Revision: 301628 URL: https://svnweb.freebsd.org/changeset/base/301628 Log: cxgbe(4): Add a sysctl to manage the binding of a txq to a traffic class. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Jun 8 14:07:43 2016 (r301627) +++ head/sys/dev/cxgbe/adapter.h Wed Jun 8 14:15:29 2016 (r301628) @@ -536,6 +536,7 @@ struct sge_txq { struct tx_sdesc *sdesc; /* KVA of software descriptor ring */ struct sglist *gl; __be32 cpl_ctrl0; /* for convenience */ + int tc_idx; /* traffic class */ struct task tx_reclaim_task; /* stats for common events first */ Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Jun 8 14:07:43 2016 (r301627) +++ head/sys/dev/cxgbe/t4_sge.c Wed Jun 8 14:15:29 2016 (r301628) @@ -248,6 +248,7 @@ static void drain_wrq_wr_list(struct ada static int sysctl_uint16(SYSCTL_HANDLER_ARGS); static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); +static int sysctl_tc(SYSCTL_HANDLER_ARGS); static counter_u64_t extfree_refs; static counter_u64_t extfree_rels; @@ -3434,6 +3435,7 @@ alloc_txq(struct vi_info *vi, struct sge txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) | V_TXPKT_VF(vi->viid)); + txq->tc_idx = -1; txq->sdesc = malloc(eq->sidx * sizeof(struct tx_sdesc), M_CXGBE, M_ZERO | M_WAITOK); @@ -3451,6 +3453,10 @@ alloc_txq(struct vi_info *vi, struct sge CTLTYPE_INT | CTLFLAG_RD, &eq->pidx, 0, sysctl_uint16, "I", "producer index"); + SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "tc", + CTLTYPE_INT | CTLFLAG_RW, vi, idx, sysctl_tc, "I", + "traffic class (-1 means none)"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txcsum", CTLFLAG_RD, &txq->txcsum, "# of times hardware assisted with checksum"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vlan_insertion", @@ -4684,3 +4690,78 @@ sysctl_bufsizes(SYSCTL_HANDLER_ARGS) sbuf_delete(&sb); return (rc); } + +static int +sysctl_tc(SYSCTL_HANDLER_ARGS) +{ + struct vi_info *vi = arg1; + struct port_info *pi; + struct adapter *sc; + struct sge_txq *txq; + struct tx_sched_class *tc; + int qidx = arg2, rc, tc_idx; + uint32_t fw_queue, fw_class; + + MPASS(qidx >= 0 && qidx < vi->ntxq); + pi = vi->pi; + sc = pi->adapter; + txq = &sc->sge.txq[vi->first_txq + qidx]; + + tc_idx = txq->tc_idx; + rc = sysctl_handle_int(oidp, &tc_idx, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + /* Note that -1 is legitimate input (it means unbind). */ + if (tc_idx < -1 || tc_idx >= sc->chip_params->nsched_cls) + return (EINVAL); + + rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4stc"); + if (rc) + return (rc); + + if (tc_idx == txq->tc_idx) { + rc = 0; /* No change, nothing to do. */ + goto done; + } + + fw_queue = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | + V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id); + + if (tc_idx == -1) + fw_class = 0xffffffff; /* Unbind. */ + else { + /* + * Bind to a different class. Ethernet txq's are only allowed + * to bind to cl-rl mode-class for now. XXX: too restrictive. + */ + tc = &pi->tc[tc_idx]; + if (tc->flags & TX_SC_OK && + tc->params.level == SCHED_CLASS_LEVEL_CL_RL && + tc->params.mode == SCHED_CLASS_MODE_CLASS) { + /* Ok to proceed. */ + fw_class = tc_idx; + } else { + rc = tc->flags & TX_SC_OK ? EBUSY : ENXIO; + goto done; + } + } + + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, &fw_class); + if (rc == 0) { + if (txq->tc_idx != -1) { + tc = &pi->tc[txq->tc_idx]; + MPASS(tc->refcount > 0); + tc->refcount--; + } + if (tc_idx != -1) { + tc = &pi->tc[tc_idx]; + tc->refcount++; + } + txq->tc_idx = tc_idx; + } +done: + end_synchronized_op(sc, 0); + return (rc); +} From owner-svn-src-all@freebsd.org Wed Jun 8 14:18:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB4B0B6EFEF; Wed, 8 Jun 2016 14:18:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 870C0172A; Wed, 8 Jun 2016 14:18:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58EIlpV056004; Wed, 8 Jun 2016 14:18:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58EIlKM056000; Wed, 8 Jun 2016 14:18:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081418.u58EIlKM056000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301629 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:18:48 -0000 Author: ngie Date: Wed Jun 8 14:18:47 2016 New Revision: 301629 URL: https://svnweb.freebsd.org/changeset/base/301629 Log: MFC r300387,r300388,r300389: r300387: getnetid(..): consistently fclose fd at the end of the function This mutes a false positive with cppcheck, but also helps eliminate future potential issues with this variable r300388: Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf was NULL This would theoretically happen if the netconfig protocol family and protocol semantics were never matched. CID: 978179 r300389: nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..) If the buffer couldn't be adequately resized to accomodate an additional "\n", it would leak resultbuf by breaking from the loop early CID: 1016702 Modified: stable/10/lib/libc/rpc/getrpcent.c stable/10/lib/libc/rpc/netnamer.c stable/10/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getrpcent.c ============================================================================== --- stable/10/lib/libc/rpc/getrpcent.c Wed Jun 8 14:15:29 2016 (r301628) +++ stable/10/lib/libc/rpc/getrpcent.c Wed Jun 8 14:18:47 2016 (r301629) @@ -512,6 +512,7 @@ nis_rpcent(void *retval, void *mdata, va sizeof(char *)) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } @@ -521,6 +522,7 @@ nis_rpcent(void *retval, void *mdata, va if (aliases_size < 1) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } Modified: stable/10/lib/libc/rpc/netnamer.c ============================================================================== --- stable/10/lib/libc/rpc/netnamer.c Wed Jun 8 14:15:29 2016 (r301628) +++ stable/10/lib/libc/rpc/netnamer.c Wed Jun 8 14:18:47 2016 (r301629) @@ -253,6 +253,9 @@ getnetid(key, ret) char *lookup; int len; #endif + int rv; + + rv = 0; fd = fopen(NETIDFILE, "r"); if (fd == NULL) { @@ -263,13 +266,11 @@ getnetid(key, ret) return (0); #endif } - for (;;) { - if (fd == NULL) - return (0); /* getnetidyp brings us here */ + while (fd != NULL) { res = fgets(buf, sizeof(buf), fd); if (res == NULL) { - fclose(fd); - return (0); + rv = 0; + goto done; } if (res[0] == '#') continue; @@ -292,9 +293,8 @@ getnetid(key, ret) lookup[len] = 0; strcpy(ret, lookup); free(lookup); - if (fd != NULL) - fclose(fd); - return (2); + rv = 2; + goto done; #else /* YP */ #ifdef DEBUG fprintf(stderr, @@ -320,10 +320,14 @@ getnetid(key, ret) } if (strcmp(mkey, key) == 0) { strcpy(ret, mval); - fclose(fd); - return (1); - + rv = 1; + goto done; } } } + +done: + if (fd != NULL) + fclose(fd); + return (rv); } Modified: stable/10/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_clnt.c Wed Jun 8 14:15:29 2016 (r301628) +++ stable/10/lib/libc/rpc/rpcb_clnt.c Wed Jun 8 14:18:47 2016 (r301629) @@ -508,6 +508,7 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } + endnetconfig(nc_handle); if (tmpnconf == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); @@ -515,7 +516,6 @@ try_nconf: } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ - endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL); From owner-svn-src-all@freebsd.org Wed Jun 8 14:20:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3D1B6F190; Wed, 8 Jun 2016 14:20:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE9651ABA; Wed, 8 Jun 2016 14:20:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58EKtmr056810; Wed, 8 Jun 2016 14:20:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58EKse3056807; Wed, 8 Jun 2016 14:20:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081420.u58EKse3056807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 14:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301630 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:20:56 -0000 Author: ngie Date: Wed Jun 8 14:20:54 2016 New Revision: 301630 URL: https://svnweb.freebsd.org/changeset/base/301630 Log: MFstable/10 r301629: MFC r300387,r300388,r300389: r300387: getnetid(..): consistently fclose fd at the end of the function This mutes a false positive with cppcheck, but also helps eliminate future potential issues with this variable r300388: Call endnetconfig on nc_handle sooner to avoid leaking nc_handle if tmpnconf was NULL This would theoretically happen if the netconfig protocol family and protocol semantics were never matched. CID: 978179 r300389: nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..) If the buffer couldn't be adequately resized to accomodate an additional "\n", it would leak resultbuf by breaking from the loop early CID: 1016702 Modified: stable/9/lib/libc/rpc/getrpcent.c stable/9/lib/libc/rpc/netnamer.c stable/9/lib/libc/rpc/rpcb_clnt.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/getrpcent.c ============================================================================== --- stable/9/lib/libc/rpc/getrpcent.c Wed Jun 8 14:18:47 2016 (r301629) +++ stable/9/lib/libc/rpc/getrpcent.c Wed Jun 8 14:20:54 2016 (r301630) @@ -512,6 +512,7 @@ nis_rpcent(void *retval, void *mdata, va sizeof(char *)) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } @@ -521,6 +522,7 @@ nis_rpcent(void *retval, void *mdata, va if (aliases_size < 1) { *errnop = ERANGE; rv = NS_RETURN; + free(resultbuf); break; } Modified: stable/9/lib/libc/rpc/netnamer.c ============================================================================== --- stable/9/lib/libc/rpc/netnamer.c Wed Jun 8 14:18:47 2016 (r301629) +++ stable/9/lib/libc/rpc/netnamer.c Wed Jun 8 14:20:54 2016 (r301630) @@ -253,6 +253,9 @@ getnetid(key, ret) char *lookup; int len; #endif + int rv; + + rv = 0; fd = fopen(NETIDFILE, "r"); if (fd == NULL) { @@ -263,13 +266,11 @@ getnetid(key, ret) return (0); #endif } - for (;;) { - if (fd == NULL) - return (0); /* getnetidyp brings us here */ + while (fd != NULL) { res = fgets(buf, sizeof(buf), fd); if (res == NULL) { - fclose(fd); - return (0); + rv = 0; + goto done; } if (res[0] == '#') continue; @@ -292,9 +293,8 @@ getnetid(key, ret) lookup[len] = 0; strcpy(ret, lookup); free(lookup); - if (fd != NULL) - fclose(fd); - return (2); + rv = 2; + goto done; #else /* YP */ #ifdef DEBUG fprintf(stderr, @@ -320,10 +320,14 @@ getnetid(key, ret) } if (strcmp(mkey, key) == 0) { strcpy(ret, mval); - fclose(fd); - return (1); - + rv = 1; + goto done; } } } + +done: + if (fd != NULL) + fclose(fd); + return (rv); } Modified: stable/9/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/9/lib/libc/rpc/rpcb_clnt.c Wed Jun 8 14:18:47 2016 (r301629) +++ stable/9/lib/libc/rpc/rpcb_clnt.c Wed Jun 8 14:20:54 2016 (r301630) @@ -508,6 +508,7 @@ try_nconf: hostname = IN6_LOCALHOST_STRING; } } + endnetconfig(nc_handle); if (tmpnconf == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); @@ -515,7 +516,6 @@ try_nconf: } loopnconf = getnetconfigent(tmpnconf->nc_netid); /* loopnconf is never freed */ - endnetconfig(nc_handle); } mutex_unlock(&loopnconf_lock); client = getclnthandle(hostname, loopnconf, NULL); From owner-svn-src-all@freebsd.org Wed Jun 8 14:21:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E914B6F211; Wed, 8 Jun 2016 14:21:49 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D5661CFC; Wed, 8 Jun 2016 14:21:49 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58ELmew059628; Wed, 8 Jun 2016 14:21:48 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58ELmbK059627; Wed, 8 Jun 2016 14:21:48 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201606081421.u58ELmbK059627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Wed, 8 Jun 2016 14:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301631 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:21:49 -0000 Author: skreuzer (doc,ports committer) Date: Wed Jun 8 14:21:48 2016 New Revision: 301631 URL: https://svnweb.freebsd.org/changeset/base/301631 Log: Document 300880, Leading spaces are stripped from SCSI disk serial numbers Approved by: re (gjb, implicit, relnotes) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Jun 8 14:20:54 2016 (r301630) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Jun 8 14:21:48 2016 (r301631) @@ -1517,6 +1517,13 @@ TRIM/UNMAP support on GELI-backed SSD storage providers. + + + Leading spaces are now stripped off SCSI disk serial + numbers when populating the CAM serial number. This affects the output of + &man.diskinfo.8; and the names of /dev/diskid/DISK-* + device nodes, among other things. + From owner-svn-src-all@freebsd.org Wed Jun 8 14:22:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED683B6F323; Wed, 8 Jun 2016 14:22:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BED311F6A; Wed, 8 Jun 2016 14:22:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58EMGeL059711; Wed, 8 Jun 2016 14:22:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58EMG6e059708; Wed, 8 Jun 2016 14:22:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201606081422.u58EMG6e059708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 8 Jun 2016 14:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301632 - in head/sys/dev: flash mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:22:18 -0000 Author: bapt Date: Wed Jun 8 14:22:16 2016 New Revision: 301632 URL: https://svnweb.freebsd.org/changeset/base/301632 Log: Add support for Atmel at25df641 flash Submitted by: Grégory Soutadé (via github pull request) Modified: head/sys/dev/flash/mx25l.c head/sys/dev/mii/miidevs head/sys/dev/mii/smscphy.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Wed Jun 8 14:21:48 2016 (r301631) +++ head/sys/dev/flash/mx25l.c Wed Jun 8 14:22:16 2016 (r301632) @@ -130,6 +130,9 @@ struct mx25l_flash_ident flash_devices[] { "w25q64bv", 0xef, 0x4017, 64 * 1024, 128, FL_ERASE_4K }, { "w25q128", 0xef, 0x4018, 64 * 1024, 256, FL_ERASE_4K }, { "w25q256", 0xef, 0x4019, 64 * 1024, 512, FL_ERASE_4K }, + + /* Atmel */ + { "at25df641", 0x1f, 0x4800, 64 * 1024, 128, FL_ERASE_4K }, }; static uint8_t Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Wed Jun 8 14:21:48 2016 (r301631) +++ head/sys/dev/mii/miidevs Wed Jun 8 14:22:16 2016 (r301632) @@ -343,3 +343,4 @@ model xxXAQTI XMACII 0x0000 XaQti Corp. /* SMC */ model SMC LAN8710A 0x000F SMC LAN8710A 10/100 interface +model SMC LAN8700 0x000C SMC LAN8700 10/100 interface Modified: head/sys/dev/mii/smscphy.c ============================================================================== --- head/sys/dev/mii/smscphy.c Wed Jun 8 14:21:48 2016 (r301631) +++ head/sys/dev/mii/smscphy.c Wed Jun 8 14:22:16 2016 (r301632) @@ -77,6 +77,7 @@ DRIVER_MODULE(smscphy, miibus, smscphy_d static const struct mii_phydesc smscphys[] = { MII_PHY_DESC(SMC, LAN8710A), + MII_PHY_DESC(SMC, LAN8700), MII_PHY_END }; From owner-svn-src-all@freebsd.org Wed Jun 8 14:51:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A56E9B6FC88; Wed, 8 Jun 2016 14:51:07 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DAE214B0; Wed, 8 Jun 2016 14:51:07 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id k184so17224445wme.1; Wed, 08 Jun 2016 07:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zh6E7cx13IRIYv1fqwKmg1pqKqNGuqYMl5AitYK5M3Q=; b=npso+4juTtpVEoz++UwzZZag/2l4nnvz1EtcC3lPtI6eul1skmt/8aEuSn9a0E6lJd 1jLTn8jegKFH1jSW0P2LyQ6J/QwqDnnDGvLQiWyJlZmJfCMZcvsADPUdmvvWcXwRtb+W pO8a75WkN6qmLCCq7+gjMPvtziQ70/u7JuIPIR8OQzCFONiBiol/+bNzpwbup6c6CQcC 8l6pslSCpkJDxsP+JVyvHQ3Nv4R2QfoJL4fBZ0KW0v6ugDCoMRchO7RmHVL/iWNm09kF lFXyOhCA4XD3AN9nn6lMuKvvKaxgvioCyj1wJmhyuGk20LYyitMqdoxi+BoQkysiL2nH 0yqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=zh6E7cx13IRIYv1fqwKmg1pqKqNGuqYMl5AitYK5M3Q=; b=GmX7cD+YP4gyeVSU3BVH/uTOMswI3r1EUV4WBWmKtfYRRibrUKl1JMYluG6S74ukdd jxoaIc2Wer8eWDrG6ckh63P19GjZn/lVBQUkCI/YA4/bimqx59XUXwzgJG7SNcZRH4HV hsgs3rtaflMuxAA5Mrrin4rkDAJrT07XDH/c8bgTeQgi1H1XaRwtvsHc/3IQglCvfPsm Z0vHhdrwDjQpGbIbgEVXNwEgBuFo0v28HcmiJy2gZw/o2p7dTRj8XePookKQLDm+ncqV SaVuEhusA/yiuYIz7ctV0+DAYDGu1MPLxTKTRVjXQv+QT4whrb4Rw28OYnq9vqc8TKvR YFYQ== X-Gm-Message-State: ALyK8tJe/uNVBn9FdycMSjjNfQFJ9ko91rmbud2taJfdOoGb0/gG8Q5+BDuPrpTaH+d9LQ== X-Received: by 10.194.85.161 with SMTP id i1mr5385356wjz.95.1465397465857; Wed, 08 Jun 2016 07:51:05 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id b207sm25358304wmb.0.2016.06.08.07.51.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jun 2016 07:51:05 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 8 Jun 2016 16:51:04 +0200 From: Baptiste Daroussin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301632 - in head/sys/dev: flash mii Message-ID: <20160608145104.yiqbnyhqo62uud6x@ivaldir.etoilebsd.net> References: <201606081422.u58EMG6e059708@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2yh2g3ne66vsob3o" Content-Disposition: inline In-Reply-To: <201606081422.u58EMG6e059708@repo.freebsd.org> User-Agent: Mutt/1.6.1-neo (2016-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 14:51:07 -0000 --2yh2g3ne66vsob3o Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 08, 2016 at 02:22:16PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Jun 8 14:22:16 2016 > New Revision: 301632 > URL: https://svnweb.freebsd.org/changeset/base/301632 >=20 > Log: > Add support for Atmel at25df641 flash > =20 > Submitted by: Gr=E9gory Soutad=E9 (via github pull = request) >=20 Sorry I mixed 2 commits by accident, so this commits also includes: Add support for PHY LAN8700 using the same driver as PHY LAN8710A Best regards, Bapt --2yh2g3ne66vsob3o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXWDDYAAoJEGOJi9zxtz5a+agP/3bEdqicwPqbM7yoojZKv8St P7y8BvLwpL6NE2rBe52AiWutYraldI/CVq3zz6fpQyLJCxLmKa8FufjKAAMCpIsb c0kDFvWYAj8rnU02QGNjQj7Mnw13KMPhCsrEjOybdcP+wzE16MW9Ny1Kcj2DjMkc +6pevsHbPPS+4HIkG+Ov6gW1MjnKjSLq+I4FZXVjFDJnm1b2gbB6yDPtndnYa2YS qUOFFuOV/rp2TXevj2th2Z9W1WiBYJoCGtSJumnVr9s8HGHLTuZnPsA0x8SqWwhS EBTZ/0fd0cAp86aEO5hH/j6uWmIH1njqqWhL3H9UMdJCb9L2dLulTARmWN4Y43Ml r7WcR2v83aFFsOeFO9gGIzUndb6PPVgEOnQroetPbP9yVUQsUTKUHOceK+c/wVCl SYWX+I41zkmyCsFG7jRkR0H+KZOd4EMA3TBSQE0+AKQ6itWthdoxOR3N6M06v1aR APNq1L/wkWmY9oCX8Gq725RoPGInynfeNSTCPK7vZD6OZDWkqC5AhccLiejYDC7V u1OjTxtdM5AkKMePUognAFxIEY02FAi99LGDMNK3bWLTo3V6X6r/ruWna/UZwAj0 QMg6f66l7Z9ewwYWTNii4sRlTDPaV8Z8isQtQKLT1u9p9R73uLtbJa6IAXpMA0Qf sHGxev057P7m5R7+a5hq =uN0U -----END PGP SIGNATURE----- --2yh2g3ne66vsob3o-- From owner-svn-src-all@freebsd.org Wed Jun 8 15:38:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20239B6FAC9; Wed, 8 Jun 2016 15:38:08 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4D051C49; Wed, 8 Jun 2016 15:38:07 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Fc7oo085570; Wed, 8 Jun 2016 15:38:07 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Fc6Iw085560; Wed, 8 Jun 2016 15:38:06 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606081538.u58Fc6Iw085560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 8 Jun 2016 15:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301634 - vendor/NetBSD/bmake/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 15:38:08 -0000 Author: sjg Date: Wed Jun 8 15:38:06 2016 New Revision: 301634 URL: https://svnweb.freebsd.org/changeset/base/301634 Log: Import bmake-20160606 From ChangeLog: o dir.c: extend mtimes cache to others via cached_stat() Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/README vendor/NetBSD/bmake/dist/config.h.in vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/dir.c vendor/NetBSD/bmake/dist/hash.h vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/meta.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/ChangeLog Wed Jun 8 15:38:06 2016 (r301634) @@ -1,3 +1,9 @@ +2016-06-06 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160606 + Merge with NetBSD make, pick up + o dir.c: extend mtimes cache to others via cached_stat() + 2016-06-04 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160604 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/Makefile Wed Jun 8 15:38:06 2016 (r301634) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.66 2016/06/04 22:21:15 sjg Exp $ +# $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160604 +_MAKE_VERSION= 20160606 PROG= bmake Modified: vendor/NetBSD/bmake/dist/README ============================================================================== --- vendor/NetBSD/bmake/dist/README Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/README Wed Jun 8 15:38:06 2016 (r301634) @@ -1,47 +1,52 @@ bmake + ***** -This directory contains a port of the BSD make tool (from NetBSD) -I have run it on SunOS,Solaris,HP-UX,AIX,IRIX,FreeBSD and Linux. +This directory contains a port of the BSD make tool (from NetBSD). +Since 1993 I have run it on AIX, BSDi, Darwin, FreeBSD, HP-UX, IRIX, +Linux, Minix, OSF, Solaris, SunOS and even UTS. +Others have run it on many more systems. -Version 3 was re-worked from scratch to better facilitate -importing newer make(1) versions from NetBSD. The original code base -was NetBSD-1.0, so version 3 was built by doing a fresh import of the -NetBSD-1.0 usr.bin/make, adding the autoconf and other portability -patches to sync it with bmake v2, and then NetBSD's make -of Feb 20, 2000 was imported and conflicts dealt with. -NetBSD's make was again imported on June 6 and December 15, 2000. +Currently each release is tested on NetBSD, FreeBSD, Solaris and Linux. -In 2003 bmake switched to a date based version (first was 20030714) +Since 2003 bmake switched to a date based version (first was 20030714) which generally represents the date it was last merged with NetBSD's make. Since then, NetBSD's make is imported within a week of any interesting changes, so that bmake tracks it very closely. -Building: +Building +======== -The preferred way to bootstrap bmake is: +The preferred way to bootstrap bmake is:: -./bmake/boot-strap + ./bmake/boot-strap there are a number of args - most of which get passed to configure, eg. +:: -./bmake/boot-strap --prefix=/opt + ./bmake/boot-strap --prefix=/opt see the boot-strap script for details. +For folk that hate to read anything, since 20121212 you can also use +the GNU standard process of:: + + ./configure; make; make install + To make much use of bmake you will need the bsd.*.mk macros or my -portable *.mk macros. See +portable *.mk macros which are included with bmake since 20121212 +and separately available from http://www.crufty.net/ftp/pub/sjg/mk.tar.gz which will be links to the latest versions. -On a non-BSD system, you would want to unpack mk[-YYYYmmdd].tar.gz in -the same directory as bmake (so ./mk and ./bmake exist), and -./bmake/boot-strap will do the rest. +Porting +======= + +If you encounter a system that bmake does not build or work on *out of +the box*, I welcome patches. +If you can provide access to a suitable machine - even better. -If you want to do it all by hand then read boot-strap first to get the -idea. +More info can be found at http://www.crufty.net/help/sjg/bmake.htm -Even if you have an earlier version of bmake installed, use boot-strap -to ensure that all goes well. +--sjg ---sjg Modified: vendor/NetBSD/bmake/dist/config.h.in ============================================================================== --- vendor/NetBSD/bmake/dist/config.h.in Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/config.h.in Wed Jun 8 15:38:06 2016 (r301634) @@ -324,6 +324,9 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to `int' if does not define. */ +#undef mode_t + /* Define to `long int' if does not define. */ #undef off_t Modified: vendor/NetBSD/bmake/dist/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/NetBSD/bmake/dist/configure.in ============================================================================== --- vendor/NetBSD/bmake/dist/configure.in Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/configure.in Wed Jun 8 15:38:06 2016 (r301634) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.56 2015/10/25 05:20:48 sjg Exp $ +dnl $Id: configure.in,v 1.57 2016/06/07 00:49:44 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20151022], [sjg@NetBSD.org]) +AC_INIT([bmake], [20160606], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -148,6 +148,7 @@ dnl Checks for typedefs, structures, and AC_C___ATTRIBUTE__ AC_C_BIGENDIAN AC_C_CONST +AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T Modified: vendor/NetBSD/bmake/dist/dir.c ============================================================================== --- vendor/NetBSD/bmake/dist/dir.c Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/dir.c Wed Jun 8 15:38:06 2016 (r301634) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $ */ +/* $NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"); +__RCSID("$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -244,6 +244,7 @@ static Hash_Table mtimes; /* Results o * be two rules to update a single file, so this * should be ok, but... */ +static Hash_Table lmtimes; /* same as mtimes but for lstat */ static int DirFindName(const void *, const void *); static int DirMatchFiles(const char *, Path *, Lst); @@ -256,6 +257,80 @@ static char *DirLookupSubdir(Path *, con static char *DirFindDot(Boolean, const char *, const char *); static char *DirLookupAbs(Path *, const char *, const char *); + +/* + * We use stat(2) a lot, cache the results + * mtime and mode are all we care about. + */ +struct cache_st { + time_t mtime; + mode_t mode; +}; + +/* minimize changes below */ +static time_t +Hash_GetTimeValue(Hash_Entry *entry) +{ + struct cache_st *cst; + + cst = entry->clientPtr; + return cst->mtime; +} + +#define CST_LSTAT 1 +#define CST_UPDATE 2 + +static int +cached_stats(Hash_Table *htp, const char *pathname, struct stat *st, int flags) +{ + Hash_Entry *entry; + struct cache_st *cst; + int rc; + + if (!pathname || !pathname[0]) + return -1; + + entry = Hash_FindEntry(htp, pathname); + + if (entry && (flags & CST_UPDATE) == 0) { + cst = entry->clientPtr; + + memset(st, 0, sizeof(*st)); + st->st_mtime = cst->mtime; + st->st_mode = cst->mode; + return 0; + } + + rc = (flags & CST_LSTAT) ? lstat(pathname, st) : stat(pathname, st); + if (rc == -1) + return -1; + + if (st->st_mtime == 0) + st->st_mtime = 1; /* avoid confusion with missing file */ + + if (!entry) + entry = Hash_CreateEntry(htp, pathname, NULL); + if (!entry->clientPtr) + entry->clientPtr = bmake_malloc(sizeof(*cst)); + cst = entry->clientPtr; + cst->mtime = st->st_mtime; + cst->mode = st->st_mode; + + return 0; +} + +int +cached_stat(const char *pathname, void *st) +{ + return cached_stats(&mtimes, pathname, st, 0); +} + +int +cached_lstat(const char *pathname, void *st) +{ + return cached_stats(&lmtimes, pathname, st, CST_LSTAT); +} + /*- *----------------------------------------------------------------------- * Dir_Init -- @@ -274,6 +349,7 @@ Dir_Init(const char *cdname) dirSearchPath = Lst_Init(FALSE); openDirectories = Lst_Init(FALSE); Hash_InitTable(&mtimes, 0); + Hash_InitTable(&lmtimes, 0); Dir_InitCur(cdname); @@ -901,7 +977,6 @@ static char * DirLookupSubdir(Path *p, const char *name) { struct stat stb; /* Buffer for stat, if necessary */ - Hash_Entry *entry; /* Entry for mtimes table */ char *file; /* the current filename to check */ if (p != dot) { @@ -917,9 +992,7 @@ DirLookupSubdir(Path *p, const char *nam fprintf(debug_file, "checking %s ...\n", file); } - if (stat(file, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; + if (cached_stat(file, &stb) == 0) { /* * Save the modification time so if it's needed, we don't have * to fetch it again. @@ -928,8 +1001,6 @@ DirLookupSubdir(Path *p, const char *nam fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), file); } - entry = Hash_CreateEntry(&mtimes, file, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); nearmisses += 1; return (file); } @@ -1312,15 +1383,11 @@ Dir_FindFile(const char *name, Lst path) fprintf(debug_file, " got it (in mtime cache)\n"); } return(bmake_strdup(name)); - } else if (stat(name, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; - entry = Hash_CreateEntry(&mtimes, name, NULL); + } else if (cached_stat(name, &stb) == 0) { if (DEBUG(DIR)) { fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), name); } - Hash_SetTimeValue(entry, stb.st_mtime); return (bmake_strdup(name)); } else { if (DEBUG(DIR)) { @@ -1368,7 +1435,7 @@ Dir_FindHereOrAbove(char *here, char *se /* try and stat(2) it ... */ snprintf(try, sizeof(try), "%s/%s", dirbase, search_path); - if (stat(try, &st) != -1) { + if (cached_stat(try, &st) != -1) { /* * success! if we found a file, chop off * the filename so we return a directory. @@ -1489,12 +1556,12 @@ Dir_MTime(GNode *gn, Boolean recheck) else entry = NULL; if (entry != NULL) { + stb.st_mtime = Hash_GetTimeValue(entry); if (DEBUG(DIR)) { fprintf(debug_file, "Using cached time %s for %s\n", - Targ_FmtTime(Hash_GetTimeValue(entry)), fullName); + Targ_FmtTime(stb.st_mtime), fullName); } - stb.st_mtime = Hash_GetTimeValue(entry); - } else if (stat(fullName, &stb) < 0) { + } else if (cached_stats(&mtimes, fullName, &stb, recheck ? CST_UPDATE : 0) < 0) { if (gn->type & OP_MEMBER) { if (fullName != gn->path) free(fullName); @@ -1502,18 +1569,8 @@ Dir_MTime(GNode *gn, Boolean recheck) } else { stb.st_mtime = 0; } - } else { - if (stb.st_mtime == 0) { - /* - * 0 handled specially by the code, if the time is really 0, - * return something else instead - */ - stb.st_mtime = 1; - } - entry = Hash_CreateEntry(&mtimes, fullName, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); } - + if (fullName && gn->path == NULL) { gn->path = fullName; } Modified: vendor/NetBSD/bmake/dist/hash.h ============================================================================== --- vendor/NetBSD/bmake/dist/hash.h Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/hash.h Wed Jun 8 15:38:06 2016 (r301634) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.10 2009/01/24 10:59:09 dsl Exp $ */ +/* $NetBSD: hash.h,v 1.11 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -89,10 +89,7 @@ typedef struct Hash_Entry { struct Hash_Entry *next; /* Used to link together all the * entries associated with the same * bucket. */ - union { - void *clientPtr; /* Arbitrary pointer */ - time_t clientTime; /* Arbitrary Time */ - } clientInfo; + void *clientPtr; /* Arbitrary pointer */ unsigned namehash; /* hash value of key */ char name[1]; /* key string */ } Hash_Entry; @@ -125,8 +122,7 @@ typedef struct Hash_Search { * Hash_Entry *h; */ -#define Hash_GetValue(h) ((h)->clientInfo.clientPtr) -#define Hash_GetTimeValue(h) ((h)->clientInfo.clientTime) +#define Hash_GetValue(h) ((h)->clientPtr) /* * Hash_SetValue(h, val); @@ -134,8 +130,7 @@ typedef struct Hash_Search { * char *val; */ -#define Hash_SetValue(h, val) ((h)->clientInfo.clientPtr = (val)) -#define Hash_SetTimeValue(h, val) ((h)->clientInfo.clientTime = (val)) +#define Hash_SetValue(h, val) ((h)->clientPtr = (val)) /* * Hash_Size(n) returns the number of words in an object of n bytes Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/main.c Wed Jun 8 15:38:06 2016 (r301634) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $ */ +/* $NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"); #endif #endif /* not lint */ #endif @@ -1906,15 +1906,11 @@ cached_realpath(const char *pathname, ch rp = Var_Value(pathname, cache, &cp); if (rp) { /* a hit */ - if (resolved) - strlcpy(resolved, rp, MAXPATHLEN); - else - resolved = bmake_strdup(rp); - } else { - if ((rp = realpath(pathname, resolved))) { - Var_Set(pathname, rp, cache, 0); - } + strlcpy(resolved, rp, MAXPATHLEN); + } else if ((rp = realpath(pathname, resolved))) { + Var_Set(pathname, rp, cache, 0); } + free(cp); return rp ? resolved : NULL; } Modified: vendor/NetBSD/bmake/dist/make.h ============================================================================== --- vendor/NetBSD/bmake/dist/make.h Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/make.h Wed Jun 8 15:38:06 2016 (r301634) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.99 2016/06/03 01:21:59 sjg Exp $ */ +/* $NetBSD: make.h,v 1.100 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -506,6 +506,8 @@ void Main_ExportMAKEFLAGS(Boolean); Boolean Main_SetObjdir(const char *); int mkTempFile(const char *, char **); int str2Lst_Append(Lst, char *, const char *); +int cached_lstat(const char *, void *); +int cached_stat(const char *, void *); #define VARF_UNDEFERR 1 #define VARF_WANTRES 2 Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Wed Jun 8 15:09:07 2016 (r301633) +++ vendor/NetBSD/bmake/dist/meta.c Wed Jun 8 15:38:06 2016 (r301634) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.60 2016/06/04 22:17:14 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.61 2016/06/07 00:40:00 sjg Exp $ */ /* * Implement 'meta' mode. @@ -429,7 +429,7 @@ meta_needed(GNode *gn, const char *dname } /* The object directory may not exist. Check it.. */ - if (stat(dname, &fs) != 0) { + if (cached_stat(dname, &fs) != 0) { if (verbose) fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n", gn->name); @@ -1238,8 +1238,8 @@ meta_oodate(GNode *gn, Boolean oodate) if ((strstr("tmp", p))) break; - if ((link_src != NULL && lstat(p, &fs) < 0) || - (link_src == NULL && stat(p, &fs) < 0)) { + if ((link_src != NULL && cached_lstat(p, &fs) < 0) || + (link_src == NULL && cached_stat(p, &fs) < 0)) { if (Lst_Find(missingFiles, p, string_match) == NULL) Lst_AtEnd(missingFiles, bmake_strdup(p)); } @@ -1328,7 +1328,7 @@ meta_oodate(GNode *gn, Boolean oodate) if (DEBUG(META)) fprintf(debug_file, "%s: %d: looking for: %s\n", fname, lineno, *sdp); #endif - if (stat(*sdp, &fs) == 0) { + if (cached_stat(*sdp, &fs) == 0) { found = 1; p = *sdp; } From owner-svn-src-all@freebsd.org Wed Jun 8 15:38:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B85AB6FB09; Wed, 8 Jun 2016 15:38:21 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8E861D91; Wed, 8 Jun 2016 15:38:20 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58FcKSU085622; Wed, 8 Jun 2016 15:38:20 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58FcKRb085621; Wed, 8 Jun 2016 15:38:20 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606081538.u58FcKRb085621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 8 Jun 2016 15:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301635 - vendor/NetBSD/bmake/20160606 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 15:38:21 -0000 Author: sjg Date: Wed Jun 8 15:38:19 2016 New Revision: 301635 URL: https://svnweb.freebsd.org/changeset/base/301635 Log: tag bmake-20160606 Added: vendor/NetBSD/bmake/20160606/ - copied from r301634, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Wed Jun 8 15:41:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 882E3B6FC70; Wed, 8 Jun 2016 15:41:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B68D107D; Wed, 8 Jun 2016 15:41:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58FfdVb088402; Wed, 8 Jun 2016 15:41:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Ffd3p088401; Wed, 8 Jun 2016 15:41:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081541.u58Ffd3p088401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 15:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301636 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 15:41:40 -0000 Author: ngie Date: Wed Jun 8 15:41:39 2016 New Revision: 301636 URL: https://svnweb.freebsd.org/changeset/base/301636 Log: MFC r300867,r300932,r300934,r300941,r300972,r300973: r300867: Only expose `hint_uaddr` in the ND_DEBUG case This fixes a -Wunused-but-set-variable warning with gcc r300932: Catch malloc(3) errors and socket(2) errors - malloc failing will result in a delayed segfault - socket failing will result in delayed failures with setsockopt Exit in the event that either of these high-level conditions are met. CID: 976288, 976321, 976858 r300934: Plug leak with ifp by calling freeifaddrs after calling getifaddrs Obtained from: NetBSD v1.18 r300941: Don't leak res in network_init(..) Call freeaddrinfo on it after it's been used CID: 1225050 r300972 (by markj): Fix rpcbind init after r300941. - getaddrinfo() sets res = NULL on failure and freeaddrinfo() always dereferences its argument, so we should only free the address list after a successful call. - Address a second potential leak caused by getaddrinfo(AF_INET6) overwriting the address list returned by getaddrinfo(AF_INET). X-MFC-With: r300941 r300973: Follow up to r300932 In the event MK_INET6 != no in userspace, but is disabled in the kernel, or if there aren't any IPv6 addresses configured in userspace (for lo0 and all physical interfaces), rpcbind would terminate immediately instead of silently failing on Skip over the IPv6 block to its respective cleanup with freeifaddrs if creating the socket failed instead of terminating rpcbind immediately Modified: stable/10/usr.sbin/rpcbind/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/util.c ============================================================================== --- stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 15:38:19 2016 (r301635) +++ stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 15:41:39 2016 (r301636) @@ -119,7 +119,9 @@ addrmerge(struct netbuf *caller, const c struct sockaddr_storage ss; struct netconfig *nconf; char *caller_uaddr = NULL; +#ifdef ND_DEBUG const char *hint_uaddr = NULL; +#endif char *ret = NULL; int bestif_goodness; @@ -140,13 +142,17 @@ addrmerge(struct netbuf *caller, const c */ hint_sa = NULL; if (clnt_uaddr != NULL) { +#ifdef ND_DEBUG hint_uaddr = clnt_uaddr; +#endif if ((hint_nbp = uaddr2taddr(nconf, clnt_uaddr)) == NULL) goto freeit; hint_sa = hint_nbp->buf; } if (hint_sa == NULL || hint_sa->sa_family != caller_sa->sa_family) { +#ifdef ND_DEBUG hint_uaddr = caller_uaddr; +#endif hint_sa = caller->buf; } @@ -330,8 +336,10 @@ network_init(void) if (local_in4 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip4 addr\n"); + exit(1); } memcpy(local_in4, res->ai_addr, sizeof *local_in4); + freeaddrinfo(res); } #ifdef INET6 @@ -345,8 +353,10 @@ network_init(void) if (local_in6 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip6 addr\n"); + exit(1); } memcpy(local_in6, res->ai_addr, sizeof *local_in6); + freeaddrinfo(res); } /* @@ -359,6 +369,11 @@ network_init(void) inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + if (s == -1) { + if (debugging) + fprintf(stderr, "couldn't create ip6 socket"); + goto done_inet6; + } /* * Loop through all interfaces. For each IPv6 multicast-capable @@ -380,6 +395,8 @@ network_init(void) if (debugging) perror("setsockopt v6 multicast"); } +done_inet6: + freeifaddrs(ifp); #endif /* close(s); */ From owner-svn-src-all@freebsd.org Wed Jun 8 16:07:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64DEAB6F54E for ; Wed, 8 Jun 2016 16:07:56 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA57014A7 for ; Wed, 8 Jun 2016 16:07:55 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f52.google.com with SMTP id j5so8979699lfb.3 for ; Wed, 08 Jun 2016 09:07:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=QUqpsSH2y0pkpAucdMObt6+VMue0cZy4tsg4xmz8ZLk=; b=I7AjNDjRZtzxmi4YN2EtKrbngYGwU9gr7zN2Sfs6wWUOStnIZphB0RYkkq4aauEez0 5z176v3MA1aLFuQrkc0XldZVlOh4+Wh0VSUP0WoMPvLVJrYPZ8z0IxchFnJoZ0uKJdh+ ItJN61nX0RlRH6SqLpRTL67VGhv/5ijqXy7dVrgjIXS5hR0VCaqX2/i1BDg4omNrlp98 kZHzLLRX3UFrwIcKRzZg9VBBzNUDIqV5d6urhxEgg1Csgyzcerc2gec2nmomTK1eyhS5 6de0qO9EDOvzidALj3o6QzFf226MF3dtq4+4IZKz3KexCWvli7hi3KgZKCagQRKnEm2X wJoQ== X-Gm-Message-State: ALyK8tK2c/yQHSlNUha4xZyhQtq1/5khX2uvn+Xa3CfZg67F9LCinagLQ/yp/vkKrIv6TQ== X-Received: by 10.25.43.135 with SMTP id r129mr4248830lfr.63.1465401735113; Wed, 08 Jun 2016 09:02:15 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id e16sm207889lfb.23.2016.06.08.09.02.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2016 09:02:14 -0700 (PDT) Subject: Re: svn commit: r301577 - stable/10/etc/periodic/daily To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201606080308.u5838bcQ098576@repo.freebsd.org> From: Andrey Chernov Message-ID: Date: Wed, 8 Jun 2016 19:02:12 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606080308.u5838bcQ098576@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:07:56 -0000 The code still is called only if $daily_ntpd_leapfile_enable is YES and it is NO by default. On 08.06.2016 6:08, Cy Schubert wrote: > Author: cy > Date: Wed Jun 8 03:08:37 2016 > New Revision: 301577 > URL: https://svnweb.freebsd.org/changeset/base/301577 > > Log: > MFC r301102: > > Don't rely on $ntpd_enable to periodically fetch the latest leapfile. > > Suggested by: cperciva > > Modified: > stable/10/etc/periodic/daily/480.leapfile-ntpd > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd > ============================================================================== > --- stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 02:39:10 2016 (r301576) > +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:08:37 2016 (r301577) > @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in > case "$daily_ntpd_avoid_congestion" in > [Yy][Ee][Ss]) > # Avoid dogpiling > - (sleep $(jot -r 1 0 86400); service ntpd fetch) & > + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & > ;; > *) > - service ntpd fetch > + service ntpd onefetch > ;; > esac > ;; > From owner-svn-src-all@freebsd.org Wed Jun 8 16:08:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E336B6F56A; Wed, 8 Jun 2016 16:08:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7E814F4; Wed, 8 Jun 2016 16:08:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58G86AC097176; Wed, 8 Jun 2016 16:08:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58G86sK097174; Wed, 8 Jun 2016 16:08:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606081608.u58G86sK097174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 8 Jun 2016 16:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301638 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:08:07 -0000 Author: adrian Date: Wed Jun 8 16:08:05 2016 New Revision: 301638 URL: https://svnweb.freebsd.org/changeset/base/301638 Log: [ath_hal] initialise ah_beaconInterval when the AP/IBSS/TDMA beacon is setup. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Wed Jun 8 16:03:04 2016 (r301637) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Wed Jun 8 16:08:05 2016 (r301638) @@ -898,6 +898,8 @@ struct ath_hal_9300 { struct ar9300NfLimits nf_2GHz; struct ar9300NfLimits nf_5GHz; struct ar9300NfLimits *nfp; + + uint32_t ah_beaconInterval; }; #define AH9300(_ah) ((struct ath_hal_9300 *)(_ah)) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Wed Jun 8 16:03:04 2016 (r301637) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Wed Jun 8 16:08:05 2016 (r301638) @@ -774,8 +774,7 @@ ar9300_beacon_set_beacon_timers(struct a OS_REG_WRITE(ah, AR_NEXT_NDP_TIMER, TU_TO_USEC(bt->bt_nextatim)); bperiod = TU_TO_USEC(bt->bt_intval & HAL_BEACON_PERIOD); - /* XXX TODO! */ -// ahp->ah_beaconInterval = bt->bt_intval & HAL_BEACON_PERIOD; + AH9300(ah)->ah_beaconInterval = bt->bt_intval & HAL_BEACON_PERIOD; OS_REG_WRITE(ah, AR_BEACON_PERIOD, bperiod); OS_REG_WRITE(ah, AR_DMA_BEACON_PERIOD, bperiod); OS_REG_WRITE(ah, AR_SWBA_PERIOD, bperiod); From owner-svn-src-all@freebsd.org Wed Jun 8 16:10:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9ACAB6F670; Wed, 8 Jun 2016 16:10:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2DBE18E9; Wed, 8 Jun 2016 16:10:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58GAYiD097320; Wed, 8 Jun 2016 16:10:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58GAYjH097319; Wed, 8 Jun 2016 16:10:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606081610.u58GAYjH097319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 8 Jun 2016 16:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301639 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:10:36 -0000 Author: adrian Date: Wed Jun 8 16:10:34 2016 New Revision: 301639 URL: https://svnweb.freebsd.org/changeset/base/301639 Log: [ath_hal] correctly initialise the CAB queue default value * Allow readyTime to just be programmed in directly * The beacon interval and all of the beacon timing sysctl's are in TU, not TSF. So, we were doing the wrong math on the CAB programming in the first place. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Wed Jun 8 16:08:05 2016 (r301638) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Wed Jun 8 16:10:34 2016 (r301639) @@ -422,11 +422,29 @@ ar9300_reset_tx_queue(struct ath_hal *ah | AR_Q_MISC_CBR_INCR_DIS1 | AR_Q_MISC_CBR_INCR_DIS0); - value = TU_TO_USEC(qi->tqi_readyTime) - - (ah->ah_config.ah_sw_beacon_response_time - - ah->ah_config.ah_dma_beacon_response_time) - - ah->ah_config.ah_additional_swba_backoff; - OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_EN); + if (qi->tqi_readyTime) { + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(qi->tqi_readyTime, AR_Q_RDYTIMECFG_DURATION) | + AR_Q_RDYTIMECFG_EN); + } else { + + value = (ahp->ah_beaconInterval * 50 / 100) + - ah->ah_config.ah_additional_swba_backoff + - ah->ah_config.ah_sw_beacon_response_time + + ah->ah_config.ah_dma_beacon_response_time; + /* + * XXX Ensure it isn't too low - nothing lower + * XXX than 10 TU + */ + if (value < 10) + value = 10; + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: defaulting to rdytime = %d uS\n", + __func__, value); + OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), + SM(TU_TO_USEC(value), AR_Q_RDYTIMECFG_DURATION) | + AR_Q_RDYTIMECFG_EN); + } OS_REG_WRITE(ah, AR_DMISC(q), OS_REG_READ(ah, AR_DMISC(q)) | (AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL << From owner-svn-src-all@freebsd.org Wed Jun 8 16:21:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB93B6FA1C; Wed, 8 Jun 2016 16:21:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F09311070; Wed, 8 Jun 2016 16:21:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58GLdLc001897; Wed, 8 Jun 2016 16:21:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58GLduO001896; Wed, 8 Jun 2016 16:21:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606081621.u58GLduO001896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 8 Jun 2016 16:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301640 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:21:40 -0000 Author: adrian Date: Wed Jun 8 16:21:38 2016 New Revision: 301640 URL: https://svnweb.freebsd.org/changeset/base/301640 Log: [ath_hal] add a _S so FSP (frame scheduling policy) can be set/read via SM/MS macros. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h Wed Jun 8 16:10:34 2016 (r301639) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h Wed Jun 8 16:21:38 2016 (r301640) @@ -506,6 +506,7 @@ #define AR_Q0_MISC AR_MAC_QCU_OFFSET(MAC_QCU_MISC) #define AR_QMISC(_i) (AR_Q0_MISC + ((_i)<<2)) #define AR_Q_MISC_FSP 0x0000000F // Mask for Frame Scheduling Policy +#define AR_Q_MISC_FSP_S 0 #define AR_Q_MISC_FSP_ASAP 0 // ASAP #define AR_Q_MISC_FSP_CBR 1 // CBR #define AR_Q_MISC_FSP_DBA_GATED 2 // DMA Beacon Alert gated From owner-svn-src-all@freebsd.org Wed Jun 8 16:26:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E743DB6FAE1; Wed, 8 Jun 2016 16:26:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B299C130C; Wed, 8 Jun 2016 16:26:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58GQic1004740; Wed, 8 Jun 2016 16:26:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58GQiaY004739; Wed, 8 Jun 2016 16:26:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606081626.u58GQiaY004739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 8 Jun 2016 16:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301641 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:26:46 -0000 Author: adrian Date: Wed Jun 8 16:26:44 2016 New Revision: 301641 URL: https://svnweb.freebsd.org/changeset/base/301641 Log: [ath_hal] modify the xmit code to use temporary variables for setting qmisc/dmisc. This is in preparation for some other TDMA fixes which will hopefully end with having working TDMA. But, it does avoid lots of read/modify/writes in the txq setup path. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Wed Jun 8 16:21:38 2016 (r301640) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Wed Jun 8 16:26:44 2016 (r301641) @@ -288,6 +288,7 @@ ar9300_reset_tx_queue(struct ath_hal *ah const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; HAL_TX_QUEUE_INFO *qi; u_int32_t cw_min, chan_cw_min, value; + uint32_t qmisc, dmisc; if (q >= p_cap->halTotalQueues) { HALDEBUG(ah, HAL_DEBUG_QUEUE, "%s: invalid queue num %u\n", __func__, q); @@ -335,17 +336,15 @@ ar9300_reset_tx_queue(struct ath_hal *ah SM(qi->tqi_shretry, AR_D_RETRY_LIMIT_FR_SH)); /* enable early termination on the QCU */ - OS_REG_WRITE(ah, AR_QMISC(q), AR_Q_MISC_DCU_EARLY_TERM_REQ); + qmisc = AR_Q_MISC_DCU_EARLY_TERM_REQ; /* enable DCU to wait for next fragment from QCU */ if (AR_SREV_WASP(ah) && (AH_PRIVATE((ah))->ah_macRev <= AR_SREV_REVISION_WASP_12)) { /* WAR for EV#85395: Wasp Rx overrun issue - reduces Tx queue backoff * threshold to 1 to avoid Rx overruns - Fixed in Wasp 1.3 */ - OS_REG_WRITE(ah, AR_DMISC(q), - AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x1); + dmisc = AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x1; } else { - OS_REG_WRITE(ah, AR_DMISC(q), - AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x2); + dmisc = AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x2; } /* multiqueue support */ @@ -355,11 +354,9 @@ ar9300_reset_tx_queue(struct ath_hal *ah SM(qi->tqi_cbrPeriod, AR_Q_CBRCFG_INTERVAL) | SM(qi->tqi_cbrOverflowLimit, AR_Q_CBRCFG_OVF_THRESH)); - OS_REG_WRITE(ah, AR_QMISC(q), - OS_REG_READ(ah, AR_QMISC(q)) | - AR_Q_MISC_FSP_CBR | + qmisc |= AR_Q_MISC_FSP_CBR | (qi->tqi_cbrOverflowLimit ? - AR_Q_MISC_CBR_EXP_CNTR_LIMIT_EN : 0)); + AR_Q_MISC_CBR_EXP_CNTR_LIMIT_EN : 0); } if (qi->tqi_readyTime && (qi->tqi_type != HAL_TX_QUEUE_CAB)) { @@ -374,34 +371,27 @@ ar9300_reset_tx_queue(struct ath_hal *ah if (qi->tqi_burstTime && (qi->tqi_qflags & HAL_TXQ_RDYTIME_EXP_POLICY_ENABLE)) { - OS_REG_WRITE(ah, AR_QMISC(q), OS_REG_READ(ah, AR_QMISC(q)) | - AR_Q_MISC_RDYTIME_EXP_POLICY); + qmisc |= AR_Q_MISC_RDYTIME_EXP_POLICY; } if (qi->tqi_qflags & HAL_TXQ_BACKOFF_DISABLE) { - OS_REG_WRITE(ah, AR_DMISC(q), OS_REG_READ(ah, AR_DMISC(q)) | - AR_D_MISC_POST_FR_BKOFF_DIS); + dmisc |= AR_D_MISC_POST_FR_BKOFF_DIS; } if (qi->tqi_qflags & HAL_TXQ_FRAG_BURST_BACKOFF_ENABLE) { - OS_REG_WRITE(ah, AR_DMISC(q), OS_REG_READ(ah, AR_DMISC(q)) | - AR_D_MISC_FRAG_BKOFF_EN); + dmisc |= AR_D_MISC_FRAG_BKOFF_EN; } switch (qi->tqi_type) { case HAL_TX_QUEUE_BEACON: /* beacon frames */ - OS_REG_WRITE(ah, AR_QMISC(q), - OS_REG_READ(ah, AR_QMISC(q)) - | AR_Q_MISC_FSP_DBA_GATED + qmisc |= AR_Q_MISC_FSP_DBA_GATED | AR_Q_MISC_BEACON_USE - | AR_Q_MISC_CBR_INCR_DIS1); + | AR_Q_MISC_CBR_INCR_DIS1; - OS_REG_WRITE(ah, AR_DMISC(q), - OS_REG_READ(ah, AR_DMISC(q)) - | (AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL << + dmisc |= (AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL << AR_D_MISC_ARB_LOCKOUT_CNTRL_S) | AR_D_MISC_BEACON_USE - | AR_D_MISC_POST_FR_BKOFF_DIS); + | AR_D_MISC_POST_FR_BKOFF_DIS; /* XXX cwmin and cwmax should be 0 for beacon queue */ if (AH_PRIVATE(ah)->ah_opmode != HAL_M_IBSS) { OS_REG_WRITE(ah, AR_DLCL_IFS(q), SM(0, AR_D_LCL_IFS_CWMIN) @@ -416,11 +406,9 @@ ar9300_reset_tx_queue(struct ath_hal *ah * not properly refreshing the Tx descriptor if * the TXE clear setting is used. */ - OS_REG_WRITE(ah, AR_QMISC(q), - OS_REG_READ(ah, AR_QMISC(q)) - | AR_Q_MISC_FSP_DBA_GATED + qmisc |= AR_Q_MISC_FSP_DBA_GATED | AR_Q_MISC_CBR_INCR_DIS1 - | AR_Q_MISC_CBR_INCR_DIS0); + | AR_Q_MISC_CBR_INCR_DIS0; if (qi->tqi_readyTime) { OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), @@ -446,9 +434,8 @@ ar9300_reset_tx_queue(struct ath_hal *ah AR_Q_RDYTIMECFG_EN); } - OS_REG_WRITE(ah, AR_DMISC(q), OS_REG_READ(ah, AR_DMISC(q)) - | (AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL << - AR_D_MISC_ARB_LOCKOUT_CNTRL_S)); + dmisc |= (AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL << + AR_D_MISC_ARB_LOCKOUT_CNTRL_S); break; case HAL_TX_QUEUE_PSPOLL: /* @@ -459,12 +446,10 @@ ar9300_reset_tx_queue(struct ath_hal *ah * non-TIM elements and send PS-poll PS poll processing * will be done in software */ - OS_REG_WRITE(ah, AR_QMISC(q), - OS_REG_READ(ah, AR_QMISC(q)) | AR_Q_MISC_CBR_INCR_DIS1); + qmisc |= AR_Q_MISC_CBR_INCR_DIS1; break; case HAL_TX_QUEUE_UAPSD: - OS_REG_WRITE(ah, AR_DMISC(q), OS_REG_READ(ah, AR_DMISC(q)) - | AR_D_MISC_POST_FR_BKOFF_DIS); + dmisc |= AR_D_MISC_POST_FR_BKOFF_DIS; break; default: /* NB: silence compiler */ break; @@ -479,15 +464,15 @@ ar9300_reset_tx_queue(struct ath_hal *ah * queue_info->dcumode. */ if (qi->tqi_intFlags & HAL_TXQ_USE_LOCKOUT_BKOFF_DIS) { - OS_REG_WRITE(ah, AR_DMISC(q), - OS_REG_READ(ah, AR_DMISC(q)) | - SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, + dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, AR_D_MISC_ARB_LOCKOUT_CNTRL) | - AR_D_MISC_POST_FR_BKOFF_DIS); + AR_D_MISC_POST_FR_BKOFF_DIS; } #endif OS_REG_WRITE(ah, AR_Q_DESC_CRCCHK, AR_Q_DESC_CRCCHK_EN); + OS_REG_WRITE(ah, AR_QMISC(q), qmisc); + OS_REG_WRITE(ah, AR_DMISC(q), dmisc); /* * Always update the secondary interrupt mask registers - this From owner-svn-src-all@freebsd.org Wed Jun 8 16:56:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F568B6F229; Wed, 8 Jun 2016 16:56:07 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 213F51358; Wed, 8 Jun 2016 16:56:06 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id AglubHm7q7qnxAglvbqD25; Wed, 08 Jun 2016 10:56:05 -0600 X-Authority-Analysis: v=2.2 cv=SeW1TbZu c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=Kmfb5eCDVM_NwREuCT0A:9 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 3319713751; Wed, 8 Jun 2016 09:56:02 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u58Gu19q088458; Wed, 8 Jun 2016 09:56:01 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606081656.u58Gu19q088458@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Andrey Chernov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r301577 - stable/10/etc/periodic/daily In-Reply-To: Message from Andrey Chernov of "Wed, 08 Jun 2016 19:02:12 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 08 Jun 2016 09:56:01 -0700 X-CMAE-Envelope: MS4wfKPLBKtkHrDNJE2mBiFVpdww08fpeUf7wXknfCS4fuVfug5AxeclKrPTUzwmaEl8+KrfbvL6VYg1FtOzJ0nk17xRNOoB59NZKrjo42XACGZuwtgRrc5y pt4PLgvHx9DDdMYZ5SQbq/oZMtcIzy6QoVjoe9Jcz3XOpYgDvp3cyOGv/BQUr8a4P9RH1Cv9haHpLwnBWlAVGhj46GKWyBuzn3V35txuk62nHx/yvIy8wjid ox9h3iOTjrVTxz141x2LpF3AEdlWcQtPqznK5+4cR3AaKdx4FZIyQJrxLIDhu2lIBlr8FrfcpBO5HHjYhQF0WmamHh+AJWFTmJ34G9xVdVn2fwG2c7Zvp1gK i54FRIgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:56:07 -0000 In message , Andrey Chernov w rites: > The code still is called only if $daily_ntpd_leapfile_enable is YES and > it is NO by default. Yes, that will be MFCd on Friday, June 10. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. > > On 08.06.2016 6:08, Cy Schubert wrote: > > Author: cy > > Date: Wed Jun 8 03:08:37 2016 > > New Revision: 301577 > > URL: https://svnweb.freebsd.org/changeset/base/301577 > > > > Log: > > MFC r301102: > > > > Don't rely on $ntpd_enable to periodically fetch the latest leapfile. > > > > Suggested by: cperciva > > > > Modified: > > stable/10/etc/periodic/daily/480.leapfile-ntpd > > Directory Properties: > > stable/10/ (props changed) > > > > Modified: stable/10/etc/periodic/daily/480.leapfile-ntpd > > =========================================================================== > === > > --- stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 02:39:10 201 > 6 (r301576) > > +++ stable/10/etc/periodic/daily/480.leapfile-ntpd Wed Jun 8 03:08:37 201 > 6 (r301577) > > @@ -16,10 +16,10 @@ case "$daily_ntpd_leapfile_enable" in > > case "$daily_ntpd_avoid_congestion" in > > [Yy][Ee][Ss]) > > # Avoid dogpiling > > - (sleep $(jot -r 1 0 86400); service ntpd fetch) & > > + (sleep $(jot -r 1 0 86400); service ntpd onefetch) & > > ;; > > *) > > - service ntpd fetch > > + service ntpd onefetch > > ;; > > esac > > ;; > > > From owner-svn-src-all@freebsd.org Wed Jun 8 16:59:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F01FAB6F31F; Wed, 8 Jun 2016 16:59:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA3AD16BC; Wed, 8 Jun 2016 16:59:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Gx9aj015964; Wed, 8 Jun 2016 16:59:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Gx9In015961; Wed, 8 Jun 2016 16:59:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081659.u58Gx9In015961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 16:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301642 - stable/9/usr.sbin/rpcbind X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 16:59:11 -0000 Author: ngie Date: Wed Jun 8 16:59:09 2016 New Revision: 301642 URL: https://svnweb.freebsd.org/changeset/base/301642 Log: MFstable/10 r296994: r296994 (by asomers): MFC r293229, r293833 to usr.sbin/rpcbind r293833 | asomers | 2016-01-13 10:33:50 -0700 (Wed, 13 Jan 2016) | 16 lines Fix Coverity warnings regarding r293229 rpcbind/check_bound.c Fix CID1347798, a memory leak in mergeaddr. rpcbind/tests/addrmerge_test.c Fix CID1347800 through CID1347803, memory leaks in ATF tests. They are harmless because each ATF test case runs in its own process, but they are trivial to fix. Fix a few other leaks that Coverity didn't detect, too. r293229 | asomers | 2016-01-05 17:00:11 -0700 (Tue, 05 Jan 2016) | 36 lines "source routing" in rpcbind Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on two separate subnets, and a client on the first subnet contacted rpcbind at the address on the second subnet, rpcbind would advertise addresses on the first subnet. This is a bug, because it should prefer to advertise the address where it was contacted. The requested service might be firewalled off from the address on the first subnet, for example. usr.sbin/rpcbind/check_bound.c If the address on which a request was received is known, pass that to addrmerge as the clnt_uaddr parameter. That is what addrmerge's comment indicates the parameter is supposed to mean. The previous behavior is that clnt_uaddr would contain the address from which the client sent the request. usr.sbin/rpcbind/util.c Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr, if one is found. Refactor the relevant portion of the function for clarity, and to reduce the number of ifdefs. etc/mtree/BSD.tests.dist usr.sbin/rpcbind/tests/Makefile usr.sbin/rpcbind/tests/addrmerge_test.c Add unit tests for usr.sbin/rpcbind/util.c:addrmerge. usr.sbin/rpcbind/check_bound.c usr.sbin/rpcbind/rpcbind.h usr.sbin/rpcbind/util.c Constify some function arguments Modified: stable/9/usr.sbin/rpcbind/check_bound.c stable/9/usr.sbin/rpcbind/rpcbind.h stable/9/usr.sbin/rpcbind/util.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/rpcbind/check_bound.c ============================================================================== --- stable/9/usr.sbin/rpcbind/check_bound.c Wed Jun 8 16:26:44 2016 (r301641) +++ stable/9/usr.sbin/rpcbind/check_bound.c Wed Jun 8 16:59:09 2016 (r301642) @@ -51,6 +51,7 @@ static char sccsid[] = "@(#)check_bound. #include #include #include +#include #include #include #include @@ -160,6 +161,7 @@ char * mergeaddr(SVCXPRT *xprt, char *netid, char *uaddr, char *saddr) { struct fdlist *fdl; + struct svc_dg_data *dg_data; char *c_uaddr, *s_uaddr, *m_uaddr, *allocated_uaddr = NULL; for (fdl = fdhead; fdl; fdl = fdl->next) @@ -171,21 +173,31 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch /* that server died */ return (nullstring); /* + * Try to determine the local address on which the client contacted us, + * so we can send a reply from the same address. If it's unknown, then + * try to determine which address the client used, and pick a nearby + * local address. + * * If saddr is not NULL, the remote client may have included the * address by which it contacted us. Use that for the "client" uaddr, * otherwise use the info from the SVCXPRT. */ - if (saddr != NULL) { + dg_data = (struct svc_dg_data*)xprt->xp_p2; + if (dg_data != NULL && dg_data->su_srcaddr.buf != NULL) { + c_uaddr = taddr2uaddr(fdl->nconf, &dg_data->su_srcaddr); + allocated_uaddr = c_uaddr; + } + else if (saddr != NULL) { c_uaddr = saddr; } else { c_uaddr = taddr2uaddr(fdl->nconf, svc_getrpccaller(xprt)); - if (c_uaddr == NULL) { - syslog(LOG_ERR, "taddr2uaddr failed for %s", - fdl->nconf->nc_netid); - return (NULL); - } allocated_uaddr = c_uaddr; } + if (c_uaddr == NULL) { + syslog(LOG_ERR, "taddr2uaddr failed for %s", + fdl->nconf->nc_netid); + return (NULL); + } #ifdef ND_DEBUG if (debugging) { @@ -218,7 +230,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch * structure should not be freed. */ struct netconfig * -rpcbind_get_conf(char *netid) +rpcbind_get_conf(const char *netid) { struct fdlist *fdl; Modified: stable/9/usr.sbin/rpcbind/rpcbind.h ============================================================================== --- stable/9/usr.sbin/rpcbind/rpcbind.h Wed Jun 8 16:26:44 2016 (r301641) +++ stable/9/usr.sbin/rpcbind/rpcbind.h Wed Jun 8 16:59:09 2016 (r301642) @@ -83,7 +83,7 @@ extern char *tcp_uaddr; /* Universal TC int add_bndlist(struct netconfig *, struct netbuf *); bool_t is_bound(char *, char *); char *mergeaddr(SVCXPRT *, char *, char *, char *); -struct netconfig *rpcbind_get_conf(char *); +struct netconfig *rpcbind_get_conf(const char *); void rpcbs_init(void); void rpcbs_procinfo(rpcvers_t, rpcproc_t); @@ -132,8 +132,8 @@ extern void pmap_service(struct svc_req void write_warmstart(void); void read_warmstart(void); -char *addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, - char *netid); +char *addrmerge(struct netbuf *caller, const char *serv_uaddr, + const char *clnt_uaddr, char const *netid); int listen_addr(const struct sockaddr *sa); void network_init(void); struct sockaddr *local_sa(int); Modified: stable/9/usr.sbin/rpcbind/util.c ============================================================================== --- stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 16:26:44 2016 (r301641) +++ stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 16:59:09 2016 (r301642) @@ -56,7 +56,7 @@ static struct sockaddr_in *local_in4; static struct sockaddr_in6 *local_in6; #endif -static int bitmaskcmp(void *, void *, void *, int); +static int bitmaskcmp(struct sockaddr *, struct sockaddr *, struct sockaddr *); #ifdef INET6 static void in6_fillscopeid(struct sockaddr_in6 *); #endif @@ -67,10 +67,34 @@ static void in6_fillscopeid(struct socka * match. */ static int -bitmaskcmp(void *dst, void *src, void *mask, int bytelen) +bitmaskcmp(struct sockaddr *dst, struct sockaddr *src, struct sockaddr *mask) { int i; - u_int8_t *p1 = dst, *p2 = src, *netmask = mask; + u_int8_t *p1, *p2, *netmask; + int bytelen; + + if (dst->sa_family != src->sa_family || + dst->sa_family != mask->sa_family) + return (1); + + switch (dst->sa_family) { + case AF_INET: + p1 = (uint8_t*) &SA2SINADDR(dst); + p2 = (uint8_t*) &SA2SINADDR(src); + netmask = (uint8_t*) &SA2SINADDR(mask); + bytelen = sizeof(struct in_addr); + break; +#ifdef INET6 + case AF_INET6: + p1 = (uint8_t*) &SA2SIN6ADDR(dst); + p2 = (uint8_t*) &SA2SIN6ADDR(src); + netmask = (uint8_t*) &SA2SIN6ADDR(mask); + bytelen = sizeof(struct in6_addr); + break; +#endif + default: + return (1); + } for (i = 0; i < bytelen; i++) if ((p1[i] & netmask[i]) != (p2[i] & netmask[i])) @@ -109,16 +133,18 @@ in6_fillscopeid(struct sockaddr_in6 *sin * string which should be freed by the caller. On error, returns NULL. */ char * -addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, - char *netid) +addrmerge(struct netbuf *caller, const char *serv_uaddr, const char *clnt_uaddr, + const char *netid) { struct ifaddrs *ifap, *ifp = NULL, *bestif; struct netbuf *serv_nbp = NULL, *hint_nbp = NULL, tbuf; struct sockaddr *caller_sa, *hint_sa, *ifsa, *ifmasksa, *serv_sa; struct sockaddr_storage ss; struct netconfig *nconf; - char *caller_uaddr = NULL, *hint_uaddr = NULL; + char *caller_uaddr = NULL; + const char *hint_uaddr = NULL; char *ret = NULL; + int bestif_goodness; #ifdef ND_DEBUG if (debugging) @@ -162,19 +188,29 @@ addrmerge(struct netbuf *caller, char *s goto freeit; /* - * Loop through all interfaces. For each interface, see if it - * is either the loopback interface (which we always listen - * on) or is one of the addresses the program bound to (the - * wildcard by default, or a subset if -h is specified) and - * the network portion of its address is equal to that of the - * client. If so, we have found the interface that we want to - * use. + * Loop through all interface addresses. We are listening to an address + * if any of the following are true: + * a) It's a loopback address + * b) It was specified with the -h command line option + * c) There were no -h command line options. + * + * Among addresses on which we are listening, choose in order of + * preference an address that is: + * + * a) Equal to the hint + * b) A link local address with the same scope ID as the client's + * address, if the client's address is also link local + * c) An address on the same subnet as the client's address + * d) A non-localhost, non-p2p address + * e) Any usable address */ bestif = NULL; + bestif_goodness = 0; for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { ifsa = ifap->ifa_addr; ifmasksa = ifap->ifa_netmask; + /* Skip addresses where we don't listen */ if (ifsa == NULL || ifsa->sa_family != hint_sa->sa_family || !(ifap->ifa_flags & IFF_UP)) continue; @@ -182,21 +218,29 @@ addrmerge(struct netbuf *caller, char *s if (!(ifap->ifa_flags & IFF_LOOPBACK) && !listen_addr(ifsa)) continue; - switch (hint_sa->sa_family) { - case AF_INET: - /* - * If the hint address matches this interface - * address/netmask, then we're done. - */ - if (!bitmaskcmp(&SA2SINADDR(ifsa), - &SA2SINADDR(hint_sa), &SA2SINADDR(ifmasksa), - sizeof(struct in_addr))) { - bestif = ifap; - goto found; - } - break; + if ((hint_sa->sa_family == AF_INET) && + ((((struct sockaddr_in*)hint_sa)->sin_addr.s_addr == + ((struct sockaddr_in*)ifsa)->sin_addr.s_addr))) { + const int goodness = 4; + + bestif_goodness = goodness; + bestif = ifap; + goto found; + } #ifdef INET6 - case AF_INET6: + if ((hint_sa->sa_family == AF_INET6) && + (0 == memcmp(&((struct sockaddr_in6*)hint_sa)->sin6_addr, + &((struct sockaddr_in6*)ifsa)->sin6_addr, + sizeof(struct in6_addr))) && + (((struct sockaddr_in6*)hint_sa)->sin6_scope_id == + (((struct sockaddr_in6*)ifsa)->sin6_scope_id))) { + const int goodness = 4; + + bestif_goodness = goodness; + bestif = ifap; + goto found; + } + if (hint_sa->sa_family == AF_INET6) { /* * For v6 link local addresses, if the caller is on * a link-local address then use the scope id to see @@ -208,28 +252,33 @@ addrmerge(struct netbuf *caller, char *s IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa))) { if (SA2SIN6(ifsa)->sin6_scope_id == SA2SIN6(caller_sa)->sin6_scope_id) { - bestif = ifap; - goto found; + const int goodness = 3; + + if (bestif_goodness < goodness) { + bestif = ifap; + bestif_goodness = goodness; + } } - } else if (!bitmaskcmp(&SA2SIN6ADDR(ifsa), - &SA2SIN6ADDR(hint_sa), &SA2SIN6ADDR(ifmasksa), - sizeof(struct in6_addr))) { + } + } +#endif /* INET6 */ + if (0 == bitmaskcmp(hint_sa, ifsa, ifmasksa)) { + const int goodness = 2; + + if (bestif_goodness < goodness) { bestif = ifap; - goto found; + bestif_goodness = goodness; } - break; -#endif - default: - continue; } + if (!(ifap->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + const int goodness = 1; - /* - * Remember the first possibly useful interface, preferring - * "normal" to point-to-point and loopback ones. - */ - if (bestif == NULL || - (!(ifap->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) && - (bestif->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)))) + if (bestif_goodness < goodness) { + bestif = ifap; + bestif_goodness = goodness; + } + } + if (bestif == NULL) bestif = ifap; } if (bestif == NULL) From owner-svn-src-all@freebsd.org Wed Jun 8 17:04:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B50B6F73F; Wed, 8 Jun 2016 17:04:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6451D37; Wed, 8 Jun 2016 17:04:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58H4FFl019465; Wed, 8 Jun 2016 17:04:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58H4Fou019464; Wed, 8 Jun 2016 17:04:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081704.u58H4Fou019464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301643 - stable/9/usr.sbin/rpcbind X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:04:16 -0000 Author: ngie Date: Wed Jun 8 17:04:15 2016 New Revision: 301643 URL: https://svnweb.freebsd.org/changeset/base/301643 Log: MFC r300932,r300934,r300941,r300972,r300973: r300932: Catch malloc(3) errors and socket(2) errors - malloc failing will result in a delayed segfault - socket failing will result in delayed failures with setsockopt Exit in the event that either of these high-level conditions are met. CID: 976288, 976321, 976858 r300934: Plug leak with ifp by calling freeifaddrs after calling getifaddrs Obtained from: NetBSD v1.18 r300941: Don't leak res in network_init(..) Call freeaddrinfo on it after it's been used CID: 1225050 r300972 (by markj): Fix rpcbind init after r300941. - getaddrinfo() sets res = NULL on failure and freeaddrinfo() always dereferences its argument, so we should only free the address list after a successful call. - Address a second potential leak caused by getaddrinfo(AF_INET6) overwriting the address list returned by getaddrinfo(AF_INET). X-MFC-With: r300941 r300973: Follow up to r300932 In the event MK_INET6 != no in userspace, but is disabled in the kernel, or if there aren't any IPv6 addresses configured in userspace (for lo0 and all physical interfaces), rpcbind would terminate immediately instead of silently failing on Skip over the IPv6 block to its respective cleanup with freeifaddrs if creating the socket failed instead of terminating rpcbind immediately Modified: stable/9/usr.sbin/rpcbind/util.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/rpcbind/util.c ============================================================================== --- stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 16:59:09 2016 (r301642) +++ stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 17:04:15 2016 (r301643) @@ -354,8 +354,10 @@ network_init(void) if (local_in4 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip4 addr\n"); + exit(1); } memcpy(local_in4, res->ai_addr, sizeof *local_in4); + freeaddrinfo(res); } #ifdef INET6 @@ -369,8 +371,10 @@ network_init(void) if (local_in6 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip6 addr\n"); + exit(1); } memcpy(local_in6, res->ai_addr, sizeof *local_in6); + freeaddrinfo(res); } /* @@ -383,6 +387,11 @@ network_init(void) inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + if (s == -1) { + if (debugging) + fprintf(stderr, "couldn't create ip6 socket"); + goto done_inet6; + } /* * Loop through all interfaces. For each IPv6 multicast-capable @@ -404,6 +413,8 @@ network_init(void) if (debugging) perror("setsockopt v6 multicast"); } +done_inet6: + freeifaddrs(ifp); #endif /* close(s); */ From owner-svn-src-all@freebsd.org Wed Jun 8 17:09:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDFA0B6F859; Wed, 8 Jun 2016 17:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 943091F45; Wed, 8 Jun 2016 17:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58H9lBu019725; Wed, 8 Jun 2016 17:09:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58H9lox019724; Wed, 8 Jun 2016 17:09:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081709.u58H9lox019724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301644 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:09:48 -0000 Author: ngie Date: Wed Jun 8 17:09:47 2016 New Revision: 301644 URL: https://svnweb.freebsd.org/changeset/base/301644 Log: MFC r300942: Remove a useless if (x != NULL) check before calling free on allocated_uaddr Modified: stable/10/usr.sbin/rpcbind/check_bound.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/check_bound.c ============================================================================== --- stable/10/usr.sbin/rpcbind/check_bound.c Wed Jun 8 17:04:15 2016 (r301643) +++ stable/10/usr.sbin/rpcbind/check_bound.c Wed Jun 8 17:09:47 2016 (r301644) @@ -220,8 +220,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch fprintf(stderr, "mergeaddr: uaddr = %s, merged uaddr = %s\n", uaddr, m_uaddr); #endif - if (allocated_uaddr != NULL) - free(allocated_uaddr); + free(allocated_uaddr); return (m_uaddr); } From owner-svn-src-all@freebsd.org Wed Jun 8 17:10:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E523FB6F9D4; Wed, 8 Jun 2016 17:10:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B780311FB; Wed, 8 Jun 2016 17:10:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HAhYT019993; Wed, 8 Jun 2016 17:10:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HAhsH019992; Wed, 8 Jun 2016 17:10:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081710.u58HAhsH019992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301645 - stable/9/usr.sbin/rpcbind X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:10:45 -0000 Author: ngie Date: Wed Jun 8 17:10:43 2016 New Revision: 301645 URL: https://svnweb.freebsd.org/changeset/base/301645 Log: MFstable/10 r301644: MFC r300942: Remove a useless if (x != NULL) check before calling free on allocated_uaddr Modified: stable/9/usr.sbin/rpcbind/check_bound.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/rpcbind/check_bound.c ============================================================================== --- stable/9/usr.sbin/rpcbind/check_bound.c Wed Jun 8 17:09:47 2016 (r301644) +++ stable/9/usr.sbin/rpcbind/check_bound.c Wed Jun 8 17:10:43 2016 (r301645) @@ -220,8 +220,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch fprintf(stderr, "mergeaddr: uaddr = %s, merged uaddr = %s\n", uaddr, m_uaddr); #endif - if (allocated_uaddr != NULL) - free(allocated_uaddr); + free(allocated_uaddr); return (m_uaddr); } From owner-svn-src-all@freebsd.org Wed Jun 8 17:11:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 889EBB6FA58; Wed, 8 Jun 2016 17:11:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58F0B1452; Wed, 8 Jun 2016 17:11:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HBgwK022677; Wed, 8 Jun 2016 17:11:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HBg1J022676; Wed, 8 Jun 2016 17:11:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081711.u58HBg1J022676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301646 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:11:43 -0000 Author: ngie Date: Wed Jun 8 17:11:42 2016 New Revision: 301646 URL: https://svnweb.freebsd.org/changeset/base/301646 Log: MFC r300945: Remove unnecessary caller_uaddr != NULL test before calling free on it Modified: stable/10/usr.sbin/rpcbind/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/util.c ============================================================================== --- stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 17:10:43 2016 (r301645) +++ stable/10/usr.sbin/rpcbind/util.c Wed Jun 8 17:11:42 2016 (r301646) @@ -293,8 +293,7 @@ found: ret = taddr2uaddr(nconf, &tbuf); freeit: - if (caller_uaddr != NULL) - free(caller_uaddr); + free(caller_uaddr); if (hint_nbp != NULL) { free(hint_nbp->buf); free(hint_nbp); From owner-svn-src-all@freebsd.org Wed Jun 8 17:12:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7733B6FB00; Wed, 8 Jun 2016 17:12:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 778A719AC; Wed, 8 Jun 2016 17:12:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HCbrM023535; Wed, 8 Jun 2016 17:12:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HCb88023534; Wed, 8 Jun 2016 17:12:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081712.u58HCb88023534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301647 - stable/9/usr.sbin/rpcbind X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:12:38 -0000 Author: ngie Date: Wed Jun 8 17:12:37 2016 New Revision: 301647 URL: https://svnweb.freebsd.org/changeset/base/301647 Log: MFstable/10 r301646: MFC r300945: Remove unnecessary caller_uaddr != NULL test before calling free on it Modified: stable/9/usr.sbin/rpcbind/util.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/rpcbind/util.c ============================================================================== --- stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 17:11:42 2016 (r301646) +++ stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 17:12:37 2016 (r301647) @@ -311,8 +311,7 @@ found: ret = taddr2uaddr(nconf, &tbuf); freeit: - if (caller_uaddr != NULL) - free(caller_uaddr); + free(caller_uaddr); if (hint_nbp != NULL) { free(hint_nbp->buf); free(hint_nbp); From owner-svn-src-all@freebsd.org Wed Jun 8 17:13:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C650BB6FB82; Wed, 8 Jun 2016 17:13:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9869C1B25; Wed, 8 Jun 2016 17:13:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HDSQp023625; Wed, 8 Jun 2016 17:13:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HDSbt023624; Wed, 8 Jun 2016 17:13:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081713.u58HDSbt023624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301648 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:13:29 -0000 Author: ngie Date: Wed Jun 8 17:13:28 2016 New Revision: 301648 URL: https://svnweb.freebsd.org/changeset/base/301648 Log: MFC r300947: Staticize variables only used in rpcbind.c This is some low hanging fruit necessary for making this WARNS?= 6 clean Modified: stable/10/usr.sbin/rpcbind/rpcbind.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/10/usr.sbin/rpcbind/rpcbind.c Wed Jun 8 17:12:37 2016 (r301647) +++ stable/10/usr.sbin/rpcbind/rpcbind.c Wed Jun 8 17:13:28 2016 (r301648) @@ -86,17 +86,17 @@ rpcblist_ptr list_rbl; /* A list of vers #define RPCBINDDLOCK "/var/run/rpcbind.lock" -int runasdaemon = 0; +static int runasdaemon = 0; int insecure = 0; int oldstyle_local = 0; int verboselog = 0; -char **hosts = NULL; -struct sockaddr **bound_sa; -int ipv6_only = 0; -int nhosts = 0; -int on = 1; -int rpcbindlockfd; +static char **hosts = NULL; +static struct sockaddr **bound_sa; +static int ipv6_only = 0; +static int nhosts = 0; +static int on = 1; +static int rpcbindlockfd; #ifdef WARMSTART /* Local Variable */ From owner-svn-src-all@freebsd.org Wed Jun 8 17:13:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A59B5B6FC0B; Wed, 8 Jun 2016 17:13:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7337C1D78; Wed, 8 Jun 2016 17:13:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HDvOx023791; Wed, 8 Jun 2016 17:13:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HDvt7023790; Wed, 8 Jun 2016 17:13:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081713.u58HDvt7023790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301649 - stable/9/usr.sbin/rpcbind X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:13:58 -0000 Author: ngie Date: Wed Jun 8 17:13:57 2016 New Revision: 301649 URL: https://svnweb.freebsd.org/changeset/base/301649 Log: MFstable/10 r301648: MFC r300947: Staticize variables only used in rpcbind.c This is some low hanging fruit necessary for making this WARNS?= 6 clean Modified: stable/9/usr.sbin/rpcbind/rpcbind.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/9/usr.sbin/rpcbind/rpcbind.c Wed Jun 8 17:13:28 2016 (r301648) +++ stable/9/usr.sbin/rpcbind/rpcbind.c Wed Jun 8 17:13:57 2016 (r301649) @@ -86,17 +86,17 @@ rpcblist_ptr list_rbl; /* A list of vers #define RPCBINDDLOCK "/var/run/rpcbind.lock" -int runasdaemon = 0; +static int runasdaemon = 0; int insecure = 0; int oldstyle_local = 0; int verboselog = 0; -char **hosts = NULL; -struct sockaddr **bound_sa; -int ipv6_only = 0; -int nhosts = 0; -int on = 1; -int rpcbindlockfd; +static char **hosts = NULL; +static struct sockaddr **bound_sa; +static int ipv6_only = 0; +static int nhosts = 0; +static int on = 1; +static int rpcbindlockfd; #ifdef WARMSTART /* Local Variable */ From owner-svn-src-all@freebsd.org Wed Jun 8 17:17:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6C96B6FD6F; Wed, 8 Jun 2016 17:17:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A65521205; Wed, 8 Jun 2016 17:17:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HH3fP024407; Wed, 8 Jun 2016 17:17:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HH3ei024406; Wed, 8 Jun 2016 17:17:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081717.u58HH3ei024406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301650 - stable/9/usr.sbin/rpcbind X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:17:05 -0000 Author: ngie Date: Wed Jun 8 17:17:03 2016 New Revision: 301650 URL: https://svnweb.freebsd.org/changeset/base/301650 Log: MFstable/10 r301636: MFC r300867,r300932,r300934,r300941,r300972,r300973: r300867: Only expose `hint_uaddr` in the ND_DEBUG case This fixes a -Wunused-but-set-variable warning with gcc r300932: Catch malloc(3) errors and socket(2) errors - malloc failing will result in a delayed segfault - socket failing will result in delayed failures with setsockopt Exit in the event that either of these high-level conditions are met. CID: 976288, 976321, 976858 r300934: Plug leak with ifp by calling freeifaddrs after calling getifaddrs Obtained from: NetBSD v1.18 r300941: Don't leak res in network_init(..) Call freeaddrinfo on it after it's been used CID: 1225050 r300972 (by markj): Fix rpcbind init after r300941. - getaddrinfo() sets res = NULL on failure and freeaddrinfo() always dereferences its argument, so we should only free the address list after a successful call. - Address a second potential leak caused by getaddrinfo(AF_INET6) overwriting the address list returned by getaddrinfo(AF_INET). X-MFC-With: r300941 r300973: Follow up to r300932 In the event MK_INET6 != no in userspace, but is disabled in the kernel, or if there aren't any IPv6 addresses configured in userspace (for lo0 and all physical interfaces), rpcbind would terminate immediately instead of silently failing on Skip over the IPv6 block to its respective cleanup with freeifaddrs if creating the socket failed instead of terminating rpcbind immediately Modified: stable/9/usr.sbin/rpcbind/util.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/rpcbind/util.c ============================================================================== --- stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 17:13:57 2016 (r301649) +++ stable/9/usr.sbin/rpcbind/util.c Wed Jun 8 17:17:03 2016 (r301650) @@ -142,7 +142,9 @@ addrmerge(struct netbuf *caller, const c struct sockaddr_storage ss; struct netconfig *nconf; char *caller_uaddr = NULL; +#ifdef ND_DEBUG const char *hint_uaddr = NULL; +#endif char *ret = NULL; int bestif_goodness; @@ -163,13 +165,17 @@ addrmerge(struct netbuf *caller, const c */ hint_sa = NULL; if (clnt_uaddr != NULL) { +#ifdef ND_DEBUG hint_uaddr = clnt_uaddr; +#endif if ((hint_nbp = uaddr2taddr(nconf, clnt_uaddr)) == NULL) goto freeit; hint_sa = hint_nbp->buf; } if (hint_sa == NULL || hint_sa->sa_family != caller_sa->sa_family) { +#ifdef ND_DEBUG hint_uaddr = caller_uaddr; +#endif hint_sa = caller->buf; } From owner-svn-src-all@freebsd.org Wed Jun 8 17:21:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85653B6FE7E; Wed, 8 Jun 2016 17:21:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5661861; Wed, 8 Jun 2016 17:21:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HLFtF024926; Wed, 8 Jun 2016 17:21:15 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HLFsP024925; Wed, 8 Jun 2016 17:21:15 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606081721.u58HLFsP024925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 8 Jun 2016 17:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301651 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:21:16 -0000 Author: avos Date: Wed Jun 8 17:21:15 2016 New Revision: 301651 URL: https://svnweb.freebsd.org/changeset/base/301651 Log: ifconfig: fix wlan creation when unit number is not provided (was broken after r300738). Reported by: Yoshihiro Ota , adrian Tested by: Yoshihiro Ota Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Jun 8 17:17:03 2016 (r301650) +++ head/sbin/ifconfig/ifieee80211.c Wed Jun 8 17:21:15 2016 (r301651) @@ -5190,6 +5190,7 @@ static void wlan_create(int s, struct ifreq *ifr) { static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; + char orig_name[IFNAMSIZ]; if (params.icp_parent[0] == '\0') errx(1, "must specify a parent device (wlandev) when creating " @@ -5201,7 +5202,13 @@ wlan_create(int s, struct ifreq *ifr) if (ioctl(s, SIOCIFCREATE2, ifr) < 0) err(1, "SIOCIFCREATE2"); + /* XXX preserve original name for ifclonecreate(). */ + strlcpy(orig_name, name, sizeof(orig_name)); + strlcpy(name, ifr->ifr_name, sizeof(name)); + setdefregdomain(s); + + strlcpy(name, orig_name, sizeof(name)); } static From owner-svn-src-all@freebsd.org Wed Jun 8 17:24:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32ACEB6F0BE; Wed, 8 Jun 2016 17:24:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3D61D4D; Wed, 8 Jun 2016 17:24:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HOvwV028833; Wed, 8 Jun 2016 17:24:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HOvqW028832; Wed, 8 Jun 2016 17:24:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081724.u58HOvqW028832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301652 - stable/9/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:24:58 -0000 Author: ngie Date: Wed Jun 8 17:24:57 2016 New Revision: 301652 URL: https://svnweb.freebsd.org/changeset/base/301652 Log: MFstable/10 r300475: MFC r299710,r299711,r299763,r299783,r299811: r299710: Staticize global variables only used in bsnmpimport.c to fix -Wmissing-variable-declarations warnings r299711: Fold two malloc + memset(.., 0, ..) calls into equivalent calloc calls r299763: Mute -Wstrlcpy-strlcat-size warning by using nitems with the size of the buffer This is a no-op as the malloc above set the size of the buffer to the size used below, but this keeps things consistent in case the malloc call changes somehow. r299783: Convert tok from enum tok to int32_t in function calls get_token(..) returns int32_t, not enum tok, and in many cases tests for items not in enum tok (e.g. '('). Make the typing consistent with get_token, which includes a domino effect of changing enum tok to int32_t. r299811: Use strdup instead of malloc + strlcpy Fix error messages on failure for calloc/strdup Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Wed Jun 8 17:21:15 2016 (r301651) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Wed Jun 8 17:24:57 2016 (r301652) @@ -140,9 +140,9 @@ struct input { LIST_ENTRY(input) link; }; -LIST_HEAD(, input) inputs = LIST_HEAD_INITIALIZER(inputs); -struct input *input = NULL; -int32_t pbchar = -1; +static LIST_HEAD(, input) inputs = LIST_HEAD_INITIALIZER(inputs); +static struct input *input = NULL; +static int32_t pbchar = -1; #define MAX_PATHS 100 @@ -301,18 +301,18 @@ static const struct { { NULL, 0, 0 } }; -struct { +static struct { /* Current OID type, regarding table membership. */ enum snmp_tbl_entry tbl_type; /* A pointer to a structure in table list to add to its members. */ struct snmp_index_entry *table_idx; } table_data; -struct asn_oid current_oid; -char nexttok[MAXSTR]; -u_long val; /* integer values */ -int32_t all_cond; /* all conditions are true */ -int32_t saved_token = -1; +static struct asn_oid current_oid; +static char nexttok[MAXSTR]; +static u_long val; /* integer values */ +static int32_t all_cond; /* all conditions are true */ +static int32_t saved_token = -1; /* Prepare the global data before parsing a new file. */ static void @@ -513,7 +513,7 @@ snmp_import_update_table(enum snmp_tbl_e } static int32_t -parse_enum(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +parse_enum(struct snmp_toolinfo *snmptoolctx, int32_t *tok, struct enum_pairs *enums) { while ((*tok = gettoken(snmptoolctx)) == TOK_STR) { @@ -532,7 +532,7 @@ parse_enum(struct snmp_toolinfo *snmptoo } static int32_t -parse_subtype(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +parse_subtype(struct snmp_toolinfo *snmptoolctx, int32_t *tok, enum snmp_tc *tc) { if ((*tok = gettoken(snmptoolctx)) != TOK_STR) { @@ -547,7 +547,7 @@ parse_subtype(struct snmp_toolinfo *snmp } static int32_t -parse_type(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +parse_type(struct snmp_toolinfo *snmptoolctx, int32_t *tok, enum snmp_tc *tc, struct enum_pairs **snmp_enum) { int32_t syntax, mem; @@ -630,17 +630,15 @@ snmp_import_head(struct snmp_toolinfo *s static int32_t snmp_import_table(struct snmp_toolinfo *snmptoolctx, struct snmp_oid2str *obj) { - int32_t i; + int32_t i, tok; enum snmp_tc tc; - enum tok tok; struct snmp_index_entry *entry; - if ((entry = malloc(sizeof(struct snmp_index_entry))) == NULL) { + if ((entry = calloc(1, sizeof(struct snmp_index_entry))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); } - memset(entry, 0, sizeof(struct snmp_index_entry)); STAILQ_INIT(&(entry->index_list)); for (i = 0, tok = gettoken(snmptoolctx); i < SNMP_INDEXES_MAX; i++) { @@ -705,7 +703,7 @@ snmp_import_table(struct snmp_toolinfo * * Read everything after the syntax type that is certainly a leaf OID info. */ static int32_t -snmp_import_leaf(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +snmp_import_leaf(struct snmp_toolinfo *snmptoolctx, int32_t *tok, struct snmp_oid2str *oid2str) { int32_t i, syntax; @@ -758,25 +756,23 @@ snmp_import_object(struct snmp_toolinfo { char *string; int i; - enum tok tok; + int32_t tok; struct snmp_oid2str *oid2str; if (snmp_import_head(snmptoolctx) < 0) return (-1); - if ((oid2str = malloc(sizeof(struct snmp_oid2str))) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + if ((oid2str = calloc(1, sizeof(struct snmp_oid2str))) == NULL) { + syslog(LOG_ERR, "calloc() failed: %s", strerror(errno)); return (-1); } - if ((string = malloc(strlen(nexttok) + 1)) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + if ((string = strdup(nexttok)) == NULL) { + syslog(LOG_ERR, "strdup() failed: %s", strerror(errno)); free(oid2str); return (-1); } - memset(oid2str, 0, sizeof(struct snmp_oid2str)); - strlcpy(string, nexttok, strlen(nexttok) + 1); oid2str->string = string; oid2str->strlen = strlen(nexttok); @@ -857,7 +853,7 @@ error: } static int32_t -snmp_import_tree(struct snmp_toolinfo *snmptoolctx, enum tok *tok) +snmp_import_tree(struct snmp_toolinfo *snmptoolctx, int32_t *tok) { while (*tok != TOK_EOF) { switch (*tok) { @@ -883,7 +879,7 @@ snmp_import_tree(struct snmp_toolinfo *s } static int32_t -snmp_import_top(struct snmp_toolinfo *snmptoolctx, enum tok *tok) +snmp_import_top(struct snmp_toolinfo *snmptoolctx, int32_t *tok) { enum snmp_tc tc; struct enum_type *t; @@ -940,7 +936,7 @@ static int32_t snmp_import(struct snmp_toolinfo *snmptoolctx) { int i; - enum tok tok; + int32_t tok; tok = gettoken(snmptoolctx); From owner-svn-src-all@freebsd.org Wed Jun 8 17:27:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE43CB6F18E; Wed, 8 Jun 2016 17:27:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 764611FE1; Wed, 8 Jun 2016 17:27:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HRcHD029121; Wed, 8 Jun 2016 17:27:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HRci1029119; Wed, 8 Jun 2016 17:27:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081727.u58HRci1029119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301653 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:27:39 -0000 Author: ngie Date: Wed Jun 8 17:27:38 2016 New Revision: 301653 URL: https://svnweb.freebsd.org/changeset/base/301653 Log: MFC r299810: Correct function names that failed in error messages It should be calloc/strdup, not malloc Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:24:57 2016 (r301652) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:27:38 2016 (r301653) @@ -269,12 +269,12 @@ enum_pair_insert(struct enum_pairs *head struct enum_pair *e_new; if ((e_new = calloc(1, sizeof(struct enum_pair))) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "calloc() failed: %s", strerror(errno)); return (-1); } if ((e_new->enum_str = strdup(enum_str)) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "strdup() failed: %s", strerror(errno)); free(e_new); return (-1); } Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:24:57 2016 (r301652) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:27:38 2016 (r301653) @@ -252,12 +252,12 @@ add_filename(struct snmp_toolinfo *snmpt } if ((fstring = strdup(filename)) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("strdup() failed - %s", strerror(errno)); return (-1); } if ((entry = calloc(1, sizeof(struct fname))) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("calloc() failed - %s", strerror(errno)); free(fstring); return (-1); } From owner-svn-src-all@freebsd.org Wed Jun 8 17:29:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73E6AB6F20F; Wed, 8 Jun 2016 17:29:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C2CA1183; Wed, 8 Jun 2016 17:29:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HT7EI029239; Wed, 8 Jun 2016 17:29:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HT7pG029237; Wed, 8 Jun 2016 17:29:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081729.u58HT7pG029237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301654 - stable/9/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:29:08 -0000 Author: ngie Date: Wed Jun 8 17:29:07 2016 New Revision: 301654 URL: https://svnweb.freebsd.org/changeset/base/301654 Log: MFstable/10 r301653: MFC r299810: Correct function names that failed in error messages It should be calloc/strdup, not malloc Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:27:38 2016 (r301653) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:29:07 2016 (r301654) @@ -269,12 +269,12 @@ enum_pair_insert(struct enum_pairs *head struct enum_pair *e_new; if ((e_new = calloc(1, sizeof(struct enum_pair))) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "calloc() failed: %s", strerror(errno)); return (-1); } if ((e_new->enum_str = strdup(enum_str)) == NULL) { - syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); + syslog(LOG_ERR, "strdup() failed: %s", strerror(errno)); free(e_new); return (-1); } Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:27:38 2016 (r301653) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:29:07 2016 (r301654) @@ -251,12 +251,12 @@ add_filename(struct snmp_toolinfo *snmpt } if ((fstring = strdup(filename)) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("strdup() failed - %s", strerror(errno)); return (-1); } if ((entry = calloc(1, sizeof(struct fname))) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warnx("calloc() failed - %s", strerror(errno)); free(fstring); return (-1); } From owner-svn-src-all@freebsd.org Wed Jun 8 17:30:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A29B6F2F9; Wed, 8 Jun 2016 17:30:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63BDF1440; Wed, 8 Jun 2016 17:30:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HUTQB029364; Wed, 8 Jun 2016 17:30:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HUTXc029363; Wed, 8 Jun 2016 17:30:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081730.u58HUTXc029363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301655 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:30:30 -0000 Author: ngie Date: Wed Jun 8 17:30:29 2016 New Revision: 301655 URL: https://svnweb.freebsd.org/changeset/base/301655 Log: MFC r299766: Fix logically dead code pointed out by clang/Coverity parse_context, parse_user_security: test for validity of results from parse_ascii(..) with by casting to int32_t and comparing to -1; comparing unsigned types to negative values will always be false. CID: 1011432, 1011433 Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:29:07 2016 (r301654) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 17:30:29 2016 (r301655) @@ -615,8 +615,8 @@ parse_context(struct snmp_toolinfo *snmp warnx("Suboption 'context-engine' - no argument"); return (-1); } - if ((snmp_client.clen = parse_ascii(val, - snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) < 0) { + if ((int32_t)(snmp_client.clen = parse_ascii(val, + snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) == -1) { warnx("Bad EngineID - %s", val); return (-1); } @@ -654,7 +654,7 @@ parse_user_security(struct snmp_toolinfo } snmp_client.engine.engine_len = parse_ascii(val, snmp_client.engine.engine_id, SNMP_ENGINE_ID_SIZ); - if (snmp_client.engine.engine_len < 0) { + if ((int32_t)snmp_client.engine.engine_len == -1) { warnx("Bad EngineID - %s", val); return (-1); } From owner-svn-src-all@freebsd.org Wed Jun 8 17:32:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2BF3B6F482; Wed, 8 Jun 2016 17:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83AE519A5; Wed, 8 Jun 2016 17:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HWfUB032855; Wed, 8 Jun 2016 17:32:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HWfLi032854; Wed, 8 Jun 2016 17:32:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081732.u58HWfLi032854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301656 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:32:42 -0000 Author: ngie Date: Wed Jun 8 17:32:41 2016 New Revision: 301656 URL: https://svnweb.freebsd.org/changeset/base/301656 Log: MFC r299778: Use a consistent errno save/restore pattern before running strtoul - Save errno - Set errno to 0 - Call strtoul - Test errno (optional, but many calls to strtoul did this afterwards) Some of the code was setting errno = 0 after calling strtoul, not setting errno = 0, or setting errno to saved_errno after the call, but before the test. These all have unwanted behavioral side-effects, depending on the initial value of errno and whether or not the input to strtoul was correct or incorrect. Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed Jun 8 17:30:29 2016 (r301655) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed Jun 8 17:32:41 2016 (r301656) @@ -364,6 +364,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM-' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -377,6 +378,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'DD,' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -390,6 +392,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'HH:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -403,6 +406,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -416,6 +420,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'SS.' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -429,6 +434,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'M(mseconds),' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -454,6 +460,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'HH:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -467,6 +474,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM' - last one - ignore endptr here. */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -725,6 +733,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as ptr = str; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { warnx("Integer value %s not supported", str); @@ -749,6 +758,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { warnx("Integer value %s not supported", str); @@ -776,6 +786,7 @@ parse_ntp_ts(struct snmp_value *sv, char uint8_t ntp_ts[SNMP_NTP_TS_OCTETS]; saved_errno = errno; + errno = 0; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { errno = saved_errno; @@ -797,6 +808,7 @@ parse_ntp_ts(struct snmp_value *sv, char val = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { errno = saved_errno; @@ -879,8 +891,8 @@ snmp_bridgeid2oct(char *str, struct asn_ ptr = str; /* Read the priority. */ saved_errno = errno; - v = strtoul(ptr, &endptr, 10); errno = 0; + v = strtoul(ptr, &endptr, 10); if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -897,6 +909,7 @@ snmp_bridgeid2oct(char *str, struct asn_ ptr = endptr + 1; for (i = 0; i < 5; i++) { saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; if (v > 0xff) { @@ -914,6 +927,7 @@ snmp_bridgeid2oct(char *str, struct asn_ /* The last one - don't check the ending char here. */ saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; if (v > 0xff) { @@ -938,7 +952,6 @@ parse_bridge_id(struct snmp_value *sv, c saved_errno = errno; errno = 0; v = strtoul(string, &endptr, 10); - errno = saved_errno; if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -1026,8 +1039,8 @@ snmp_bport_id2oct(char *str, struct asn_ ptr = str; /* Read the priority. */ saved_errno = errno; - v = strtoul(ptr, &endptr, 10); errno = 0; + v = strtoul(ptr, &endptr, 10); if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -1039,6 +1052,7 @@ snmp_bport_id2oct(char *str, struct asn_ return (NULL); saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; @@ -1065,7 +1079,6 @@ parse_bport_id(struct snmp_value *value, saved_errno = errno; errno = 0; v = strtoul(string, &endptr, 10); - errno = saved_errno; if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; From owner-svn-src-all@freebsd.org Wed Jun 8 17:34:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047D2B6F4FB; Wed, 8 Jun 2016 17:34:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C594E1B20; Wed, 8 Jun 2016 17:34:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HYb5f033028; Wed, 8 Jun 2016 17:34:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HYbFN033025; Wed, 8 Jun 2016 17:34:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081734.u58HYbFN033025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301657 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:34:39 -0000 Author: ngie Date: Wed Jun 8 17:34:37 2016 New Revision: 301657 URL: https://svnweb.freebsd.org/changeset/base/301657 Log: MFC r299701: Move _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h It was used in bsnmpmap.c but was stored in bsnmptools.c; moving the extern to the header allows us to cover all of our bases for the variable, and allows _bsnmptools_debug to be used in the future elsewhere -- not just bsnmpmap.c. Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:32:41 2016 (r301656) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:34:37 2016 (r301657) @@ -47,7 +47,6 @@ #include "bsnmptc.h" #include "bsnmptools.h" -extern int _bsnmptools_debug; #define DEBUG if (_bsnmptools_debug) fprintf /* Allocate memory and initialize list. */ Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Wed Jun 8 17:32:41 2016 (r301656) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Wed Jun 8 17:34:37 2016 (r301657) @@ -231,7 +231,7 @@ extern struct snmp_toolinfo snmptool; #define SET_NONREP(ctx, i) (((ctx)->flags |= (((i) & 0xff) << 24))) #define GET_NONREP(ctx) (((ctx)->flags & NONREP_BITS) >> 24) - +extern int _bsnmptools_debug; extern const struct asn_oid IsoOrgDod_OID; int snmptool_init(struct snmp_toolinfo *); From owner-svn-src-all@freebsd.org Wed Jun 8 17:35:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E80B6F559; Wed, 8 Jun 2016 17:35:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 151781C9E; Wed, 8 Jun 2016 17:35:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HZErA033123; Wed, 8 Jun 2016 17:35:14 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HZD2D033119; Wed, 8 Jun 2016 17:35:13 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606081735.u58HZD2D033119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 8 Jun 2016 17:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301658 - vendor/NetBSD/libc-vis/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:35:15 -0000 Author: brooks Date: Wed Jun 8 17:35:13 2016 New Revision: 301658 URL: https://svnweb.freebsd.org/changeset/base/301658 Log: Vendor import of NetBSD's (un)vis(3) at 2016-06-08 Modified: vendor/NetBSD/libc-vis/dist/unvis.c vendor/NetBSD/libc-vis/dist/vis.3 vendor/NetBSD/libc-vis/dist/vis.c vendor/NetBSD/libc-vis/dist/vis.h Modified: vendor/NetBSD/libc-vis/dist/unvis.c ============================================================================== --- vendor/NetBSD/libc-vis/dist/unvis.c Wed Jun 8 17:34:37 2016 (r301657) +++ vendor/NetBSD/libc-vis/dist/unvis.c Wed Jun 8 17:35:13 2016 (r301658) @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */ +/* $NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -313,6 +313,12 @@ unvis(char *cp, int c, int *astate, int */ *astate = SS(0, S_GROUND); return UNVIS_NOCHAR; + default: + if (isgraph(c)) { + *cp = c; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + } } goto bad; Modified: vendor/NetBSD/libc-vis/dist/vis.3 ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.3 Wed Jun 8 17:34:37 2016 (r301657) +++ vendor/NetBSD/libc-vis/dist/vis.3 Wed Jun 8 17:35:13 2016 (r301658) @@ -1,4 +1,4 @@ -.\" $NetBSD: vis.3,v 1.39 2013/02/20 20:05:26 christos Exp $ +.\" $NetBSD: vis.3,v 1.45 2016/06/08 15:00:04 wiz Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,13 +29,14 @@ .\" .\" @(#)vis.3 8.1 (Berkeley) 6/9/93 .\" -.Dd February 19, 2013 +.Dd January 14, 2015 .Dt VIS 3 .Os .Sh NAME .Nm vis , .Nm nvis , .Nm strvis , +.Nm stravis , .Nm strnvis , .Nm strvisx , .Nm strnvisx , @@ -59,6 +60,8 @@ .Ft int .Fn strvis "char *dst" "const char *src" "int flag" .Ft int +.Fn stravis "char **dst" "const char *src" "int flag" +.Ft int .Fn strnvis "char *dst" "size_t dlen" "const char *src" "int flag" .Ft int .Fn strvisx "char *dst" "const char *src" "size_t len" "int flag" @@ -111,6 +114,7 @@ encoding format (explained below). .Pp The .Fn strvis , +.Fn stravis , .Fn strnvis , .Fn strvisx , and @@ -157,6 +161,9 @@ forms return the number of characters in (not including the trailing .Dv NUL ) . The +.Fn stravis +function allocates space dynamically to hold the string. +The .Dq Nm n versions of the functions also take an additional argument .Fa dlen @@ -239,11 +246,31 @@ alter this: Also encode the magic characters .Ql ( * , .Ql \&? , -.Ql \&[ +.Ql \&[ , and .Ql # ) recognized by .Xr glob 3 . +.It Dv VIS_SHELL +Also encode the meta characters used by shells (in addition to the glob +characters): +.Ql ( ' , +.Ql ` , +.Ql \&" , +.Ql \&; , +.Ql & , +.Ql < , +.Ql > , +.Ql \&( , +.Ql \&) , +.Ql \&| , +.Ql \&] , +.Ql \e , +.Ql $ , +.Ql \&! , +.Ql \&^ , +and +.Ql ~ ) . .It Dv VIS_SP Also encode space. .It Dv VIS_TAB @@ -252,11 +279,10 @@ Also encode tab. Also encode newline. .It Dv VIS_WHITE Synonym for -.Dv VIS_SP -\&| -.Dv VIS_TAB -\&| -.Dv VIS_NL . +.Dv VIS_SP | VIS_TAB | VIS_NL . +.It Dv VIS_META +Synonym for +.Dv VIS_WHITE | VIS_GLOB | VIS_SHELL . .It Dv VIS_SAFE Only encode .Dq unsafe @@ -417,6 +443,11 @@ The encoding conversion is influenced by environment variable which defines the set of characters that can be copied without encoding. .Pp +If +.Dv VIS_NOLOCALE +is set, processing is done assuming the C locale and overriding +any other environment settings. +.Pp When 8-bit data is present in the input, .Ev LC_CTYPE must be set to the correct locale or to the C locale. @@ -510,7 +541,7 @@ appeared in .Nx 6.0 and .Fx 9.2 . -Myltibyte character support was added in +Multibyte character support was added in .Nx 7.0 and .Fx 9.2 . Modified: vendor/NetBSD/libc-vis/dist/vis.c ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.c Wed Jun 8 17:34:37 2016 (r301657) +++ vendor/NetBSD/libc-vis/dist/vis.c Wed Jun 8 17:35:13 2016 (r301658) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $ */ +/* $NetBSD: vis.c,v 1.71 2016/01/14 20:41:23 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $"); +__RCSID("$NetBSD: vis.c,v 1.71 2016/01/14 20:41:23 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -97,6 +97,30 @@ static wchar_t *do_svis(wchar_t *, wint_ #undef BELL #define BELL L'\a' + +#if defined(LC_C_LOCALE) +#define iscgraph(c) isgraph_l(c, LC_C_LOCALE) +#else +/* Keep it simple for now, no locale stuff */ +#define iscgraph(c) isgraph(c) +#ifdef notyet +#include +static int +iscgraph(int c) { + int rv; + char *ol; + + ol = setlocale(LC_CTYPE, "C"); + rv = isgraph(c); + if (ol) + setlocale(LC_CTYPE, ol); + return rv; +} +#endif +#endif + +#define ISGRAPH(flags, c) \ + (((flags) & VIS_NOLOCALE) ? iscgraph(c) : iswgraph(c)) #define iswoctal(c) (((u_char)(c)) >= L'0' && ((u_char)(c)) <= L'7') #define iswwhite(c) (c == L' ' || c == L'\t' || c == L'\n') @@ -104,7 +128,10 @@ static wchar_t *do_svis(wchar_t *, wint_ #define xtoa(c) L"0123456789abcdef"[c] #define XTOA(c) L"0123456789ABCDEF"[c] -#define MAXEXTRAS 10 +#define MAXEXTRAS 30 + +static const wchar_t char_shell[] = L"'`\";&<>()|{}]\\$!^~"; +static const wchar_t char_glob[] = L"*?[#"; #if !HAVE_NBTOOL_CONFIG_H #ifndef __NetBSD__ @@ -213,8 +240,23 @@ do_mbyte(wchar_t *dst, wint_t c, int fla *dst++ = L'0'; } return dst; + /* We cannot encode these characters in VIS_CSTYLE + * because they special meaning */ + case L'n': + case L'r': + case L'b': + case L'a': + case L'v': + case L't': + case L'f': + case L's': + case L'0': + case L'M': + case L'^': + case L'$': /* vis(1) -l */ + break; default: - if (iswgraph(c)) { + if (ISGRAPH(flags, c) && !iswoctal(c)) { *dst++ = L'\\'; *dst++ = c; return dst; @@ -266,7 +308,7 @@ do_svis(wchar_t *dst, wint_t c, int flag uint64_t bmsk, wmsk; iswextra = wcschr(extra, c) != NULL; - if (!iswextra && (iswgraph(c) || iswwhite(c) || + if (!iswextra && (ISGRAPH(flags, c) || iswwhite(c) || ((flags & VIS_SAFE) && iswsafe(c)))) { *dst++ = c; return dst; @@ -310,25 +352,27 @@ makeextralist(int flags, const char *src { wchar_t *dst, *d; size_t len; + const wchar_t *s; len = strlen(src); if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) return NULL; - if (mbstowcs(dst, src, len) == (size_t)-1) { + if ((flags & VIS_NOLOCALE) || mbstowcs(dst, src, len) == (size_t)-1) { size_t i; for (i = 0; i < len; i++) - dst[i] = (wint_t)(u_char)src[i]; + dst[i] = (wchar_t)(u_char)src[i]; d = dst + len; } else d = dst + wcslen(dst); - if (flags & VIS_GLOB) { - *d++ = L'*'; - *d++ = L'?'; - *d++ = L'['; - *d++ = L'#'; - } + if (flags & VIS_GLOB) + for (s = char_glob; *s; *d++ = *s++) + continue; + + if (flags & VIS_SHELL) + for (s = char_shell; *s; *d++ = *s++) + continue; if (flags & VIS_SP) *d++ = L' '; if (flags & VIS_TAB) *d++ = L'\t'; @@ -345,7 +389,7 @@ makeextralist(int flags, const char *src * All user-visible functions call this one. */ static int -istrsenvisx(char *mbdst, size_t *dlen, const char *mbsrc, size_t mblength, +istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength, int flags, const char *mbextra, int *cerr_ptr) { wchar_t *dst, *src, *pdst, *psrc, *start, *extra; @@ -353,10 +397,11 @@ istrsenvisx(char *mbdst, size_t *dlen, c uint64_t bmsk, wmsk; wint_t c; visfun_t f; - int clen = 0, cerr = 0, error = -1, i, shft; + int clen = 0, cerr, error = -1, i, shft; + char *mbdst, *mdst; ssize_t mbslength, maxolen; - _DIAGASSERT(mbdst != NULL); + _DIAGASSERT(mbdstp != NULL); _DIAGASSERT(mbsrc != NULL || mblength == 0); _DIAGASSERT(mbextra != NULL); @@ -375,16 +420,28 @@ istrsenvisx(char *mbdst, size_t *dlen, c /* Allocate space for the wide char strings */ psrc = pdst = extra = NULL; + mdst = NULL; if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL) return -1; if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL) goto out; + if (*mbdstp == NULL) { + if ((mdst = calloc((4 * mblength) + 1, sizeof(*mdst))) == NULL) + goto out; + *mbdstp = mdst; + } + + mbdst = *mbdstp; dst = pdst; src = psrc; - /* Use caller's multibyte conversion error flag. */ - if (cerr_ptr) - cerr = *cerr_ptr; + if (flags & VIS_NOLOCALE) { + /* Do one byte at a time conversion */ + cerr = 1; + } else { + /* Use caller's multibyte conversion error flag. */ + cerr = cerr_ptr ? *cerr_ptr : 0; + } /* * Input loop. @@ -439,7 +496,7 @@ istrsenvisx(char *mbdst, size_t *dlen, c errno = ENOSPC; goto out; } - *mbdst = '\0'; /* can't create extra, return "" */ + *mbdst = '\0'; /* can't create extra, return "" */ error = 0; goto out; } @@ -511,9 +568,11 @@ istrsenvisx(char *mbdst, size_t *dlen, c /* Terminate the output string. */ *mbdst = '\0'; - /* Pass conversion error flag out. */ - if (cerr_ptr) - *cerr_ptr = cerr; + if (flags & VIS_NOLOCALE) { + /* Pass conversion error flag out. */ + if (cerr_ptr) + *cerr_ptr = cerr; + } free(extra); free(pdst); @@ -524,14 +583,15 @@ out: free(extra); free(pdst); free(psrc); + free(mdst); return error; } static int -istrsenvisxl(char *mbdst, size_t *dlen, const char *mbsrc, +istrsenvisxl(char **mbdstp, size_t *dlen, const char *mbsrc, int flags, const char *mbextra, int *cerr_ptr) { - return istrsenvisx(mbdst, dlen, mbsrc, + return istrsenvisx(mbdstp, dlen, mbsrc, mbsrc != NULL ? strlen(mbsrc) : 0, flags, mbextra, cerr_ptr); } @@ -554,7 +614,7 @@ svis(char *mbdst, int c, int flags, int cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, NULL, cc, 1, flags, mbextra, NULL); + ret = istrsenvisx(&mbdst, NULL, cc, 1, flags, mbextra, NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -569,7 +629,7 @@ snvis(char *mbdst, size_t dlen, int c, i cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, mbextra, NULL); + ret = istrsenvisx(&mbdst, &dlen, cc, 1, flags, mbextra, NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -578,33 +638,33 @@ snvis(char *mbdst, size_t dlen, int c, i int strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisxl(mbdst, NULL, mbsrc, flags, mbextra, NULL); + return istrsenvisxl(&mbdst, NULL, mbsrc, flags, mbextra, NULL); } int strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisxl(mbdst, &dlen, mbsrc, flags, mbextra, NULL); + return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, mbextra, NULL); } int strsvisx(char *mbdst, const char *mbsrc, size_t len, int flags, const char *mbextra) { - return istrsenvisx(mbdst, NULL, mbsrc, len, flags, mbextra, NULL); + return istrsenvisx(&mbdst, NULL, mbsrc, len, flags, mbextra, NULL); } int strsnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, const char *mbextra) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, NULL); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, mbextra, NULL); } int strsenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, const char *mbextra, int *cerr_ptr) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, cerr_ptr); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, mbextra, cerr_ptr); } #endif @@ -621,7 +681,7 @@ vis(char *mbdst, int c, int flags, int n cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, NULL, cc, 1, flags, "", NULL); + ret = istrsenvisx(&mbdst, NULL, cc, 1, flags, "", NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -636,7 +696,7 @@ nvis(char *mbdst, size_t dlen, int c, in cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, "", NULL); + ret = istrsenvisx(&mbdst, &dlen, cc, 1, flags, "", NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -653,13 +713,20 @@ nvis(char *mbdst, size_t dlen, int c, in int strvis(char *mbdst, const char *mbsrc, int flags) { - return istrsenvisxl(mbdst, NULL, mbsrc, flags, "", NULL); + return istrsenvisxl(&mbdst, NULL, mbsrc, flags, "", NULL); } int strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags) { - return istrsenvisxl(mbdst, &dlen, mbsrc, flags, "", NULL); + return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL); +} + +int +stravis(char **mbdstp, const char *mbsrc, int flags) +{ + *mbdstp = NULL; + return istrsenvisxl(mbdstp, NULL, mbsrc, flags, "", NULL); } /* @@ -676,19 +743,19 @@ strnvis(char *mbdst, size_t dlen, const int strvisx(char *mbdst, const char *mbsrc, size_t len, int flags) { - return istrsenvisx(mbdst, NULL, mbsrc, len, flags, "", NULL); + return istrsenvisx(&mbdst, NULL, mbsrc, len, flags, "", NULL); } int strnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", NULL); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, "", NULL); } int strenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, int *cerr_ptr) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", cerr_ptr); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, "", cerr_ptr); } #endif Modified: vendor/NetBSD/libc-vis/dist/vis.h ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.h Wed Jun 8 17:34:37 2016 (r301657) +++ vendor/NetBSD/libc-vis/dist/vis.h Wed Jun 8 17:35:13 2016 (r301658) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.h,v 1.21 2013/02/20 17:01:15 christos Exp $ */ +/* $NetBSD: vis.h,v 1.24 2016/01/14 20:42:14 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -63,6 +63,9 @@ #define VIS_NOESCAPE 0x0400 /* don't decode `\' */ #define _VIS_END 0x0800 /* for unvis */ #define VIS_GLOB 0x1000 /* encode glob(3) magic characters */ +#define VIS_SHELL 0x2000 /* encode shell special characters [not glob] */ +#define VIS_META (VIS_WHITE | VIS_GLOB | VIS_SHELL) +#define VIS_NOLOCALE 0x4000 /* encode using the C locale */ /* * unvis return codes @@ -88,6 +91,7 @@ char *svis(char *, int, int, int, const char *snvis(char *, size_t, int, int, int, const char *); int strvis(char *, const char *, int); +int stravis(char **, const char *, int); int strnvis(char *, size_t, const char *, int); int strsvis(char *, const char *, int, const char *); From owner-svn-src-all@freebsd.org Wed Jun 8 17:36:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D6F2B6F5D8; Wed, 8 Jun 2016 17:36:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 464931E03; Wed, 8 Jun 2016 17:36:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HZxWh033194; Wed, 8 Jun 2016 17:35:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HZxN8033192; Wed, 8 Jun 2016 17:35:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081735.u58HZxN8033192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301659 - stable/9/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:36:00 -0000 Author: ngie Date: Wed Jun 8 17:35:59 2016 New Revision: 301659 URL: https://svnweb.freebsd.org/changeset/base/301659 Log: MFstable/10 r301657: MFC r299701: Move _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h It was used in bsnmpmap.c but was stored in bsnmptools.c; moving the extern to the header allows us to cover all of our bases for the variable, and allows _bsnmptools_debug to be used in the future elsewhere -- not just bsnmpmap.c. Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:35:13 2016 (r301658) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Wed Jun 8 17:35:59 2016 (r301659) @@ -47,7 +47,6 @@ #include "bsnmptc.h" #include "bsnmptools.h" -extern int _bsnmptools_debug; #define DEBUG if (_bsnmptools_debug) fprintf /* Allocate memory and initialize list. */ Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Wed Jun 8 17:35:13 2016 (r301658) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Wed Jun 8 17:35:59 2016 (r301659) @@ -229,7 +229,7 @@ extern struct snmp_toolinfo snmptool; #define SET_NONREP(ctx, i) (((ctx)->flags |= (((i) & 0xff) << 24))) #define GET_NONREP(ctx) (((ctx)->flags & NONREP_BITS) >> 24) - +extern int _bsnmptools_debug; extern const struct asn_oid IsoOrgDod_OID; int snmptool_init(struct snmp_toolinfo *); From owner-svn-src-all@freebsd.org Wed Jun 8 17:36:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88ED7B6F5EB; Wed, 8 Jun 2016 17:36:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 411931E05; Wed, 8 Jun 2016 17:36:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Ha1nr033242; Wed, 8 Jun 2016 17:36:01 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Ha1nD033241; Wed, 8 Jun 2016 17:36:01 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606081736.u58Ha1nD033241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 8 Jun 2016 17:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301660 - vendor/NetBSD/libc-vis/20160608 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:36:02 -0000 Author: brooks Date: Wed Jun 8 17:36:01 2016 New Revision: 301660 URL: https://svnweb.freebsd.org/changeset/base/301660 Log: Tag 2016-06-08 import of NetBSD's (un)vis(3) Added: vendor/NetBSD/libc-vis/20160608/ - copied from r301659, vendor/NetBSD/libc-vis/dist/ From owner-svn-src-all@freebsd.org Wed Jun 8 17:43:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24ADBB6F943; Wed, 8 Jun 2016 17:43:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9DB0144D; Wed, 8 Jun 2016 17:43:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Hh5Q5036852; Wed, 8 Jun 2016 17:43:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Hh4lC036846; Wed, 8 Jun 2016 17:43:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081743.u58Hh4lC036846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301661 - in stable/10/contrib/bsnmp: lib snmp_mibII snmp_target X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:43:06 -0000 Author: ngie Date: Wed Jun 8 17:43:04 2016 New Revision: 301661 URL: https://svnweb.freebsd.org/changeset/base/301661 Log: MFC r256678,r256680,r260986,r272878,r286402: r256678 (by syrinx): Fix SNMP Error response PDUs and properly encode them when using v3 auth/encryption. r256680 (by syrinx): Fix the -Wconversion warnings produced when compiling the SNMP agent. r260986 (by harti): Fix a problem with OBJECT IDENTIFIER encoding: need to check the second subid to be less than 40, not the first when the first subid is 0 or 1. r272878 (by syrinx): Fix a bug in decoding string indexes in snmp_target(3), thus causing bsnmpd(1) to not send v3 notifications properly; while here add two missing return statements which could lead to abort() in case of a rollback r286402 (by araujo): Fix variable 'old' is used uninitialized whenever '&&' condition is false. Spotted by clang. Modified: stable/10/contrib/bsnmp/lib/asn1.c stable/10/contrib/bsnmp/lib/snmp.c stable/10/contrib/bsnmp/lib/snmp.h stable/10/contrib/bsnmp/lib/snmpagent.c stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c stable/10/contrib/bsnmp/snmp_target/target_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/lib/asn1.c ============================================================================== --- stable/10/contrib/bsnmp/lib/asn1.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/asn1.c Wed Jun 8 17:43:04 2016 (r301661) @@ -652,7 +652,7 @@ asn_put_objid(struct asn_buf *b, const s err = ASN_ERR_RANGE; } if (oid->subs[0] > 2 || - (oid->subs[0] < 2 && oid->subs[0] >= 40)) { + (oid->subs[0] < 2 && oid->subs[1] >= 40)) { asn_error(NULL, "oid out of range (%u,%u)", oid->subs[0], oid->subs[1]); err = ASN_ERR_RANGE; Modified: stable/10/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/snmp.c Wed Jun 8 17:43:04 2016 (r301661) @@ -288,11 +288,13 @@ parse_secparams(struct asn_buf *b, struc memset(buf, 0, 256); tb.asn_ptr = buf; tb.asn_len = 256; + u_int len; - if (asn_get_octetstring(b, buf, &tb.asn_len) != ASN_ERR_OK) { + if (asn_get_octetstring(b, buf, &len) != ASN_ERR_OK) { snmp_error("cannot parse usm header"); return (ASN_ERR_FAILED); } + tb.asn_len = len; if (asn_get_sequence(&tb, &octs_len) != ASN_ERR_OK) { snmp_error("cannot decode usm header"); @@ -864,7 +866,7 @@ snmp_fix_encoding(struct asn_buf *b, str return (SNMP_CODE_FAILED); pdu->scoped_len = b->asn_ptr - pdu->scoped_ptr; - if ((code = snmp_pdu_fix_padd(b, pdu))!= ASN_ERR_OK) + if (snmp_pdu_fix_padd(b, pdu) != ASN_ERR_OK) return (SNMP_CODE_FAILED); if (pdu->security_model != SNMP_SECMODEL_USM) @@ -997,7 +999,7 @@ snmp_pdu_encode(struct snmp_pdu *pdu, st if ((err = snmp_pdu_encode_header(resp_b, pdu)) != SNMP_CODE_OK) return (err); for (idx = 0; idx < pdu->nbindings; idx++) - if ((err = snmp_binding_encode(resp_b, &pdu->bindings[idx])) + if (snmp_binding_encode(resp_b, &pdu->bindings[idx]) != ASN_ERR_OK) return (SNMP_CODE_FAILED); Modified: stable/10/contrib/bsnmp/lib/snmp.h ============================================================================== --- stable/10/contrib/bsnmp/lib/snmp.h Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/snmp.h Wed Jun 8 17:43:04 2016 (r301661) @@ -182,7 +182,7 @@ struct snmp_pdu { /* fixes for encoding */ size_t outer_len; - size_t scoped_len; + asn_len_t scoped_len; u_char *outer_ptr; u_char *digest_ptr; u_char *encrypted_ptr; Modified: stable/10/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- stable/10/contrib/bsnmp/lib/snmpagent.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/lib/snmpagent.c Wed Jun 8 17:43:04 2016 (r301661) @@ -166,7 +166,7 @@ find_subnode(const struct snmp_value *va } static void -snmp_pdu_create_response(struct snmp_pdu *pdu, struct snmp_pdu *resp) +snmp_pdu_create_response(const struct snmp_pdu *pdu, struct snmp_pdu *resp) { memset(resp, 0, sizeof(*resp)); strcpy(resp->community, pdu->community); @@ -276,7 +276,12 @@ snmp_get(struct snmp_pdu *pdu, struct as } } - return (snmp_fix_encoding(resp_b, resp)); + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("get: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } static struct snmp_node * @@ -438,7 +443,13 @@ snmp_getnext(struct snmp_pdu *pdu, struc return (SNMP_RET_ERR); } } - return (snmp_fix_encoding(resp_b, resp)); + + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("getnext: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } enum snmp_ret @@ -542,7 +553,12 @@ snmp_getbulk(struct snmp_pdu *pdu, struc } done: - return (snmp_fix_encoding(resp_b, resp)); + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("getnext: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } /* @@ -957,18 +973,57 @@ enum snmp_ret snmp_make_errresp(const struct snmp_pdu *pdu, struct asn_buf *pdu_b, struct asn_buf *resp_b) { + u_char type; asn_len_t len; struct snmp_pdu resp; enum asn_err err; enum snmp_code code; - memset(&resp, 0, sizeof(resp)); + snmp_pdu_create_response(pdu, &resp); + if ((code = snmp_pdu_decode_header(pdu_b, &resp)) != SNMP_CODE_OK) return (SNMP_RET_IGN); - if (pdu_b->asn_len < len) + if (pdu->version == SNMP_V3) { + if (resp.user.priv_proto != SNMP_PRIV_NOPRIV && + (asn_get_header(pdu_b, &type, &resp.scoped_len) != ASN_ERR_OK + || type != ASN_TYPE_OCTETSTRING)) { + snmp_error("cannot decode encrypted pdu"); + return (SNMP_RET_IGN); + } + + if (asn_get_sequence(pdu_b, &len) != ASN_ERR_OK) { + snmp_error("cannot decode scoped pdu header"); + return (SNMP_RET_IGN); + } + + len = SNMP_ENGINE_ID_SIZ; + if (asn_get_octetstring(pdu_b, (u_char *)resp.context_engine, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context engine"); + return (SNMP_RET_IGN); + } + resp.context_engine_len = len; + len = SNMP_CONTEXT_NAME_SIZ; + if (asn_get_octetstring(pdu_b, (u_char *)resp.context_name, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context name"); + return (SNMP_RET_IGN); + } + resp.context_name[len] = '\0'; + } + + + if (asn_get_header(pdu_b, &type, &len) != ASN_ERR_OK) { + snmp_error("cannot get pdu header"); return (SNMP_RET_IGN); - pdu_b->asn_len = len; + } + + if ((type & ~ASN_TYPE_MASK) != + (ASN_TYPE_CONSTRUCTED | ASN_CLASS_CONTEXT)) { + snmp_error("bad pdu header tag"); + return (SNMP_RET_IGN); + } err = snmp_parse_pdus_hdr(pdu_b, &resp, &len); if (ASN_ERR_STOPPED(err)) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c Wed Jun 8 17:43:04 2016 (r301661) @@ -151,7 +151,7 @@ int op_ip(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { - int old; + int old = 0; switch (op) { Modified: stable/10/contrib/bsnmp/snmp_target/target_snmp.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_target/target_snmp.c Wed Jun 8 17:36:01 2016 (r301660) +++ stable/10/contrib/bsnmp/snmp_target/target_snmp.c Wed Jun 8 17:43:04 2016 (r301661) @@ -301,6 +301,7 @@ op_snmp_target_addrs(struct snmp_context default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -625,6 +626,7 @@ op_snmp_notify(struct snmp_context *ctx default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -663,13 +665,14 @@ target_append_index(struct asn_oid *oid, static int target_decode_index(const struct asn_oid *oid, uint sub, char *name) { - uint32_t i, len; + uint32_t i; - if ((len = oid->len - sub) >= SNMP_ADM_STR32_SIZ) + if (oid->len - sub != oid->subs[sub] + 1 || oid->subs[sub] >= + SNMP_ADM_STR32_SIZ) return (-1); - for (i = 0; i < len; i++) - name[i] = oid->subs[sub + i]; + for (i = 0; i < oid->subs[sub]; i++) + name[i] = oid->subs[sub + i + 1]; name[i] = '\0'; return (0); From owner-svn-src-all@freebsd.org Wed Jun 8 17:44:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42F3BB6F9D1; Wed, 8 Jun 2016 17:44:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02A531724; Wed, 8 Jun 2016 17:44:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HiN2a036987; Wed, 8 Jun 2016 17:44:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HiMvO036981; Wed, 8 Jun 2016 17:44:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081744.u58HiMvO036981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301662 - in stable/9/contrib/bsnmp: lib snmp_mibII snmp_target X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:44:24 -0000 Author: ngie Date: Wed Jun 8 17:44:22 2016 New Revision: 301662 URL: https://svnweb.freebsd.org/changeset/base/301662 Log: MFstable/10 r301661: MFC r256678,r256680,r260986,r272878,r286402: r256678 (by syrinx): Fix SNMP Error response PDUs and properly encode them when using v3 auth/encryption. r256680 (by syrinx): Fix the -Wconversion warnings produced when compiling the SNMP agent. r260986 (by harti): Fix a problem with OBJECT IDENTIFIER encoding: need to check the second subid to be less than 40, not the first when the first subid is 0 or 1. r272878 (by syrinx): Fix a bug in decoding string indexes in snmp_target(3), thus causing bsnmpd(1) to not send v3 notifications properly; while here add two missing return statements which could lead to abort() in case of a rollback r286402 (by araujo): Fix variable 'old' is used uninitialized whenever '&&' condition is false. Spotted by clang. Modified: stable/9/contrib/bsnmp/lib/asn1.c stable/9/contrib/bsnmp/lib/snmp.c stable/9/contrib/bsnmp/lib/snmp.h stable/9/contrib/bsnmp/lib/snmpagent.c stable/9/contrib/bsnmp/snmp_mibII/mibII_ip.c stable/9/contrib/bsnmp/snmp_target/target_snmp.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) stable/9/contrib/bsnmp/snmp_mibII/ (props changed) Modified: stable/9/contrib/bsnmp/lib/asn1.c ============================================================================== --- stable/9/contrib/bsnmp/lib/asn1.c Wed Jun 8 17:43:04 2016 (r301661) +++ stable/9/contrib/bsnmp/lib/asn1.c Wed Jun 8 17:44:22 2016 (r301662) @@ -652,7 +652,7 @@ asn_put_objid(struct asn_buf *b, const s err = ASN_ERR_RANGE; } if (oid->subs[0] > 2 || - (oid->subs[0] < 2 && oid->subs[0] >= 40)) { + (oid->subs[0] < 2 && oid->subs[1] >= 40)) { asn_error(NULL, "oid out of range (%u,%u)", oid->subs[0], oid->subs[1]); err = ASN_ERR_RANGE; Modified: stable/9/contrib/bsnmp/lib/snmp.c ============================================================================== --- stable/9/contrib/bsnmp/lib/snmp.c Wed Jun 8 17:43:04 2016 (r301661) +++ stable/9/contrib/bsnmp/lib/snmp.c Wed Jun 8 17:44:22 2016 (r301662) @@ -288,11 +288,13 @@ parse_secparams(struct asn_buf *b, struc memset(buf, 0, 256); tb.asn_ptr = buf; tb.asn_len = 256; + u_int len; - if (asn_get_octetstring(b, buf, &tb.asn_len) != ASN_ERR_OK) { + if (asn_get_octetstring(b, buf, &len) != ASN_ERR_OK) { snmp_error("cannot parse usm header"); return (ASN_ERR_FAILED); } + tb.asn_len = len; if (asn_get_sequence(&tb, &octs_len) != ASN_ERR_OK) { snmp_error("cannot decode usm header"); @@ -864,7 +866,7 @@ snmp_fix_encoding(struct asn_buf *b, str return (SNMP_CODE_FAILED); pdu->scoped_len = b->asn_ptr - pdu->scoped_ptr; - if ((code = snmp_pdu_fix_padd(b, pdu))!= ASN_ERR_OK) + if (snmp_pdu_fix_padd(b, pdu) != ASN_ERR_OK) return (SNMP_CODE_FAILED); if (pdu->security_model != SNMP_SECMODEL_USM) @@ -997,7 +999,7 @@ snmp_pdu_encode(struct snmp_pdu *pdu, st if ((err = snmp_pdu_encode_header(resp_b, pdu)) != SNMP_CODE_OK) return (err); for (idx = 0; idx < pdu->nbindings; idx++) - if ((err = snmp_binding_encode(resp_b, &pdu->bindings[idx])) + if (snmp_binding_encode(resp_b, &pdu->bindings[idx]) != ASN_ERR_OK) return (SNMP_CODE_FAILED); Modified: stable/9/contrib/bsnmp/lib/snmp.h ============================================================================== --- stable/9/contrib/bsnmp/lib/snmp.h Wed Jun 8 17:43:04 2016 (r301661) +++ stable/9/contrib/bsnmp/lib/snmp.h Wed Jun 8 17:44:22 2016 (r301662) @@ -182,7 +182,7 @@ struct snmp_pdu { /* fixes for encoding */ size_t outer_len; - size_t scoped_len; + asn_len_t scoped_len; u_char *outer_ptr; u_char *digest_ptr; u_char *encrypted_ptr; Modified: stable/9/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- stable/9/contrib/bsnmp/lib/snmpagent.c Wed Jun 8 17:43:04 2016 (r301661) +++ stable/9/contrib/bsnmp/lib/snmpagent.c Wed Jun 8 17:44:22 2016 (r301662) @@ -166,7 +166,7 @@ find_subnode(const struct snmp_value *va } static void -snmp_pdu_create_response(struct snmp_pdu *pdu, struct snmp_pdu *resp) +snmp_pdu_create_response(const struct snmp_pdu *pdu, struct snmp_pdu *resp) { memset(resp, 0, sizeof(*resp)); strcpy(resp->community, pdu->community); @@ -276,7 +276,12 @@ snmp_get(struct snmp_pdu *pdu, struct as } } - return (snmp_fix_encoding(resp_b, resp)); + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("get: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } static struct snmp_node * @@ -438,7 +443,13 @@ snmp_getnext(struct snmp_pdu *pdu, struc return (SNMP_RET_ERR); } } - return (snmp_fix_encoding(resp_b, resp)); + + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("getnext: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } enum snmp_ret @@ -542,7 +553,12 @@ snmp_getbulk(struct snmp_pdu *pdu, struc } done: - return (snmp_fix_encoding(resp_b, resp)); + if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) { + snmp_debug("getnext: failed to encode PDU"); + return (SNMP_RET_ERR); + } + + return (SNMP_RET_OK); } /* @@ -957,18 +973,57 @@ enum snmp_ret snmp_make_errresp(const struct snmp_pdu *pdu, struct asn_buf *pdu_b, struct asn_buf *resp_b) { + u_char type; asn_len_t len; struct snmp_pdu resp; enum asn_err err; enum snmp_code code; - memset(&resp, 0, sizeof(resp)); + snmp_pdu_create_response(pdu, &resp); + if ((code = snmp_pdu_decode_header(pdu_b, &resp)) != SNMP_CODE_OK) return (SNMP_RET_IGN); - if (pdu_b->asn_len < len) + if (pdu->version == SNMP_V3) { + if (resp.user.priv_proto != SNMP_PRIV_NOPRIV && + (asn_get_header(pdu_b, &type, &resp.scoped_len) != ASN_ERR_OK + || type != ASN_TYPE_OCTETSTRING)) { + snmp_error("cannot decode encrypted pdu"); + return (SNMP_RET_IGN); + } + + if (asn_get_sequence(pdu_b, &len) != ASN_ERR_OK) { + snmp_error("cannot decode scoped pdu header"); + return (SNMP_RET_IGN); + } + + len = SNMP_ENGINE_ID_SIZ; + if (asn_get_octetstring(pdu_b, (u_char *)resp.context_engine, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context engine"); + return (SNMP_RET_IGN); + } + resp.context_engine_len = len; + len = SNMP_CONTEXT_NAME_SIZ; + if (asn_get_octetstring(pdu_b, (u_char *)resp.context_name, + &len) != ASN_ERR_OK) { + snmp_error("cannot decode msg context name"); + return (SNMP_RET_IGN); + } + resp.context_name[len] = '\0'; + } + + + if (asn_get_header(pdu_b, &type, &len) != ASN_ERR_OK) { + snmp_error("cannot get pdu header"); return (SNMP_RET_IGN); - pdu_b->asn_len = len; + } + + if ((type & ~ASN_TYPE_MASK) != + (ASN_TYPE_CONSTRUCTED | ASN_CLASS_CONTEXT)) { + snmp_error("bad pdu header tag"); + return (SNMP_RET_IGN); + } err = snmp_parse_pdus_hdr(pdu_b, &resp, &len); if (ASN_ERR_STOPPED(err)) Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII_ip.c ============================================================================== --- stable/9/contrib/bsnmp/snmp_mibII/mibII_ip.c Wed Jun 8 17:43:04 2016 (r301661) +++ stable/9/contrib/bsnmp/snmp_mibII/mibII_ip.c Wed Jun 8 17:44:22 2016 (r301662) @@ -151,7 +151,7 @@ int op_ip(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { - int old; + int old = 0; switch (op) { Modified: stable/9/contrib/bsnmp/snmp_target/target_snmp.c ============================================================================== --- stable/9/contrib/bsnmp/snmp_target/target_snmp.c Wed Jun 8 17:43:04 2016 (r301661) +++ stable/9/contrib/bsnmp/snmp_target/target_snmp.c Wed Jun 8 17:44:22 2016 (r301662) @@ -301,6 +301,7 @@ op_snmp_target_addrs(struct snmp_context default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -625,6 +626,7 @@ op_snmp_notify(struct snmp_context *ctx default: break; } + return (SNMP_ERR_NOERROR); default: abort(); @@ -663,13 +665,14 @@ target_append_index(struct asn_oid *oid, static int target_decode_index(const struct asn_oid *oid, uint sub, char *name) { - uint32_t i, len; + uint32_t i; - if ((len = oid->len - sub) >= SNMP_ADM_STR32_SIZ) + if (oid->len - sub != oid->subs[sub] + 1 || oid->subs[sub] >= + SNMP_ADM_STR32_SIZ) return (-1); - for (i = 0; i < len; i++) - name[i] = oid->subs[sub + i]; + for (i = 0; i < oid->subs[sub]; i++) + name[i] = oid->subs[sub + i + 1]; name[i] = '\0'; return (0); From owner-svn-src-all@freebsd.org Wed Jun 8 17:49:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99171B6FAC1; Wed, 8 Jun 2016 17:49:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C63219F0; Wed, 8 Jun 2016 17:49:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Hn3fg037267; Wed, 8 Jun 2016 17:49:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Hn3gh037262; Wed, 8 Jun 2016 17:49:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081749.u58Hn3gh037262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301663 - in stable/10/contrib/bsnmp: snmp_mibII snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:49:04 -0000 Author: ngie Date: Wed Jun 8 17:49:03 2016 New Revision: 301663 URL: https://svnweb.freebsd.org/changeset/base/301663 Log: MFC r294507,r294567,r299466: r294507 (by harti): Fill the ifAlias leaf of the ifXTable with the interface description if there is one available and it fits into the maximum size (64 characters). r294567 (by bz): Change the variable to a #define in order to make gcc happy which otherwise will complain about "variably modified 'alias' at file scope". Unbreaks the build on gcc platforms. r299466 (by cem): bsnmpd: Fix size of trapsink::comm to match other community arrays This fixes a number of possible strcpy() buffer overruns between the various community strings in trap.c. CIDs: 1006820, 1006821, 1006822 Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c stable/10/contrib/bsnmp/snmp_mibII/mibII.h stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c stable/10/contrib/bsnmp/snmpd/snmpd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.c Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.c Wed Jun 8 17:49:03 2016 (r301663) @@ -443,6 +443,7 @@ mib_fetch_ifmib(struct mibif *ifp) size_t len; void *newmib; struct ifmibdata oldmib = ifp->mib; + struct ifreq irr; if (fetch_generic_mib(ifp, &oldmib) == -1) return (-1); @@ -514,6 +515,18 @@ mib_fetch_ifmib(struct mibif *ifp) } out: + strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); + irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; + irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); + if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { + MIBIF_PRIV(ifp)->alias[0] = 0; + if (errno != ENOMSG) + syslog(LOG_WARNING, "SIOCGIFDESCR (%s): %m", ifp->name); + } else if (irr.ifr_buffer.buffer == NULL) { + MIBIF_PRIV(ifp)->alias[0] = 0; + syslog(LOG_WARNING, "SIOCGIFDESCR (%s): too long (%zu)", + ifp->name, irr.ifr_buffer.length); + } ifp->mibtick = get_ticks(); return (0); } Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII.h Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII.h Wed Jun 8 17:49:03 2016 (r301663) @@ -57,6 +57,9 @@ #include "snmp_mibII.h" #include "mibII_tree.h" +/* maximum size of the interface alias */ +#define MIBIF_ALIAS_SIZE (64 + 1) + /* * Interface list and flags. */ @@ -77,6 +80,9 @@ struct mibif_private { uint64_t hc_opackets; uint64_t hc_imcasts; uint64_t hc_ipackets; + + /* this should be made public */ + char alias[MIBIF_ALIAS_SIZE]; }; #define MIBIF_PRIV(IFP) ((struct mibif_private *)((IFP)->private)) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Wed Jun 8 17:49:03 2016 (r301663) @@ -528,7 +528,7 @@ op_ifxtable(struct snmp_context *ctx, st break; case LEAF_ifAlias: - ret = string_get(value, "", -1); + ret = string_get(value, MIBIF_PRIV(ifp)->alias, -1); break; case LEAF_ifCounterDiscontinuityTime: Modified: stable/10/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/10/contrib/bsnmp/snmpd/snmpd.h Wed Jun 8 17:44:22 2016 (r301662) +++ stable/10/contrib/bsnmp/snmpd/snmpd.h Wed Jun 8 17:49:03 2016 (r301663) @@ -307,7 +307,7 @@ struct trapsink { struct asn_oid index; u_int status; int socket; - u_char comm[SNMP_COMMUNITY_MAXLEN]; + u_char comm[SNMP_COMMUNITY_MAXLEN + 1]; int version; }; enum { From owner-svn-src-all@freebsd.org Wed Jun 8 17:50:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B522B6FC10; Wed, 8 Jun 2016 17:50:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2369D1BC2; Wed, 8 Jun 2016 17:50:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Hoqau037415; Wed, 8 Jun 2016 17:50:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HopMR037411; Wed, 8 Jun 2016 17:50:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081750.u58HopMR037411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301664 - in stable/9/contrib/bsnmp: snmp_mibII snmpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:50:53 -0000 Author: ngie Date: Wed Jun 8 17:50:51 2016 New Revision: 301664 URL: https://svnweb.freebsd.org/changeset/base/301664 Log: MFstable/10 r301663: MFC r294507,r294567,r299466: r294507 (by harti): Fill the ifAlias leaf of the ifXTable with the interface description if there is one available and it fits into the maximum size (64 characters). r294567 (by bz): Change the variable to a #define in order to make gcc happy which otherwise will complain about "variably modified 'alias' at file scope". Unbreaks the build on gcc platforms. r299466 (by cem): bsnmpd: Fix size of trapsink::comm to match other community arrays This fixes a number of possible strcpy() buffer overruns between the various community strings in trap.c. CIDs: 1006820, 1006821, 1006822 Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII.c stable/9/contrib/bsnmp/snmp_mibII/mibII.h stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c stable/9/contrib/bsnmp/snmpd/snmpd.h Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) stable/9/contrib/bsnmp/snmp_mibII/ (props changed) Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/9/contrib/bsnmp/snmp_mibII/mibII.c Wed Jun 8 17:49:03 2016 (r301663) +++ stable/9/contrib/bsnmp/snmp_mibII/mibII.c Wed Jun 8 17:50:51 2016 (r301664) @@ -443,6 +443,7 @@ mib_fetch_ifmib(struct mibif *ifp) size_t len; void *newmib; struct ifmibdata oldmib = ifp->mib; + struct ifreq irr; if (fetch_generic_mib(ifp, &oldmib) == -1) return (-1); @@ -514,6 +515,18 @@ mib_fetch_ifmib(struct mibif *ifp) } out: + strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); + irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; + irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); + if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { + MIBIF_PRIV(ifp)->alias[0] = 0; + if (errno != ENOMSG) + syslog(LOG_WARNING, "SIOCGIFDESCR (%s): %m", ifp->name); + } else if (irr.ifr_buffer.buffer == NULL) { + MIBIF_PRIV(ifp)->alias[0] = 0; + syslog(LOG_WARNING, "SIOCGIFDESCR (%s): too long (%zu)", + ifp->name, irr.ifr_buffer.length); + } ifp->mibtick = get_ticks(); return (0); } Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- stable/9/contrib/bsnmp/snmp_mibII/mibII.h Wed Jun 8 17:49:03 2016 (r301663) +++ stable/9/contrib/bsnmp/snmp_mibII/mibII.h Wed Jun 8 17:50:51 2016 (r301664) @@ -56,6 +56,9 @@ #include "snmp_mibII.h" #include "mibII_tree.h" +/* maximum size of the interface alias */ +#define MIBIF_ALIAS_SIZE (64 + 1) + /* * Interface list and flags. */ @@ -76,6 +79,9 @@ struct mibif_private { uint64_t hc_opackets; uint64_t hc_imcasts; uint64_t hc_ipackets; + + /* this should be made public */ + char alias[MIBIF_ALIAS_SIZE]; }; #define MIBIF_PRIV(IFP) ((struct mibif_private *)((IFP)->private)) Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Wed Jun 8 17:49:03 2016 (r301663) +++ stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Wed Jun 8 17:50:51 2016 (r301664) @@ -528,7 +528,7 @@ op_ifxtable(struct snmp_context *ctx, st break; case LEAF_ifAlias: - ret = string_get(value, "", -1); + ret = string_get(value, MIBIF_PRIV(ifp)->alias, -1); break; case LEAF_ifCounterDiscontinuityTime: Modified: stable/9/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/9/contrib/bsnmp/snmpd/snmpd.h Wed Jun 8 17:49:03 2016 (r301663) +++ stable/9/contrib/bsnmp/snmpd/snmpd.h Wed Jun 8 17:50:51 2016 (r301664) @@ -307,7 +307,7 @@ struct trapsink { struct asn_oid index; u_int status; int socket; - u_char comm[SNMP_COMMUNITY_MAXLEN]; + u_char comm[SNMP_COMMUNITY_MAXLEN + 1]; int version; }; enum { From owner-svn-src-all@freebsd.org Wed Jun 8 17:51:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A43B6FC70; Wed, 8 Jun 2016 17:51:23 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 143551D64; Wed, 8 Jun 2016 17:51:23 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HpMJd039459; Wed, 8 Jun 2016 17:51:22 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HpLZs039447; Wed, 8 Jun 2016 17:51:21 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606081751.u58HpLZs039447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 8 Jun 2016 17:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301665 - in head: contrib/bmake usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:51:23 -0000 Author: sjg Date: Wed Jun 8 17:51:21 2016 New Revision: 301665 URL: https://svnweb.freebsd.org/changeset/base/301665 Log: Merge bmake-20160606 o dir.c: extend mtimes cache to others via cached_stat() Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/README head/contrib/bmake/config.h.in head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/dir.c head/contrib/bmake/hash.h head/contrib/bmake/main.c head/contrib/bmake/make.h head/contrib/bmake/meta.c head/usr.bin/bmake/Makefile head/usr.bin/bmake/config.h Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/ChangeLog Wed Jun 8 17:51:21 2016 (r301665) @@ -1,3 +1,9 @@ +2016-06-06 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160606 + Merge with NetBSD make, pick up + o dir.c: extend mtimes cache to others via cached_stat() + 2016-06-04 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160604 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/Makefile Wed Jun 8 17:51:21 2016 (r301665) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.66 2016/06/04 22:21:15 sjg Exp $ +# $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160604 +_MAKE_VERSION= 20160606 PROG= bmake Modified: head/contrib/bmake/README ============================================================================== --- head/contrib/bmake/README Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/README Wed Jun 8 17:51:21 2016 (r301665) @@ -1,47 +1,52 @@ bmake + ***** -This directory contains a port of the BSD make tool (from NetBSD) -I have run it on SunOS,Solaris,HP-UX,AIX,IRIX,FreeBSD and Linux. +This directory contains a port of the BSD make tool (from NetBSD). +Since 1993 I have run it on AIX, BSDi, Darwin, FreeBSD, HP-UX, IRIX, +Linux, Minix, OSF, Solaris, SunOS and even UTS. +Others have run it on many more systems. -Version 3 was re-worked from scratch to better facilitate -importing newer make(1) versions from NetBSD. The original code base -was NetBSD-1.0, so version 3 was built by doing a fresh import of the -NetBSD-1.0 usr.bin/make, adding the autoconf and other portability -patches to sync it with bmake v2, and then NetBSD's make -of Feb 20, 2000 was imported and conflicts dealt with. -NetBSD's make was again imported on June 6 and December 15, 2000. +Currently each release is tested on NetBSD, FreeBSD, Solaris and Linux. -In 2003 bmake switched to a date based version (first was 20030714) +Since 2003 bmake switched to a date based version (first was 20030714) which generally represents the date it was last merged with NetBSD's make. Since then, NetBSD's make is imported within a week of any interesting changes, so that bmake tracks it very closely. -Building: +Building +======== -The preferred way to bootstrap bmake is: +The preferred way to bootstrap bmake is:: -./bmake/boot-strap + ./bmake/boot-strap there are a number of args - most of which get passed to configure, eg. +:: -./bmake/boot-strap --prefix=/opt + ./bmake/boot-strap --prefix=/opt see the boot-strap script for details. +For folk that hate to read anything, since 20121212 you can also use +the GNU standard process of:: + + ./configure; make; make install + To make much use of bmake you will need the bsd.*.mk macros or my -portable *.mk macros. See +portable *.mk macros which are included with bmake since 20121212 +and separately available from http://www.crufty.net/ftp/pub/sjg/mk.tar.gz which will be links to the latest versions. -On a non-BSD system, you would want to unpack mk[-YYYYmmdd].tar.gz in -the same directory as bmake (so ./mk and ./bmake exist), and -./bmake/boot-strap will do the rest. +Porting +======= + +If you encounter a system that bmake does not build or work on *out of +the box*, I welcome patches. +If you can provide access to a suitable machine - even better. -If you want to do it all by hand then read boot-strap first to get the -idea. +More info can be found at http://www.crufty.net/help/sjg/bmake.htm -Even if you have an earlier version of bmake installed, use boot-strap -to ensure that all goes well. +--sjg ---sjg Modified: head/contrib/bmake/config.h.in ============================================================================== --- head/contrib/bmake/config.h.in Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/config.h.in Wed Jun 8 17:51:21 2016 (r301665) @@ -324,6 +324,9 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to `int' if does not define. */ +#undef mode_t + /* Define to `long int' if does not define. */ #undef off_t Modified: head/contrib/bmake/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bmake/configure.in ============================================================================== --- head/contrib/bmake/configure.in Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/configure.in Wed Jun 8 17:51:21 2016 (r301665) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.56 2015/10/25 05:20:48 sjg Exp $ +dnl $Id: configure.in,v 1.57 2016/06/07 00:49:44 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20151022], [sjg@NetBSD.org]) +AC_INIT([bmake], [20160606], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -148,6 +148,7 @@ dnl Checks for typedefs, structures, and AC_C___ATTRIBUTE__ AC_C_BIGENDIAN AC_C_CONST +AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T Modified: head/contrib/bmake/dir.c ============================================================================== --- head/contrib/bmake/dir.c Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/dir.c Wed Jun 8 17:51:21 2016 (r301665) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $ */ +/* $NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"); +__RCSID("$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -244,6 +244,7 @@ static Hash_Table mtimes; /* Results o * be two rules to update a single file, so this * should be ok, but... */ +static Hash_Table lmtimes; /* same as mtimes but for lstat */ static int DirFindName(const void *, const void *); static int DirMatchFiles(const char *, Path *, Lst); @@ -256,6 +257,80 @@ static char *DirLookupSubdir(Path *, con static char *DirFindDot(Boolean, const char *, const char *); static char *DirLookupAbs(Path *, const char *, const char *); + +/* + * We use stat(2) a lot, cache the results + * mtime and mode are all we care about. + */ +struct cache_st { + time_t mtime; + mode_t mode; +}; + +/* minimize changes below */ +static time_t +Hash_GetTimeValue(Hash_Entry *entry) +{ + struct cache_st *cst; + + cst = entry->clientPtr; + return cst->mtime; +} + +#define CST_LSTAT 1 +#define CST_UPDATE 2 + +static int +cached_stats(Hash_Table *htp, const char *pathname, struct stat *st, int flags) +{ + Hash_Entry *entry; + struct cache_st *cst; + int rc; + + if (!pathname || !pathname[0]) + return -1; + + entry = Hash_FindEntry(htp, pathname); + + if (entry && (flags & CST_UPDATE) == 0) { + cst = entry->clientPtr; + + memset(st, 0, sizeof(*st)); + st->st_mtime = cst->mtime; + st->st_mode = cst->mode; + return 0; + } + + rc = (flags & CST_LSTAT) ? lstat(pathname, st) : stat(pathname, st); + if (rc == -1) + return -1; + + if (st->st_mtime == 0) + st->st_mtime = 1; /* avoid confusion with missing file */ + + if (!entry) + entry = Hash_CreateEntry(htp, pathname, NULL); + if (!entry->clientPtr) + entry->clientPtr = bmake_malloc(sizeof(*cst)); + cst = entry->clientPtr; + cst->mtime = st->st_mtime; + cst->mode = st->st_mode; + + return 0; +} + +int +cached_stat(const char *pathname, void *st) +{ + return cached_stats(&mtimes, pathname, st, 0); +} + +int +cached_lstat(const char *pathname, void *st) +{ + return cached_stats(&lmtimes, pathname, st, CST_LSTAT); +} + /*- *----------------------------------------------------------------------- * Dir_Init -- @@ -274,6 +349,7 @@ Dir_Init(const char *cdname) dirSearchPath = Lst_Init(FALSE); openDirectories = Lst_Init(FALSE); Hash_InitTable(&mtimes, 0); + Hash_InitTable(&lmtimes, 0); Dir_InitCur(cdname); @@ -901,7 +977,6 @@ static char * DirLookupSubdir(Path *p, const char *name) { struct stat stb; /* Buffer for stat, if necessary */ - Hash_Entry *entry; /* Entry for mtimes table */ char *file; /* the current filename to check */ if (p != dot) { @@ -917,9 +992,7 @@ DirLookupSubdir(Path *p, const char *nam fprintf(debug_file, "checking %s ...\n", file); } - if (stat(file, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; + if (cached_stat(file, &stb) == 0) { /* * Save the modification time so if it's needed, we don't have * to fetch it again. @@ -928,8 +1001,6 @@ DirLookupSubdir(Path *p, const char *nam fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), file); } - entry = Hash_CreateEntry(&mtimes, file, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); nearmisses += 1; return (file); } @@ -1312,15 +1383,11 @@ Dir_FindFile(const char *name, Lst path) fprintf(debug_file, " got it (in mtime cache)\n"); } return(bmake_strdup(name)); - } else if (stat(name, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; - entry = Hash_CreateEntry(&mtimes, name, NULL); + } else if (cached_stat(name, &stb) == 0) { if (DEBUG(DIR)) { fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), name); } - Hash_SetTimeValue(entry, stb.st_mtime); return (bmake_strdup(name)); } else { if (DEBUG(DIR)) { @@ -1368,7 +1435,7 @@ Dir_FindHereOrAbove(char *here, char *se /* try and stat(2) it ... */ snprintf(try, sizeof(try), "%s/%s", dirbase, search_path); - if (stat(try, &st) != -1) { + if (cached_stat(try, &st) != -1) { /* * success! if we found a file, chop off * the filename so we return a directory. @@ -1489,12 +1556,12 @@ Dir_MTime(GNode *gn, Boolean recheck) else entry = NULL; if (entry != NULL) { + stb.st_mtime = Hash_GetTimeValue(entry); if (DEBUG(DIR)) { fprintf(debug_file, "Using cached time %s for %s\n", - Targ_FmtTime(Hash_GetTimeValue(entry)), fullName); + Targ_FmtTime(stb.st_mtime), fullName); } - stb.st_mtime = Hash_GetTimeValue(entry); - } else if (stat(fullName, &stb) < 0) { + } else if (cached_stats(&mtimes, fullName, &stb, recheck ? CST_UPDATE : 0) < 0) { if (gn->type & OP_MEMBER) { if (fullName != gn->path) free(fullName); @@ -1502,18 +1569,8 @@ Dir_MTime(GNode *gn, Boolean recheck) } else { stb.st_mtime = 0; } - } else { - if (stb.st_mtime == 0) { - /* - * 0 handled specially by the code, if the time is really 0, - * return something else instead - */ - stb.st_mtime = 1; - } - entry = Hash_CreateEntry(&mtimes, fullName, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); } - + if (fullName && gn->path == NULL) { gn->path = fullName; } Modified: head/contrib/bmake/hash.h ============================================================================== --- head/contrib/bmake/hash.h Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/hash.h Wed Jun 8 17:51:21 2016 (r301665) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.10 2009/01/24 10:59:09 dsl Exp $ */ +/* $NetBSD: hash.h,v 1.11 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -89,10 +89,7 @@ typedef struct Hash_Entry { struct Hash_Entry *next; /* Used to link together all the * entries associated with the same * bucket. */ - union { - void *clientPtr; /* Arbitrary pointer */ - time_t clientTime; /* Arbitrary Time */ - } clientInfo; + void *clientPtr; /* Arbitrary pointer */ unsigned namehash; /* hash value of key */ char name[1]; /* key string */ } Hash_Entry; @@ -125,8 +122,7 @@ typedef struct Hash_Search { * Hash_Entry *h; */ -#define Hash_GetValue(h) ((h)->clientInfo.clientPtr) -#define Hash_GetTimeValue(h) ((h)->clientInfo.clientTime) +#define Hash_GetValue(h) ((h)->clientPtr) /* * Hash_SetValue(h, val); @@ -134,8 +130,7 @@ typedef struct Hash_Search { * char *val; */ -#define Hash_SetValue(h, val) ((h)->clientInfo.clientPtr = (val)) -#define Hash_SetTimeValue(h, val) ((h)->clientInfo.clientTime = (val)) +#define Hash_SetValue(h, val) ((h)->clientPtr = (val)) /* * Hash_Size(n) returns the number of words in an object of n bytes Modified: head/contrib/bmake/main.c ============================================================================== --- head/contrib/bmake/main.c Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/main.c Wed Jun 8 17:51:21 2016 (r301665) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $ */ +/* $NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"); #endif #endif /* not lint */ #endif @@ -1906,15 +1906,11 @@ cached_realpath(const char *pathname, ch rp = Var_Value(pathname, cache, &cp); if (rp) { /* a hit */ - if (resolved) - strlcpy(resolved, rp, MAXPATHLEN); - else - resolved = bmake_strdup(rp); - } else { - if ((rp = realpath(pathname, resolved))) { - Var_Set(pathname, rp, cache, 0); - } + strlcpy(resolved, rp, MAXPATHLEN); + } else if ((rp = realpath(pathname, resolved))) { + Var_Set(pathname, rp, cache, 0); } + free(cp); return rp ? resolved : NULL; } Modified: head/contrib/bmake/make.h ============================================================================== --- head/contrib/bmake/make.h Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/make.h Wed Jun 8 17:51:21 2016 (r301665) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.99 2016/06/03 01:21:59 sjg Exp $ */ +/* $NetBSD: make.h,v 1.100 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -506,6 +506,8 @@ void Main_ExportMAKEFLAGS(Boolean); Boolean Main_SetObjdir(const char *); int mkTempFile(const char *, char **); int str2Lst_Append(Lst, char *, const char *); +int cached_lstat(const char *, void *); +int cached_stat(const char *, void *); #define VARF_UNDEFERR 1 #define VARF_WANTRES 2 Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Wed Jun 8 17:50:51 2016 (r301664) +++ head/contrib/bmake/meta.c Wed Jun 8 17:51:21 2016 (r301665) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.60 2016/06/04 22:17:14 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.61 2016/06/07 00:40:00 sjg Exp $ */ /* * Implement 'meta' mode. @@ -429,7 +429,7 @@ meta_needed(GNode *gn, const char *dname } /* The object directory may not exist. Check it.. */ - if (stat(dname, &fs) != 0) { + if (cached_stat(dname, &fs) != 0) { if (verbose) fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n", gn->name); @@ -1238,8 +1238,8 @@ meta_oodate(GNode *gn, Boolean oodate) if ((strstr("tmp", p))) break; - if ((link_src != NULL && lstat(p, &fs) < 0) || - (link_src == NULL && stat(p, &fs) < 0)) { + if ((link_src != NULL && cached_lstat(p, &fs) < 0) || + (link_src == NULL && cached_stat(p, &fs) < 0)) { if (Lst_Find(missingFiles, p, string_match) == NULL) Lst_AtEnd(missingFiles, bmake_strdup(p)); } @@ -1328,7 +1328,7 @@ meta_oodate(GNode *gn, Boolean oodate) if (DEBUG(META)) fprintf(debug_file, "%s: %d: looking for: %s\n", fname, lineno, *sdp); #endif - if (stat(*sdp, &fs) == 0) { + if (cached_stat(*sdp, &fs) == 0) { found = 1; p = *sdp; } Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Wed Jun 8 17:50:51 2016 (r301664) +++ head/usr.bin/bmake/Makefile Wed Jun 8 17:51:21 2016 (r301665) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.66 2016/06/04 22:21:15 sjg Exp $ +# $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160604 +_MAKE_VERSION= 20160606 PROG?= ${.CURDIR:T} Modified: head/usr.bin/bmake/config.h ============================================================================== --- head/usr.bin/bmake/config.h Wed Jun 8 17:50:51 2016 (r301664) +++ head/usr.bin/bmake/config.h Wed Jun 8 17:51:21 2016 (r301665) @@ -245,7 +245,7 @@ #define PACKAGE_NAME "bmake" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "bmake 20151022" +#define PACKAGE_STRING "bmake 20160606" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "bmake" @@ -254,7 +254,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "20151022" +#define PACKAGE_VERSION "20160606" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void @@ -326,6 +326,9 @@ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ +/* Define to `int' if does not define. */ +/* #undef mode_t */ + /* Define to `long int' if does not define. */ /* #undef off_t */ From owner-svn-src-all@freebsd.org Wed Jun 8 17:57:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADB54B6FDB7; Wed, 8 Jun 2016 17:57:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3191129; Wed, 8 Jun 2016 17:57:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Hvg89041094; Wed, 8 Jun 2016 17:57:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HvggL041090; Wed, 8 Jun 2016 17:57:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201606081757.u58HvggL041090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 8 Jun 2016 17:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301666 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:57:43 -0000 Author: tuexen Date: Wed Jun 8 17:57:42 2016 New Revision: 301666 URL: https://svnweb.freebsd.org/changeset/base/301666 Log: Use a separate MID counter for ordered und unordered messages for each outgoing stream. Thanks to Jens Hoelscher for reporting the issue. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Jun 8 17:51:21 2016 (r301665) +++ head/sys/netinet/sctp_input.c Wed Jun 8 17:57:42 2016 (r301666) @@ -1969,7 +1969,8 @@ sctp_process_cookie_existing(struct mbuf asoc->strmout[i].abandoned_unsent[0] = 0; #endif stcb->asoc.strmout[i].stream_no = i; - stcb->asoc.strmout[i].next_sequence_send = 0; + stcb->asoc.strmout[i].next_mid_ordered = 0; + stcb->asoc.strmout[i].next_mid_unordered = 0; stcb->asoc.strmout[i].last_msg_incomplete = 0; } /* process the INIT-ACK info (my info) */ @@ -3521,11 +3522,13 @@ sctp_reset_out_streams(struct sctp_tcb * /* no such stream */ continue; } - stcb->asoc.strmout[temp].next_sequence_send = 0; + stcb->asoc.strmout[temp].next_mid_ordered = 0; + stcb->asoc.strmout[temp].next_mid_unordered = 0; } } else { for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_send = 0; + stcb->asoc.strmout[i].next_mid_ordered = 0; + stcb->asoc.strmout[i].next_mid_unordered = 0; } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jun 8 17:51:21 2016 (r301665) +++ head/sys/netinet/sctp_output.c Wed Jun 8 17:57:42 2016 (r301666) @@ -3643,7 +3643,8 @@ sctp_process_cmsgs_for_init(struct sctp_ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].chunks_on_queues = 0; - stcb->asoc.strmout[i].next_sequence_send = 0; + stcb->asoc.strmout[i].next_mid_ordered = 0; + stcb->asoc.strmout[i].next_mid_unordered = 0; #if defined(SCTP_DETAILED_STR_STATS) for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { stcb->asoc.strmout[i].abandoned_sent[j] = 0; @@ -6381,7 +6382,6 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; sp->fsn = 0; - sp->msg_id = atomic_fetchadd_int(&stcb->asoc.assoc_msg_id, 1); if (sp->sinfo_flags & SCTP_ADDR_OVER) { sp->net = net; atomic_add_int(&sp->net->ref_count, 1); @@ -7568,10 +7568,28 @@ dont_do_it: chk->asoc = &stcb->asoc; chk->pad_inplace = 0; chk->no_fr_allowed = 0; - chk->rec.data.stream_seq = strq->next_sequence_send; - if ((rcv_flags & SCTP_DATA_LAST_FRAG) && - !(rcv_flags & SCTP_DATA_UNORDERED)) { - strq->next_sequence_send++; + if (stcb->asoc.idata_supported == 0) { + if (rcv_flags & SCTP_DATA_UNORDERED) { + /* Just use 0. The receiver ignores the values. */ + chk->rec.data.stream_seq = 0; + } else { + chk->rec.data.stream_seq = strq->next_mid_ordered; + if (rcv_flags & SCTP_DATA_LAST_FRAG) { + strq->next_mid_ordered++; + } + } + } else { + if (rcv_flags & SCTP_DATA_UNORDERED) { + chk->rec.data.stream_seq = strq->next_mid_unordered; + if (rcv_flags & SCTP_DATA_LAST_FRAG) { + strq->next_mid_unordered++; + } + } else { + chk->rec.data.stream_seq = strq->next_mid_ordered; + if (rcv_flags & SCTP_DATA_LAST_FRAG) { + strq->next_mid_ordered++; + } + } } chk->rec.data.stream_number = sp->stream; chk->rec.data.payloadtype = sp->ppid; @@ -7630,7 +7648,7 @@ dont_do_it: dchkh->ch.chunk_flags = chk->rec.data.rcv_flags; dchkh->dp.tsn = htonl(chk->rec.data.TSN_seq); dchkh->dp.stream_id = htons((strq->stream_no & 0x0000ffff)); - dchkh->dp.stream_sequence = htons(chk->rec.data.stream_seq); + dchkh->dp.stream_sequence = htons((uint16_t) chk->rec.data.stream_seq); dchkh->dp.protocol_id = chk->rec.data.payloadtype; dchkh->ch.chunk_length = htons(chk->send_size); } else { @@ -7638,9 +7656,8 @@ dont_do_it: ndchkh->ch.chunk_flags = chk->rec.data.rcv_flags; ndchkh->dp.tsn = htonl(chk->rec.data.TSN_seq); ndchkh->dp.stream_id = htons(strq->stream_no); - /* WHAT DO WE DO HERE??? */ ndchkh->dp.reserved = htons(0); - ndchkh->dp.msg_id = htonl(sp->msg_id); + ndchkh->dp.msg_id = htonl(chk->rec.data.stream_seq); if (sp->fsn == 0) ndchkh->dp.ppid_fsn.protocol_id = chk->rec.data.payloadtype; else @@ -12235,7 +12252,8 @@ sctp_send_str_reset_req(struct sctp_tcb for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; - stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send; + stcb->asoc.strmout[i].next_mid_ordered = oldstream[i].next_mid_ordered; + stcb->asoc.strmout[i].next_mid_unordered = oldstream[i].next_mid_unordered; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].state = oldstream[i].state; @@ -12267,7 +12285,8 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.strmout[i].abandoned_sent[0] = 0; stcb->asoc.strmout[i].abandoned_unsent[0] = 0; #endif - stcb->asoc.strmout[i].next_sequence_send = 0x0; + stcb->asoc.strmout[i].next_mid_ordered = 0; + stcb->asoc.strmout[i].next_mid_unordered = 0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); @@ -12425,7 +12444,6 @@ sctp_copy_it_in(struct sctp_tcb *stcb, sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; sp->fsn = 0; - sp->msg_id = atomic_fetchadd_int(&stcb->asoc.assoc_msg_id, 1); (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Wed Jun 8 17:51:21 2016 (r301665) +++ head/sys/netinet/sctp_structs.h Wed Jun 8 17:57:42 2016 (r301666) @@ -522,7 +522,6 @@ struct sctp_stream_queue_pending { TAILQ_ENTRY(sctp_stream_queue_pending) next; TAILQ_ENTRY(sctp_stream_queue_pending) ss_next; uint32_t fsn; - uint32_t msg_id; uint32_t length; uint32_t timetolive; uint32_t ppid; @@ -619,7 +618,12 @@ struct sctp_stream_out { uint32_t abandoned_unsent[1]; uint32_t abandoned_sent[1]; #endif - uint32_t next_sequence_send; /* next one I expect to send out */ + /* + * For associations using DATA chunks, the lower 16-bit of + * next_mid_ordered are used as the next SSN. + */ + uint32_t next_mid_ordered; + uint32_t next_mid_unordered; uint16_t stream_no; uint8_t last_msg_incomplete; uint8_t state; @@ -893,7 +897,6 @@ struct sctp_association { uint32_t stream_scheduling_module; uint32_t vrf_id; - uint32_t assoc_msg_id; uint32_t cookie_preserve_req; /* ASCONF next seq I am sending out, inits at init-tsn */ uint32_t asconf_seq_out; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Jun 8 17:51:21 2016 (r301665) +++ head/sys/netinet/sctputil.c Wed Jun 8 17:57:42 2016 (r301666) @@ -1123,7 +1123,8 @@ sctp_init_asoc(struct sctp_inpcb *inp, s * that were dropped must be notified to the upper layer as * failed to send. */ - asoc->strmout[i].next_sequence_send = 0x0; + asoc->strmout[i].next_mid_ordered = 0; + asoc->strmout[i].next_mid_unordered = 0; TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].chunks_on_queues = 0; #if defined(SCTP_DETAILED_STR_STATS) @@ -4836,10 +4837,22 @@ sctp_release_pr_sctp_chunk(struct sctp_t goto oh_well; } memset(chk, 0, sizeof(*chk)); - chk->rec.data.rcv_flags = SCTP_DATA_LAST_FRAG; + chk->rec.data.rcv_flags = 0; chk->sent = SCTP_FORWARD_TSN_SKIP; chk->asoc = &stcb->asoc; - chk->rec.data.stream_seq = strq->next_sequence_send; + if (stcb->asoc.idata_supported == 0) { + if (sp->sinfo_flags & SCTP_UNORDERED) { + chk->rec.data.stream_seq = 0; + } else { + chk->rec.data.stream_seq = strq->next_mid_ordered; + } + } else { + if (sp->sinfo_flags & SCTP_UNORDERED) { + chk->rec.data.stream_seq = strq->next_mid_unordered; + } else { + chk->rec.data.stream_seq = strq->next_mid_ordered; + } + } chk->rec.data.stream_number = sp->stream; chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; @@ -4850,10 +4863,19 @@ sctp_release_pr_sctp_chunk(struct sctp_t TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); stcb->asoc.sent_queue_cnt++; stcb->asoc.pr_sctp_cnt++; + } + chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; + if (stcb->asoc.idata_supported == 0) { + if ((sp->sinfo_flags & SCTP_UNORDERED) == 0) { + strq->next_mid_ordered++; + } } else { - chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; + if (sp->sinfo_flags & SCTP_UNORDERED) { + strq->next_mid_unordered++; + } else { + strq->next_mid_ordered++; + } } - strq->next_sequence_send++; oh_well: if (sp->data) { /* From owner-svn-src-all@freebsd.org Wed Jun 8 17:59:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A188CB6FE41; Wed, 8 Jun 2016 17:59:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73BD712BD; Wed, 8 Jun 2016 17:59:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58HxLLc041263; Wed, 8 Jun 2016 17:59:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58HxLgp041261; Wed, 8 Jun 2016 17:59:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081759.u58HxLgp041261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 17:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301667 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 17:59:22 -0000 Author: ngie Date: Wed Jun 8 17:59:21 2016 New Revision: 301667 URL: https://svnweb.freebsd.org/changeset/base/301667 Log: MFC r299834: Fix .Dd Today is the 14th, not the 10th of May Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 17:57:42 2016 (r301666) +++ stable/10/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 17:59:21 2016 (r301667) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd May 10, 2016 +.Dd May 14, 2016 .Dt BSNMPD 1 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Jun 8 18:00:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7AA6B6FEF6; Wed, 8 Jun 2016 18:00:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8995A145E; Wed, 8 Jun 2016 18:00:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58I07mZ041403; Wed, 8 Jun 2016 18:00:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58I07ve041402; Wed, 8 Jun 2016 18:00:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081800.u58I07ve041402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301668 - stable/9/contrib/bsnmp/snmpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:00:08 -0000 Author: ngie Date: Wed Jun 8 18:00:07 2016 New Revision: 301668 URL: https://svnweb.freebsd.org/changeset/base/301668 Log: MFstable/10 r301667: MFC r299834: Fix .Dd Today is the 14th, not the 10th of May Modified: stable/9/contrib/bsnmp/snmpd/bsnmpd.1 Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/9/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 17:59:21 2016 (r301667) +++ stable/9/contrib/bsnmp/snmpd/bsnmpd.1 Wed Jun 8 18:00:07 2016 (r301668) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd May 10, 2016 +.Dd May 14, 2016 .Dt BSNMPD 1 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Jun 8 18:05:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C43A9B6F094; Wed, 8 Jun 2016 18:05:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90E871A11; Wed, 8 Jun 2016 18:05:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58I5q4r044986; Wed, 8 Jun 2016 18:05:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58I5qRT044985; Wed, 8 Jun 2016 18:05:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081805.u58I5qRT044985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301669 - stable/10/usr.sbin/bsnmpd/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:05:53 -0000 Author: ngie Date: Wed Jun 8 18:05:52 2016 New Revision: 301669 URL: https://svnweb.freebsd.org/changeset/base/301669 Log: MFC r299806: Bump WARNS to 6 Modified: stable/10/usr.sbin/bsnmpd/tools/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/Makefile.inc ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/Makefile.inc Wed Jun 8 18:00:07 2016 (r301668) +++ stable/10/usr.sbin/bsnmpd/tools/Makefile.inc Wed Jun 8 18:05:52 2016 (r301669) @@ -11,3 +11,5 @@ LIBBSNMPTOOLSDIR= ${.OBJDIR}/../lib LIBBSNMPTOOLSDIR= ${.CURDIR}/../libbsnmptools .endif LIBBSNMPTOOLS= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a + +WARNS?= 6 From owner-svn-src-all@freebsd.org Wed Jun 8 18:07:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0996B6F12E; Wed, 8 Jun 2016 18:07:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A17D01BCB; Wed, 8 Jun 2016 18:07:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58I7pMC045137; Wed, 8 Jun 2016 18:07:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58I7pTB045136; Wed, 8 Jun 2016 18:07:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081807.u58I7pTB045136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301670 - stable/9/usr.sbin/bsnmpd/tools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:07:52 -0000 Author: ngie Date: Wed Jun 8 18:07:51 2016 New Revision: 301670 URL: https://svnweb.freebsd.org/changeset/base/301670 Log: MFstable/10 r301669: MFC r299806: Bump WARNS to 6 Modified: stable/9/usr.sbin/bsnmpd/tools/Makefile.inc Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/Makefile.inc ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/Makefile.inc Wed Jun 8 18:05:52 2016 (r301669) +++ stable/9/usr.sbin/bsnmpd/tools/Makefile.inc Wed Jun 8 18:07:51 2016 (r301670) @@ -11,3 +11,5 @@ LIBBSNMPTOOLSDIR= ${.OBJDIR}/../lib LIBBSNMPTOOLSDIR= ${.CURDIR}/../libbsnmptools .endif LIBBSNMPTOOLS= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a + +WARNS?= 6 From owner-svn-src-all@freebsd.org Wed Jun 8 18:08:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF977B6F177; Wed, 8 Jun 2016 18:08:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0BC81D0E; Wed, 8 Jun 2016 18:08:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58I86GB045194; Wed, 8 Jun 2016 18:08:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58I86a9045193; Wed, 8 Jun 2016 18:08:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081808.u58I86a9045193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301671 - stable/10/usr.sbin/bsnmpd/modules/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:08:07 -0000 Author: ngie Date: Wed Jun 8 18:08:06 2016 New Revision: 301671 URL: https://svnweb.freebsd.org/changeset/base/301671 Log: MFC r299815: Remove NO_WERROR.clang from this Makefile This compiles with clang without warnings Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Wed Jun 8 18:07:51 2016 (r301670) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Wed Jun 8 18:08:06 2016 (r301671) @@ -15,8 +15,6 @@ MAN= snmp_mibII.3 CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd CFLAGS+= -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY -DHAVE_SYS_TREE_H -# XXX Work around clang warning, until maintainer approves fix. -NO_WERROR.clang= DEFS= ${MOD}_tree.def INCS= snmp_${MOD}.h From owner-svn-src-all@freebsd.org Wed Jun 8 18:09:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DF3B6F229; Wed, 8 Jun 2016 18:09:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 951AC1EAC; Wed, 8 Jun 2016 18:09:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58I9eKV045317; Wed, 8 Jun 2016 18:09:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58I9egU045316; Wed, 8 Jun 2016 18:09:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081809.u58I9egU045316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301672 - stable/9/usr.sbin/bsnmpd/modules/snmp_mibII X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:09:41 -0000 Author: ngie Date: Wed Jun 8 18:09:40 2016 New Revision: 301672 URL: https://svnweb.freebsd.org/changeset/base/301672 Log: MFstable/10 r301671: MFC r299815: Remove NO_WERROR.clang from this Makefile This compiles with clang without warnings Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Wed Jun 8 18:08:06 2016 (r301671) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Wed Jun 8 18:09:40 2016 (r301672) @@ -15,8 +15,6 @@ MAN= snmp_mibII.3 CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd CFLAGS+= -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY -DHAVE_SYS_TREE_H -# XXX Work around clang warning, until maintainer approves fix. -NO_WERROR.clang= DEFS= ${MOD}_tree.def INCS= snmp_${MOD}.h From owner-svn-src-all@freebsd.org Wed Jun 8 18:14:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F3EAB6F64F; Wed, 8 Jun 2016 18:14:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BC351391; Wed, 8 Jun 2016 18:14:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IE6Eo049124; Wed, 8 Jun 2016 18:14:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IE6Z5049123; Wed, 8 Jun 2016 18:14:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081814.u58IE6Z5049123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301673 - stable/10/lib/libbsnmp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:14:07 -0000 Author: ngie Date: Wed Jun 8 18:14:06 2016 New Revision: 301673 URL: https://svnweb.freebsd.org/changeset/base/301673 Log: MFC r299699: Remove NO_WERROR from libbsnmp/Makefile.inc This has been compiling without warnings with clang/gcc for a while now Tested with: clang 3.8.0, gcc 4.2.x, gcc 5.x Modified: stable/10/lib/libbsnmp/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libbsnmp/Makefile.inc ============================================================================== --- stable/10/lib/libbsnmp/Makefile.inc Wed Jun 8 18:09:40 2016 (r301672) +++ stable/10/lib/libbsnmp/Makefile.inc Wed Jun 8 18:14:06 2016 (r301673) @@ -1,6 +1,5 @@ # $FreeBSD$ -NO_WERROR= INCSDIR= ${INCLUDEDIR}/bsnmp .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Wed Jun 8 18:15:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDA74B6F6F2; Wed, 8 Jun 2016 18:15:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAF9E166A; Wed, 8 Jun 2016 18:15:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IFDEB049230; Wed, 8 Jun 2016 18:15:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IFDs0049229; Wed, 8 Jun 2016 18:15:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081815.u58IFDs0049229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301674 - stable/9/lib/libbsnmp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:15:15 -0000 Author: ngie Date: Wed Jun 8 18:15:13 2016 New Revision: 301674 URL: https://svnweb.freebsd.org/changeset/base/301674 Log: MFstable/10 r301673: MFC r299699: Remove NO_WERROR from libbsnmp/Makefile.inc This has been compiling without warnings with clang/gcc for a while now Tested with: clang 3.8.0, gcc 4.2.x, gcc 5.x Modified: stable/9/lib/libbsnmp/Makefile.inc Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) Modified: stable/9/lib/libbsnmp/Makefile.inc ============================================================================== --- stable/9/lib/libbsnmp/Makefile.inc Wed Jun 8 18:14:06 2016 (r301673) +++ stable/9/lib/libbsnmp/Makefile.inc Wed Jun 8 18:15:13 2016 (r301674) @@ -1,6 +1,5 @@ # $FreeBSD$ -NO_WERROR= INCSDIR= ${INCLUDEDIR}/bsnmp .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Wed Jun 8 18:15:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0CDB6F76D; Wed, 8 Jun 2016 18:15:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE6C417C9; Wed, 8 Jun 2016 18:15:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IFqsw049318; Wed, 8 Jun 2016 18:15:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IFqj7049317; Wed, 8 Jun 2016 18:15:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081815.u58IFqj7049317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301675 - stable/10/contrib/top X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:15:53 -0000 Author: ngie Date: Wed Jun 8 18:15:51 2016 New Revision: 301675 URL: https://svnweb.freebsd.org/changeset/base/301675 Log: MFC r300714: The readme provides a high-level overview of how to upgrade top(1). Reviewed By: ngie Added: stable/10/contrib/top/FREEBSD-upgrade - copied unchanged from r300714, head/contrib/top/FREEBSD-upgrade Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/top/FREEBSD-upgrade (from r300714, head/contrib/top/FREEBSD-upgrade) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/top/FREEBSD-upgrade Wed Jun 8 18:15:51 2016 (r301675, copy of r300714, head/contrib/top/FREEBSD-upgrade) @@ -0,0 +1,22 @@ +$FreeBSD$ + +This file contains notes regarding the upgrade of top(1). See the vendor +import instructions at: + + https://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html#svn-advanced-use-vendor-imports + +The upstream project pages for top(1) are: + + http://www.unixtop.org/ + + https://sourceforge.net/projects/unixtop/ + +contrib/top/machine.h specifies an interface that must be provided by the +target OS. That interface is implemented in usr.bin/top/machine.c + +To enable building on case-insensitive filesystems, the following files were +renamed: + + contrib/top/top.X -> contrib/top/top.xs + contrib/top/top.local.H -> contrib/top/top.local.hs + From owner-svn-src-all@freebsd.org Wed Jun 8 18:16:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC72CB6F814; Wed, 8 Jun 2016 18:16:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DF7519BD; Wed, 8 Jun 2016 18:16:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IGYiQ049417; Wed, 8 Jun 2016 18:16:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IGYDm049416; Wed, 8 Jun 2016 18:16:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081816.u58IGYDm049416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301676 - stable/9/contrib/top X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:16:35 -0000 Author: ngie Date: Wed Jun 8 18:16:34 2016 New Revision: 301676 URL: https://svnweb.freebsd.org/changeset/base/301676 Log: MFstable/10 r301675: MFC r300714: The readme provides a high-level overview of how to upgrade top(1). Reviewed By: ngie Added: stable/9/contrib/top/FREEBSD-upgrade - copied unchanged from r301675, stable/10/contrib/top/FREEBSD-upgrade Modified: Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/top/ (props changed) Copied: stable/9/contrib/top/FREEBSD-upgrade (from r301675, stable/10/contrib/top/FREEBSD-upgrade) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/top/FREEBSD-upgrade Wed Jun 8 18:16:34 2016 (r301676, copy of r301675, stable/10/contrib/top/FREEBSD-upgrade) @@ -0,0 +1,22 @@ +$FreeBSD$ + +This file contains notes regarding the upgrade of top(1). See the vendor +import instructions at: + + https://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html#svn-advanced-use-vendor-imports + +The upstream project pages for top(1) are: + + http://www.unixtop.org/ + + https://sourceforge.net/projects/unixtop/ + +contrib/top/machine.h specifies an interface that must be provided by the +target OS. That interface is implemented in usr.bin/top/machine.c + +To enable building on case-insensitive filesystems, the following files were +renamed: + + contrib/top/top.X -> contrib/top/top.xs + contrib/top/top.local.H -> contrib/top/top.local.hs + From owner-svn-src-all@freebsd.org Wed Jun 8 18:19:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 656BAB6F8E2; Wed, 8 Jun 2016 18:19:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2E11BA2; Wed, 8 Jun 2016 18:19:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IJYwY049612; Wed, 8 Jun 2016 18:19:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IJYnU049610; Wed, 8 Jun 2016 18:19:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081819.u58IJYnU049610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301677 - stable/10/tools/tools/ioat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:19:35 -0000 Author: ngie Date: Wed Jun 8 18:19:34 2016 New Revision: 301677 URL: https://svnweb.freebsd.org/changeset/base/301677 Log: MFC r300856,r300857,r300858,r300874: r300856: Initialize `t` with memset(.., 0, ..) This will help ensure that we're not using random garbage on the stack by accident with respect to the variable r300857: Document the default behavior for -c (0) Bump .Dd for the change r300858: Fix description for -V in the -r case t.verify_test = true is always set when -V is specified, regardless of whether or not the tool is being run in raw mode r300874: Update usage(..) - Document missing options - Sync options with ioatcontrol(8). - Make it clear that the first 2 parameters are always required. Modified: stable/10/tools/tools/ioat/ioatcontrol.8 stable/10/tools/tools/ioat/ioatcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- stable/10/tools/tools/ioat/ioatcontrol.8 Wed Jun 8 18:16:34 2016 (r301676) +++ stable/10/tools/tools/ioat/ioatcontrol.8 Wed Jun 8 18:19:34 2016 (r301677) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd May 27, 2016 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -62,7 +62,8 @@ driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds .It Fl c Ar period -Configure the channel's interrupt coalescing period, in microseconds. +Configure the channel's interrupt coalescing period, in microseconds +(defaults to 0). .It Fl E Test non-contiguous 8k copy. .It Fl f @@ -92,7 +93,7 @@ is a kernel virtual address (by default, .Ar address is assumed to be a physical address) .It Fl V -Dump the resulting hex to syslog +Verify copies/fills for accuracy .It Fl w Write to the specified .Ar address Modified: stable/10/tools/tools/ioat/ioatcontrol.c ============================================================================== --- stable/10/tools/tools/ioat/ioatcontrol.c Wed Jun 8 18:16:34 2016 (r301676) +++ stable/10/tools/tools/ioat/ioatcontrol.c Wed Jun 8 18:19:34 2016 (r301677) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -48,14 +49,19 @@ static void usage(void) { - printf("Usage: %s [-E|-f|-m] OPTIONS [ " + printf("Usage: %s [-c period] [-EfmVz] channel-number num-txns [ " "[ [duration]]]\n", getprogname()); - printf(" %s -r [-v] OPTIONS []\n\n", + printf(" %s -r [-c period] [-vVwz] channel-number address []\n\n", getprogname()); - printf(" OPTIONS:\n"); - printf(" -c - Enable interrupt coalescing (us)\n"); - printf(" -V - Enable verification\n"); - printf(" -z - Zero device stats before test\n"); + printf(" -c period - Enable interrupt coalescing (us) (default: 0)\n"); + printf(" -E - Test non-contiguous 8k copy.\n"); + printf(" -f - Test block fill (default: DMA copy).\n"); + printf(" -m - Test memcpy instead of DMA.\n"); + printf(" -r - Issue DMA to or from a specific address.\n"); + printf(" -V - Enable verification\n"); + printf(" -v -
is a kernel virtual address\n"); + printf(" -w - Write to the specified address\n"); + printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } @@ -104,6 +110,8 @@ main(int argc, char **argv) bool fflag, rflag, Eflag, mflag; unsigned modeflags; + memset(&t, 0, sizeof(t)); + fflag = rflag = Eflag = mflag = false; modeflags = 0; From owner-svn-src-all@freebsd.org Wed Jun 8 18:21:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A08FB6F984; Wed, 8 Jun 2016 18:21:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4812D1DA8; Wed, 8 Jun 2016 18:21:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58ILP9D051741; Wed, 8 Jun 2016 18:21:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58ILPq0051720; Wed, 8 Jun 2016 18:21:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081821.u58ILPq0051720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301678 - stable/10/tools/tools/ioat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:21:26 -0000 Author: ngie Date: Wed Jun 8 18:21:25 2016 New Revision: 301678 URL: https://svnweb.freebsd.org/changeset/base/301678 Log: MFC r300861,r300862: r300861: - Sort make variables - Use SRCTOP instead of ad hoc definition for it r300862: Install ioatcontrol to /usr/bin by default instead of / Modified: stable/10/tools/tools/ioat/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/ioat/Makefile ============================================================================== --- stable/10/tools/tools/ioat/Makefile Wed Jun 8 18:19:34 2016 (r301677) +++ stable/10/tools/tools/ioat/Makefile Wed Jun 8 18:21:25 2016 (r301678) @@ -2,9 +2,13 @@ PROG= ioatcontrol MAN= ioatcontrol.8 -CFLAGS+= -I${.CURDIR:H:H:H}/sys/dev/ioat -WARNS?= 6 +BINDIR?= /usr/bin + +CFLAGS+= -I${SRCTOP}/sys/dev/ioat + #LIBADD= util LDADD= -lutil +WARNS?= 6 + .include From owner-svn-src-all@freebsd.org Wed Jun 8 18:21:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B006BB6F999; Wed, 8 Jun 2016 18:21:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A65D1DAF; Wed, 8 Jun 2016 18:21:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58ILRwj053216; Wed, 8 Jun 2016 18:21:27 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58ILRZr053211; Wed, 8 Jun 2016 18:21:27 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606081821.u58ILRZr053211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 8 Jun 2016 18:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301679 - in head: contrib/libc-vis lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:21:28 -0000 Author: brooks Date: Wed Jun 8 18:21:27 2016 New Revision: 301679 URL: https://svnweb.freebsd.org/changeset/base/301679 Log: Update to a June 8th snapshot of (un)vis form NetBSD. This adds stravis() and some new encoding flags VIS_SHELL, VIS_META, and VIS_NOLOCALE. Assorted cleanups and fixes includeing a manpage typo[0]. PR: 210013 [0] Submitted by: pi [0] Modified: head/contrib/libc-vis/unvis.c head/contrib/libc-vis/vis.3 head/contrib/libc-vis/vis.c head/contrib/libc-vis/vis.h head/lib/libc/gen/Symbol.map Directory Properties: head/contrib/libc-vis/ (props changed) Modified: head/contrib/libc-vis/unvis.c ============================================================================== --- head/contrib/libc-vis/unvis.c Wed Jun 8 18:21:25 2016 (r301678) +++ head/contrib/libc-vis/unvis.c Wed Jun 8 18:21:27 2016 (r301679) @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */ +/* $NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $"); #endif #endif /* LIBC_SCCS and not lint */ __FBSDID("$FreeBSD$"); @@ -322,6 +322,12 @@ unvis(char *cp, int c, int *astate, int */ *astate = SS(0, S_GROUND); return UNVIS_NOCHAR; + default: + if (isgraph(c)) { + *cp = c; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + } } goto bad; Modified: head/contrib/libc-vis/vis.3 ============================================================================== --- head/contrib/libc-vis/vis.3 Wed Jun 8 18:21:25 2016 (r301678) +++ head/contrib/libc-vis/vis.3 Wed Jun 8 18:21:27 2016 (r301679) @@ -1,4 +1,4 @@ -.\" $NetBSD: vis.3,v 1.39 2013/02/20 20:05:26 christos Exp $ +.\" $NetBSD: vis.3,v 1.45 2016/06/08 15:00:04 wiz Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1989, 1991, 1993 @@ -30,13 +30,14 @@ .\" .\" @(#)vis.3 8.1 (Berkeley) 6/9/93 .\" -.Dd February 19, 2013 +.Dd January 14, 2015 .Dt VIS 3 .Os .Sh NAME .Nm vis , .Nm nvis , .Nm strvis , +.Nm stravis , .Nm strnvis , .Nm strvisx , .Nm strnvisx , @@ -60,6 +61,8 @@ .Ft int .Fn strvis "char *dst" "const char *src" "int flag" .Ft int +.Fn stravis "char **dst" "const char *src" "int flag" +.Ft int .Fn strnvis "char *dst" "size_t dlen" "const char *src" "int flag" .Ft int .Fn strvisx "char *dst" "const char *src" "size_t len" "int flag" @@ -112,6 +115,7 @@ encoding format (explained below). .Pp The .Fn strvis , +.Fn stravis , .Fn strnvis , .Fn strvisx , and @@ -158,6 +162,9 @@ forms return the number of characters in (not including the trailing .Dv NUL ) . The +.Fn stravis +function allocates space dynamically to hold the string. +The .Dq Nm n versions of the functions also take an additional argument .Fa dlen @@ -240,11 +247,31 @@ alter this: Also encode the magic characters .Ql ( * , .Ql \&? , -.Ql \&[ +.Ql \&[ , and .Ql # ) recognized by .Xr glob 3 . +.It Dv VIS_SHELL +Also encode the meta characters used by shells (in addition to the glob +characters): +.Ql ( ' , +.Ql ` , +.Ql \&" , +.Ql \&; , +.Ql & , +.Ql < , +.Ql > , +.Ql \&( , +.Ql \&) , +.Ql \&| , +.Ql \&] , +.Ql \e , +.Ql $ , +.Ql \&! , +.Ql \&^ , +and +.Ql ~ ) . .It Dv VIS_SP Also encode space. .It Dv VIS_TAB @@ -253,11 +280,10 @@ Also encode tab. Also encode newline. .It Dv VIS_WHITE Synonym for -.Dv VIS_SP -\&| -.Dv VIS_TAB -\&| -.Dv VIS_NL . +.Dv VIS_SP | VIS_TAB | VIS_NL . +.It Dv VIS_META +Synonym for +.Dv VIS_WHITE | VIS_GLOB | VIS_SHELL . .It Dv VIS_SAFE Only encode .Dq unsafe @@ -418,6 +444,11 @@ The encoding conversion is influenced by environment variable which defines the set of characters that can be copied without encoding. .Pp +If +.Dv VIS_NOLOCALE +is set, processing is done assuming the C locale and overriding +any other environment settings. +.Pp When 8-bit data is present in the input, .Ev LC_CTYPE must be set to the correct locale or to the C locale. @@ -513,7 +544,7 @@ appeared in .Nx 6.0 and .Fx 9.2 . -Myltibyte character support was added in +Multibyte character support was added in .Nx 7.0 and .Fx 9.2 . Modified: head/contrib/libc-vis/vis.c ============================================================================== --- head/contrib/libc-vis/vis.c Wed Jun 8 18:21:25 2016 (r301678) +++ head/contrib/libc-vis/vis.c Wed Jun 8 18:21:27 2016 (r301679) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $ */ +/* $NetBSD: vis.c,v 1.71 2016/01/14 20:41:23 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $"); +__RCSID("$NetBSD: vis.c,v 1.71 2016/01/14 20:41:23 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -97,6 +97,30 @@ static wchar_t *do_svis(wchar_t *, wint_ #undef BELL #define BELL L'\a' + +#if defined(LC_C_LOCALE) +#define iscgraph(c) isgraph_l(c, LC_C_LOCALE) +#else +/* Keep it simple for now, no locale stuff */ +#define iscgraph(c) isgraph(c) +#ifdef notyet +#include +static int +iscgraph(int c) { + int rv; + char *ol; + + ol = setlocale(LC_CTYPE, "C"); + rv = isgraph(c); + if (ol) + setlocale(LC_CTYPE, ol); + return rv; +} +#endif +#endif + +#define ISGRAPH(flags, c) \ + (((flags) & VIS_NOLOCALE) ? iscgraph(c) : iswgraph(c)) #define iswoctal(c) (((u_char)(c)) >= L'0' && ((u_char)(c)) <= L'7') #define iswwhite(c) (c == L' ' || c == L'\t' || c == L'\n') @@ -104,7 +128,10 @@ static wchar_t *do_svis(wchar_t *, wint_ #define xtoa(c) L"0123456789abcdef"[c] #define XTOA(c) L"0123456789ABCDEF"[c] -#define MAXEXTRAS 10 +#define MAXEXTRAS 30 + +static const wchar_t char_shell[] = L"'`\";&<>()|{}]\\$!^~"; +static const wchar_t char_glob[] = L"*?[#"; #if !HAVE_NBTOOL_CONFIG_H #ifndef __NetBSD__ @@ -213,8 +240,23 @@ do_mbyte(wchar_t *dst, wint_t c, int fla *dst++ = L'0'; } return dst; + /* We cannot encode these characters in VIS_CSTYLE + * because they special meaning */ + case L'n': + case L'r': + case L'b': + case L'a': + case L'v': + case L't': + case L'f': + case L's': + case L'0': + case L'M': + case L'^': + case L'$': /* vis(1) -l */ + break; default: - if (iswgraph(c)) { + if (ISGRAPH(flags, c) && !iswoctal(c)) { *dst++ = L'\\'; *dst++ = c; return dst; @@ -266,7 +308,7 @@ do_svis(wchar_t *dst, wint_t c, int flag uint64_t bmsk, wmsk; iswextra = wcschr(extra, c) != NULL; - if (!iswextra && (iswgraph(c) || iswwhite(c) || + if (!iswextra && (ISGRAPH(flags, c) || iswwhite(c) || ((flags & VIS_SAFE) && iswsafe(c)))) { *dst++ = c; return dst; @@ -310,25 +352,27 @@ makeextralist(int flags, const char *src { wchar_t *dst, *d; size_t len; + const wchar_t *s; len = strlen(src); if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) return NULL; - if (mbstowcs(dst, src, len) == (size_t)-1) { + if ((flags & VIS_NOLOCALE) || mbstowcs(dst, src, len) == (size_t)-1) { size_t i; for (i = 0; i < len; i++) - dst[i] = (wint_t)(u_char)src[i]; + dst[i] = (wchar_t)(u_char)src[i]; d = dst + len; } else d = dst + wcslen(dst); - if (flags & VIS_GLOB) { - *d++ = L'*'; - *d++ = L'?'; - *d++ = L'['; - *d++ = L'#'; - } + if (flags & VIS_GLOB) + for (s = char_glob; *s; *d++ = *s++) + continue; + + if (flags & VIS_SHELL) + for (s = char_shell; *s; *d++ = *s++) + continue; if (flags & VIS_SP) *d++ = L' '; if (flags & VIS_TAB) *d++ = L'\t'; @@ -345,7 +389,7 @@ makeextralist(int flags, const char *src * All user-visible functions call this one. */ static int -istrsenvisx(char *mbdst, size_t *dlen, const char *mbsrc, size_t mblength, +istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength, int flags, const char *mbextra, int *cerr_ptr) { wchar_t *dst, *src, *pdst, *psrc, *start, *extra; @@ -353,10 +397,11 @@ istrsenvisx(char *mbdst, size_t *dlen, c uint64_t bmsk, wmsk; wint_t c; visfun_t f; - int clen = 0, cerr = 0, error = -1, i, shft; + int clen = 0, cerr, error = -1, i, shft; + char *mbdst, *mdst; ssize_t mbslength, maxolen; - _DIAGASSERT(mbdst != NULL); + _DIAGASSERT(mbdstp != NULL); _DIAGASSERT(mbsrc != NULL || mblength == 0); _DIAGASSERT(mbextra != NULL); @@ -375,16 +420,28 @@ istrsenvisx(char *mbdst, size_t *dlen, c /* Allocate space for the wide char strings */ psrc = pdst = extra = NULL; + mdst = NULL; if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL) return -1; if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL) goto out; + if (*mbdstp == NULL) { + if ((mdst = calloc((4 * mblength) + 1, sizeof(*mdst))) == NULL) + goto out; + *mbdstp = mdst; + } + + mbdst = *mbdstp; dst = pdst; src = psrc; - /* Use caller's multibyte conversion error flag. */ - if (cerr_ptr) - cerr = *cerr_ptr; + if (flags & VIS_NOLOCALE) { + /* Do one byte at a time conversion */ + cerr = 1; + } else { + /* Use caller's multibyte conversion error flag. */ + cerr = cerr_ptr ? *cerr_ptr : 0; + } /* * Input loop. @@ -439,7 +496,7 @@ istrsenvisx(char *mbdst, size_t *dlen, c errno = ENOSPC; goto out; } - *mbdst = '\0'; /* can't create extra, return "" */ + *mbdst = '\0'; /* can't create extra, return "" */ error = 0; goto out; } @@ -511,9 +568,11 @@ istrsenvisx(char *mbdst, size_t *dlen, c /* Terminate the output string. */ *mbdst = '\0'; - /* Pass conversion error flag out. */ - if (cerr_ptr) - *cerr_ptr = cerr; + if (flags & VIS_NOLOCALE) { + /* Pass conversion error flag out. */ + if (cerr_ptr) + *cerr_ptr = cerr; + } free(extra); free(pdst); @@ -524,14 +583,15 @@ out: free(extra); free(pdst); free(psrc); + free(mdst); return error; } static int -istrsenvisxl(char *mbdst, size_t *dlen, const char *mbsrc, +istrsenvisxl(char **mbdstp, size_t *dlen, const char *mbsrc, int flags, const char *mbextra, int *cerr_ptr) { - return istrsenvisx(mbdst, dlen, mbsrc, + return istrsenvisx(mbdstp, dlen, mbsrc, mbsrc != NULL ? strlen(mbsrc) : 0, flags, mbextra, cerr_ptr); } @@ -554,7 +614,7 @@ svis(char *mbdst, int c, int flags, int cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, NULL, cc, 1, flags, mbextra, NULL); + ret = istrsenvisx(&mbdst, NULL, cc, 1, flags, mbextra, NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -569,7 +629,7 @@ snvis(char *mbdst, size_t dlen, int c, i cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, mbextra, NULL); + ret = istrsenvisx(&mbdst, &dlen, cc, 1, flags, mbextra, NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -578,33 +638,33 @@ snvis(char *mbdst, size_t dlen, int c, i int strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisxl(mbdst, NULL, mbsrc, flags, mbextra, NULL); + return istrsenvisxl(&mbdst, NULL, mbsrc, flags, mbextra, NULL); } int strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisxl(mbdst, &dlen, mbsrc, flags, mbextra, NULL); + return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, mbextra, NULL); } int strsvisx(char *mbdst, const char *mbsrc, size_t len, int flags, const char *mbextra) { - return istrsenvisx(mbdst, NULL, mbsrc, len, flags, mbextra, NULL); + return istrsenvisx(&mbdst, NULL, mbsrc, len, flags, mbextra, NULL); } int strsnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, const char *mbextra) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, NULL); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, mbextra, NULL); } int strsenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, const char *mbextra, int *cerr_ptr) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, cerr_ptr); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, mbextra, cerr_ptr); } #endif @@ -621,7 +681,7 @@ vis(char *mbdst, int c, int flags, int n cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, NULL, cc, 1, flags, "", NULL); + ret = istrsenvisx(&mbdst, NULL, cc, 1, flags, "", NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -636,7 +696,7 @@ nvis(char *mbdst, size_t dlen, int c, in cc[0] = c; cc[1] = nextc; - ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, "", NULL); + ret = istrsenvisx(&mbdst, &dlen, cc, 1, flags, "", NULL); if (ret < 0) return NULL; return mbdst + ret; @@ -653,13 +713,20 @@ nvis(char *mbdst, size_t dlen, int c, in int strvis(char *mbdst, const char *mbsrc, int flags) { - return istrsenvisxl(mbdst, NULL, mbsrc, flags, "", NULL); + return istrsenvisxl(&mbdst, NULL, mbsrc, flags, "", NULL); } int strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags) { - return istrsenvisxl(mbdst, &dlen, mbsrc, flags, "", NULL); + return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL); +} + +int +stravis(char **mbdstp, const char *mbsrc, int flags) +{ + *mbdstp = NULL; + return istrsenvisxl(mbdstp, NULL, mbsrc, flags, "", NULL); } /* @@ -676,19 +743,19 @@ strnvis(char *mbdst, size_t dlen, const int strvisx(char *mbdst, const char *mbsrc, size_t len, int flags) { - return istrsenvisx(mbdst, NULL, mbsrc, len, flags, "", NULL); + return istrsenvisx(&mbdst, NULL, mbsrc, len, flags, "", NULL); } int strnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", NULL); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, "", NULL); } int strenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags, int *cerr_ptr) { - return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", cerr_ptr); + return istrsenvisx(&mbdst, &dlen, mbsrc, len, flags, "", cerr_ptr); } #endif Modified: head/contrib/libc-vis/vis.h ============================================================================== --- head/contrib/libc-vis/vis.h Wed Jun 8 18:21:25 2016 (r301678) +++ head/contrib/libc-vis/vis.h Wed Jun 8 18:21:27 2016 (r301679) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.h,v 1.21 2013/02/20 17:01:15 christos Exp $ */ +/* $NetBSD: vis.h,v 1.24 2016/01/14 20:42:14 christos Exp $ */ /* $FreeBSD$ */ /*- @@ -64,6 +64,9 @@ #define VIS_HTTP1866 0x0400 /* http-style &#num; or &string; */ #define VIS_NOESCAPE 0x0800 /* don't decode `\' */ #define _VIS_END 0x1000 /* for unvis */ +#define VIS_SHELL 0x2000 /* encode shell special characters [not glob] */ +#define VIS_META (VIS_WHITE | VIS_GLOB | VIS_SHELL) +#define VIS_NOLOCALE 0x4000 /* encode using the C locale */ /* * unvis return codes @@ -89,6 +92,7 @@ char *svis(char *, int, int, int, const char *snvis(char *, size_t, int, int, int, const char *); int strvis(char *, const char *, int); +int stravis(char **, const char *, int); int strnvis(char *, size_t, const char *, int); int strsvis(char *, const char *, int, const char *); Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Wed Jun 8 18:21:25 2016 (r301678) +++ head/lib/libc/gen/Symbol.map Wed Jun 8 18:21:27 2016 (r301679) @@ -414,6 +414,7 @@ FBSD_1.4 { pthread_mutexattr_getrobust; pthread_mutexattr_setrobust; scandir_b; + stravis; }; FBSDprivate_1.0 { From owner-svn-src-all@freebsd.org Wed Jun 8 18:22:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37873B6FB73; Wed, 8 Jun 2016 18:22:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0404012A5; Wed, 8 Jun 2016 18:22:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IMt6C053355; Wed, 8 Jun 2016 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IMtc6053354; Wed, 8 Jun 2016 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081822.u58IMtc6053354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301680 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:22:56 -0000 Author: ngie Date: Wed Jun 8 18:22:54 2016 New Revision: 301680 URL: https://svnweb.freebsd.org/changeset/base/301680 Log: MFC r300625: Remove unnecessary memset(.., 0, ..)'s The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO) under the covers, so zeroing out memory is already handled by the underlying calls Modified: stable/10/sys/rpc/svc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc.c ============================================================================== --- stable/10/sys/rpc/svc.c Wed Jun 8 18:21:27 2016 (r301679) +++ stable/10/sys/rpc/svc.c Wed Jun 8 18:22:54 2016 (r301680) @@ -847,9 +847,7 @@ svc_xprt_alloc() SVCXPRT_EXT *ext; xprt = mem_alloc(sizeof(SVCXPRT)); - memset(xprt, 0, sizeof(SVCXPRT)); ext = mem_alloc(sizeof(SVCXPRT_EXT)); - memset(ext, 0, sizeof(SVCXPRT_EXT)); xprt->xp_p3 = ext; refcount_init(&xprt->xp_refs, 1); From owner-svn-src-all@freebsd.org Wed Jun 8 18:23:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8726B6FBD4; Wed, 8 Jun 2016 18:23:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A693142F; Wed, 8 Jun 2016 18:23:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58INXSu053445; Wed, 8 Jun 2016 18:23:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58INXvL053444; Wed, 8 Jun 2016 18:23:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081823.u58INXvL053444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301681 - stable/9/sys/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:23:34 -0000 Author: ngie Date: Wed Jun 8 18:23:33 2016 New Revision: 301681 URL: https://svnweb.freebsd.org/changeset/base/301681 Log: MFstable/10 r301680: MFC r300625: Remove unnecessary memset(.., 0, ..)'s The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO) under the covers, so zeroing out memory is already handled by the underlying calls Modified: stable/9/sys/rpc/svc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/svc.c ============================================================================== --- stable/9/sys/rpc/svc.c Wed Jun 8 18:22:54 2016 (r301680) +++ stable/9/sys/rpc/svc.c Wed Jun 8 18:23:33 2016 (r301681) @@ -848,9 +848,7 @@ svc_xprt_alloc() SVCXPRT_EXT *ext; xprt = mem_alloc(sizeof(SVCXPRT)); - memset(xprt, 0, sizeof(SVCXPRT)); ext = mem_alloc(sizeof(SVCXPRT_EXT)); - memset(ext, 0, sizeof(SVCXPRT_EXT)); xprt->xp_p3 = ext; refcount_init(&xprt->xp_refs, 1); From owner-svn-src-all@freebsd.org Wed Jun 8 18:27:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E355B6FC74; Wed, 8 Jun 2016 18:27:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4EE175B; Wed, 8 Jun 2016 18:27:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IRjQw053640; Wed, 8 Jun 2016 18:27:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IRjlt053639; Wed, 8 Jun 2016 18:27:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081827.u58IRjlt053639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301682 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:27:46 -0000 Author: ngie Date: Wed Jun 8 18:27:44 2016 New Revision: 301682 URL: https://svnweb.freebsd.org/changeset/base/301682 Log: MFC r300386: Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new struct xlist object fails CID: 978277 Modified: stable/10/lib/libc/rpc/svc_generic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/svc_generic.c ============================================================================== --- stable/10/lib/libc/rpc/svc_generic.c Wed Jun 8 18:23:33 2016 (r301681) +++ stable/10/lib/libc/rpc/svc_generic.c Wed Jun 8 18:27:44 2016 (r301682) @@ -121,7 +121,8 @@ svc_create(dispatch, prognum, versnum, n if (l == NULL) { warnx("svc_create: no memory"); mutex_unlock(&xprtlist_lock); - return (0); + num = 0; + goto done; } l->xprt = xprt; l->next = xprtlist; @@ -131,6 +132,7 @@ svc_create(dispatch, prognum, versnum, n } mutex_unlock(&xprtlist_lock); } +done: __rpc_endconf(handle); /* * In case of num == 0; the error messages are generated by the From owner-svn-src-all@freebsd.org Wed Jun 8 18:38:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55E18B6F1E2; Wed, 8 Jun 2016 18:38:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23E5B1136; Wed, 8 Jun 2016 18:38:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Icmwh057502; Wed, 8 Jun 2016 18:38:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IcmTb057501; Wed, 8 Jun 2016 18:38:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081838.u58IcmTb057501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301683 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:38:49 -0000 Author: ngie Date: Wed Jun 8 18:38:48 2016 New Revision: 301683 URL: https://svnweb.freebsd.org/changeset/base/301683 Log: Fix typo with description for $ipv6_cpe_wanif (upstram -> upstream) MFC after: 3 days PR: 210146 Reported by: Sean M. Collins Sponsored by: EMC / Isilon Storage Division Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Jun 8 18:27:44 2016 (r301682) +++ head/etc/defaults/rc.conf Wed Jun 8 18:38:48 2016 (r301683) @@ -481,7 +481,7 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:0000:0000:0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. -ipv6_cpe_wanif="NO" # Set to the upstram interface name if this +ipv6_cpe_wanif="NO" # Set to the upstream interface name if this # node will work as a router to forward IPv6 # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs From owner-svn-src-all@freebsd.org Wed Jun 8 18:41:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C26A5B6F384; Wed, 8 Jun 2016 18:41:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FEF713BB; Wed, 8 Jun 2016 18:41:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IfnQH059640; Wed, 8 Jun 2016 18:41:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Ifnu1059639; Wed, 8 Jun 2016 18:41:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081841.u58Ifnu1059639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301684 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:41:50 -0000 Author: ngie Date: Wed Jun 8 18:41:49 2016 New Revision: 301684 URL: https://svnweb.freebsd.org/changeset/base/301684 Log: MFC r300385: Don't leak `tmp` if `p->nc_lookups` can't be malloced Modified: stable/10/lib/libc/rpc/getnetconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:38:48 2016 (r301683) +++ stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:41:49 2016 (r301684) @@ -727,6 +727,7 @@ struct netconfig *ncp; if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); + free(tmp); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-all@freebsd.org Wed Jun 8 18:43:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E9FBB6F40D; Wed, 8 Jun 2016 18:43:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F96F17B5; Wed, 8 Jun 2016 18:43:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IhBaP060971; Wed, 8 Jun 2016 18:43:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IhBRG060970; Wed, 8 Jun 2016 18:43:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081843.u58IhBRG060970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301685 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:43:12 -0000 Author: ngie Date: Wed Jun 8 18:43:11 2016 New Revision: 301685 URL: https://svnweb.freebsd.org/changeset/base/301685 Log: MFstable/10 r301682: MFC r300386: Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new struct xlist object fails CID: 978277 Modified: stable/9/lib/libc/rpc/svc_generic.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/svc_generic.c ============================================================================== --- stable/9/lib/libc/rpc/svc_generic.c Wed Jun 8 18:41:49 2016 (r301684) +++ stable/9/lib/libc/rpc/svc_generic.c Wed Jun 8 18:43:11 2016 (r301685) @@ -121,7 +121,8 @@ svc_create(dispatch, prognum, versnum, n if (l == NULL) { warnx("svc_create: no memory"); mutex_unlock(&xprtlist_lock); - return (0); + num = 0; + goto done; } l->xprt = xprt; l->next = xprtlist; @@ -131,6 +132,7 @@ svc_create(dispatch, prognum, versnum, n } mutex_unlock(&xprtlist_lock); } +done: __rpc_endconf(handle); /* * In case of num == 0; the error messages are generated by the From owner-svn-src-all@freebsd.org Wed Jun 8 18:43:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53068B6F49D; Wed, 8 Jun 2016 18:43:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB0219B2; Wed, 8 Jun 2016 18:43:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Ihug4061054; Wed, 8 Jun 2016 18:43:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Ihu1j061053; Wed, 8 Jun 2016 18:43:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081843.u58Ihu1j061053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301686 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:43:57 -0000 Author: ngie Date: Wed Jun 8 18:43:56 2016 New Revision: 301686 URL: https://svnweb.freebsd.org/changeset/base/301686 Log: MFstable/10 r301684: MFC r300385: Don't leak `tmp` if `p->nc_lookups` can't be malloced Modified: stable/9/lib/libc/rpc/getnetconfig.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/9/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:43:11 2016 (r301685) +++ stable/9/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:43:56 2016 (r301686) @@ -727,6 +727,7 @@ struct netconfig *ncp; if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); + free(tmp); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-all@freebsd.org Wed Jun 8 18:46:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 730A4B6F536; Wed, 8 Jun 2016 18:46:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 442041B43; Wed, 8 Jun 2016 18:46:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58IkAju061232; Wed, 8 Jun 2016 18:46:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58IkA3k061231; Wed, 8 Jun 2016 18:46:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081846.u58IkA3k061231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301687 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:46:11 -0000 Author: ngie Date: Wed Jun 8 18:46:10 2016 New Revision: 301687 URL: https://svnweb.freebsd.org/changeset/base/301687 Log: MFC r300624: Fix up r300385 I accidentally glossed over the fact that tmp is manipulated via strchr, so if we tried to free `tmp` after r300385, it would have crashed. Create a separate pointer (tmp2) to track the original allocation of `tmp`, and free `tmp2` if `p->nc_lookups` can't be malloced CID: 1356026 Modified: stable/10/lib/libc/rpc/getnetconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:43:56 2016 (r301686) +++ stable/10/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:46:10 2016 (r301687) @@ -697,7 +697,7 @@ dup_ncp(ncp) struct netconfig *ncp; { struct netconfig *p; - char *tmp; + char *tmp, *tmp2; u_int i; if ((tmp=malloc(MAXNETCONFIGLINE)) == NULL) @@ -706,6 +706,7 @@ struct netconfig *ncp; free(tmp); return(NULL); } + tmp2 = tmp; /* * First we dup all the data from matched netconfig buffer. Then we * adjust some of the member pointer to a pre-allocated buffer where @@ -727,7 +728,7 @@ struct netconfig *ncp; if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); - free(tmp); + free(tmp2); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-all@freebsd.org Wed Jun 8 18:47:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA00B6F5A8; Wed, 8 Jun 2016 18:47:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1851CC1; Wed, 8 Jun 2016 18:47:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Il0iY061330; Wed, 8 Jun 2016 18:47:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Il02l061329; Wed, 8 Jun 2016 18:47:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081847.u58Il02l061329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 18:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301688 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:47:01 -0000 Author: ngie Date: Wed Jun 8 18:47:00 2016 New Revision: 301688 URL: https://svnweb.freebsd.org/changeset/base/301688 Log: MFstable/10 r301687: MFC r300624: Fix up r300385 I accidentally glossed over the fact that tmp is manipulated via strchr, so if we tried to free `tmp` after r300385, it would have crashed. Create a separate pointer (tmp2) to track the original allocation of `tmp`, and free `tmp2` if `p->nc_lookups` can't be malloced CID: 1356026 Modified: stable/9/lib/libc/rpc/getnetconfig.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/9/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:46:10 2016 (r301687) +++ stable/9/lib/libc/rpc/getnetconfig.c Wed Jun 8 18:47:00 2016 (r301688) @@ -697,7 +697,7 @@ dup_ncp(ncp) struct netconfig *ncp; { struct netconfig *p; - char *tmp; + char *tmp, *tmp2; u_int i; if ((tmp=malloc(MAXNETCONFIGLINE)) == NULL) @@ -706,6 +706,7 @@ struct netconfig *ncp; free(tmp); return(NULL); } + tmp2 = tmp; /* * First we dup all the data from matched netconfig buffer. Then we * adjust some of the member pointer to a pre-allocated buffer where @@ -727,7 +728,7 @@ struct netconfig *ncp; if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); - free(tmp); + free(tmp2); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From owner-svn-src-all@freebsd.org Wed Jun 8 18:51:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC25CB6F684; Wed, 8 Jun 2016 18:51:06 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6441EC0; Wed, 8 Jun 2016 18:51:05 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id AiZ6b7cGiN9d0AiZ7bMtkt; Wed, 08 Jun 2016 12:50:58 -0600 X-Authority-Analysis: v=2.2 cv=QZUkhYTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=2vG8vXjW7PKQqCZgPe0A:9 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 5CEF213751; Wed, 8 Jun 2016 11:50:56 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u58IotT0022829; Wed, 8 Jun 2016 11:50:55 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606081850.u58IotT0022829@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r301681 - stable/9/sys/rpc In-Reply-To: Message from Garrett Cooper of "Wed, 08 Jun 2016 18:23:33 -0000." <201606081823.u58INXvL053444@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 08 Jun 2016 11:50:55 -0700 X-CMAE-Envelope: MS4wfLkGcghhioN3ch2uo+lkjjcBeKz7bz4NIEfL2bLYdnUVguekJu+w4vx0jEzKuc1VFWGhKUASfrTvVG1srnpahRzRcxEHNuydy2Nufcxb3BJcno5X/D+S NDbB6X0SbXPO7C+AmSkxGW+69sucfBXvFN0RdTXpzsqaQwzL2xU4Y1GZ2F2JK6PiONbxjfKjZWhdip0UyigcgpQJarcwAOPWBubaE5LEF28USxLKRuwVpdYH DTCHJQKX7m5g/8uMf/PTEOrXNFboB53D8SY5lGIxi4+S4cAbnzpvGJ5unokR2wjM/zw+kLmHsv7BdNxuqMRJwQ08BDOEIzvY+IGfFHx3rUY= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 18:51:06 -0000 In message <201606081823.u58INXvL053444@repo.freebsd.org>, Garrett Cooper write s: > Author: ngie > Date: Wed Jun 8 18:23:33 2016 > New Revision: 301681 > URL: https://svnweb.freebsd.org/changeset/base/301681 > > Log: > MFstable/10 r301680: > > MFC r300625: Why MFC to stable/10 and then to stable/9. Doesn't that make stable/10 stable/9's ancestor? When stable/9 was first branched,HEAD was its ancestor. Doesn't this cause confusing ancestry in the branch? -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Wed Jun 8 19:03:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEFE0B6FA50; Wed, 8 Jun 2016 19:03:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B10B41860; Wed, 8 Jun 2016 19:03:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x22f.google.com with SMTP id a5so18374970ita.1; Wed, 08 Jun 2016 12:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=rY2gUYBLgGoqVQ8NtgrEkrTYkVW+hlB6sNlRTDqEmQ4=; b=cOdKKQhg4JdfF6OnnX67QjTCGMdsZFwnVzhFA3Zm/RBrK11TEk09MpI9pZhUP/LXwY lvLbHkAumEjbX6dgASmEBRqJ1a8eJwgcq/3P/lIWXR7ltx/sns5GY1y8PNsIv2aTrmXs riXZTvsY9ufzqg1sQL0qLsbe4Y0DgOKfmfTv/FmR7rfsXPOBXOcTfDQDSxqbZOHxwrZi 0i+5ByHgREM4+8Tq3GXCZfUwttkcZbx8/a0shCPyTbCsDhOs9rnC27DDu5Ngjwnxr/ep q0+H8UA4Jy/SIkEuzEAUSaqnOIrmcXAGY1lYnOQLP3afxo+C8+Z6Sn0OJ1rO65/NPvTW UDiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=rY2gUYBLgGoqVQ8NtgrEkrTYkVW+hlB6sNlRTDqEmQ4=; b=MWxwIc8e+xPP0UKbAKvEudYouysBApoMZvK30vY4GZZ0+68f6g0dmi65IACpNoQzw4 +qokyIyw+BtmIGCl7F9Dm4S2SxrFpMJTI3/0d2W5FlicSgNWb+IvonzazqoY+H/oiD58 adkfw09qMThCigenskZVidHq3hW+kyKkWL9Hm4pHgZby4RuFFA/esbLTfj7SnlMb7JhV P3RFr437HwSZfjTIkLTk8gPNa/+1K7UlH9a8XBHV36wZXHocVtQA7TmRxjItxL6sbaic LB/j+5oyb7pXjM5nLeEkqBtzZ/w0hqasp4BqSW2xj/hujUWWxKAIyCooZZ9hDZJqhYOm QQzQ== X-Gm-Message-State: ALyK8tKJZ+UpyzlNhHKFgxCsyWlwGfwS3mTURlLPC3pU2rT+Kp/uEbtxioJ4Qh2rznkOZQ== X-Received: by 10.36.69.216 with SMTP id c85mr15152521itd.75.1465412623970; Wed, 08 Jun 2016 12:03:43 -0700 (PDT) Received: from [10.65.210.108] ([137.122.64.8]) by smtp.gmail.com with ESMTPSA id o127sm1364159ith.7.2016.06.08.12.03.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2016 12:03:43 -0700 (PDT) Subject: Re: svn commit: r301681 - stable/9/sys/rpc Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E2FD5B9F-B5F2-4190-AF23-7486FD515491"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201606081850.u58IotT0022829@slippy.cwsent.com> Date: Wed, 8 Jun 2016 15:03:41 -0400 Cc: Garrett Cooper , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Message-Id: <0DFEB3AC-B864-47B5-8261-83E68989385A@gmail.com> References: <201606081850.u58IotT0022829@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 19:03:45 -0000 --Apple-Mail=_E2FD5B9F-B5F2-4190-AF23-7486FD515491 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 8, 2016, at 14:50, Cy Schubert = wrote: >=20 > In message <201606081823.u58INXvL053444@repo.freebsd.org>, Garrett = Cooper > write > s: >> Author: ngie >> Date: Wed Jun 8 18:23:33 2016 >> New Revision: 301681 >> URL: https://svnweb.freebsd.org/changeset/base/301681 >>=20 >> Log: >> MFstable/10 r301680: >>=20 >> MFC r300625: >=20 > Why MFC to stable/10 and then to stable/9. Doesn't that make stable/10 > stable/9's ancestor? When stable/9 was first branched,HEAD was its > ancestor. Doesn't this cause confusing ancestry in the branch? Good question! Yes; it makes ^/stable/10 ^/stable/9=E2=80=99s ancestor for changes from = ^/head, even though the ancestry was the other way around (^/stable/9 is = ^/stable/10=E2=80=99s ancestor, chronologically=E2=80=A6 but = content-wise ^/stable/9 is a subset really of everything in ^/stable/10 = and ^/head). There have been a few discussions about this on the = developer=E2=80=99s list, and the general consensus was a trickle down = method, i.e. =E2=80=9Cmerge from head to head-1; merge from head-1 to = head-2; etc=E2=80=9D. There=E2=80=99s some minor disagreement on content in the MFC messages, = but the way I have things right now is the preferred format AFAIK, i.e. = less people have nitpicked the messages, content-wise. After I fix the small formatting annoyance with my MFCs vs others, I was = thinking of putting out the scripts I use for CR; it would be nice for = everyone to be using the same tools. Thanks! -Ngie --Apple-Mail=_E2FD5B9F-B5F2-4190-AF23-7486FD515491 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXWGwNAAoJEPWDqSZpMIYVUk4P/RfKlkREJILEM5Q/njQbabPk eSDQw0I+8EYkfGPxbd1E15CXE44R2424gck0r4mdFm11Pm2puGIuC+4aipuggMV+ 3MN7nZgQAstIRZHUGII9TSTFyWpE8zvbkZuOkl75YlHTd0U0bj7gCuMyXrA7+ub0 NxSFm22OeqSayeysd2aut4UUCgD6gm7Pde36fZG/ZebVOLz+WEIVzklkOSpiE7X6 UfvH0qoW4WarnhNC6mTnc7fFH1RYvThRNxS5diqvVzUsCjFiOfvr6ifmHlT+p2b+ 7qxd5mQiSN8QbnEMmwIBYFaZgHFC8z5bQaMBO5R1KaKXkxO5oBfHAqI+77bfJNXy eDNIRR+Cwwebxzpg4NEexnnAfUOJC1A6UOxvHzr578+QVfWPlYd1l8o2m2u6641R nFC037FiHvUuf0frQk1r7c4ftNsoo+9qwv9u1ldTue+Yha5VAQI8/kpBZFVo5U7U 4d9k7kPnrI+3ly5lOHA8B3kxRvvxR1VYiQemKI3iyX3qZ7IkU9XtncR0hXZbxOin txjyHFsHHTqwE/2jZMLEOqzoBSyGdlqOXc2LC1NeCEHJiJMFrq3OyGxni4Lv41uh yX0IYFGR5AtNKCPhxqh2CxmQ34K8WQPgLmQgno044FKHRgknlZ38Z3FJH7hxlJt6 ZulGKhQqDq0x5bEy71Nh =RdbN -----END PGP SIGNATURE----- --Apple-Mail=_E2FD5B9F-B5F2-4190-AF23-7486FD515491-- From owner-svn-src-all@freebsd.org Wed Jun 8 19:24:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37538B705E8; Wed, 8 Jun 2016 19:24:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04F681B05; Wed, 8 Jun 2016 19:24:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58JOn7B076469; Wed, 8 Jun 2016 19:24:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58JOn0h076468; Wed, 8 Jun 2016 19:24:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606081924.u58JOn0h076468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Jun 2016 19:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301689 - head/contrib/one-true-awk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 19:24:50 -0000 Author: pfg Date: Wed Jun 8 19:24:48 2016 New Revision: 301689 URL: https://svnweb.freebsd.org/changeset/base/301689 Log: one-true-awk: Avoid a NULL dereference. CID: 270862 Obtained from: NetBSD (CVS Rev. 1.8) MFC after: 2 weeks Modified: head/contrib/one-true-awk/tran.c Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Wed Jun 8 18:47:00 2016 (r301688) +++ head/contrib/one-true-awk/tran.c Wed Jun 8 19:24:48 2016 (r301689) @@ -333,7 +333,7 @@ char *setsval(Cell *vp, const char *s) / donefld = 0; /* mark $1... invalid */ donerec = 1; } - t = tostring(s); /* in case it's self-assign */ + t = s ? tostring(s) : tostring(""); /* in case it's self-assign */ if (freeable(vp)) xfree(vp->sval); vp->tval &= ~NUM; From owner-svn-src-all@freebsd.org Wed Jun 8 19:31:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48FDAB70812; Wed, 8 Jun 2016 19:31:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1461F3B; Wed, 8 Jun 2016 19:31:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58JVCxS076809; Wed, 8 Jun 2016 19:31:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58JVCBG076808; Wed, 8 Jun 2016 19:31:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606081931.u58JVCBG076808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 19:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301690 - stable/9/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 19:31:13 -0000 Author: ngie Date: Wed Jun 8 19:31:12 2016 New Revision: 301690 URL: https://svnweb.freebsd.org/changeset/base/301690 Log: MFstable/10 r301655: MFC r299766: Fix logically dead code pointed out by clang/Coverity parse_context, parse_user_security: test for validity of results from parse_ascii(..) with by casting to int32_t and comparing to -1; comparing unsigned types to negative values will always be false. CID: 1011432, 1011433 Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 19:24:48 2016 (r301689) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Jun 8 19:31:12 2016 (r301690) @@ -614,8 +614,8 @@ parse_context(struct snmp_toolinfo *snmp warnx("Suboption 'context-engine' - no argument"); return (-1); } - if ((snmp_client.clen = parse_ascii(val, - snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) < 0) { + if ((int32_t)(snmp_client.clen = parse_ascii(val, + snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) == -1) { warnx("Bad EngineID - %s", val); return (-1); } @@ -653,7 +653,7 @@ parse_user_security(struct snmp_toolinfo } snmp_client.engine.engine_len = parse_ascii(val, snmp_client.engine.engine_id, SNMP_ENGINE_ID_SIZ); - if (snmp_client.engine.engine_len < 0) { + if ((int32_t)snmp_client.engine.engine_len == -1) { warnx("Bad EngineID - %s", val); return (-1); } From owner-svn-src-all@freebsd.org Wed Jun 8 19:39:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1235B70A03; Wed, 8 Jun 2016 19:39:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D47B13CA; Wed, 8 Jun 2016 19:39:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Jdi8o080328; Wed, 8 Jun 2016 19:39:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58JdidS080327; Wed, 8 Jun 2016 19:39:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606081939.u58JdidS080327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Jun 2016 19:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301691 - head/contrib/one-true-awk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 19:39:45 -0000 Author: pfg Date: Wed Jun 8 19:39:44 2016 New Revision: 301691 URL: https://svnweb.freebsd.org/changeset/base/301691 Log: Revert r301689 - one-true-awk: Avoid a NULL dereference. I got this wrong and the coverity report doesn't match the NetBSD change, which was thought for a different version. The change wouldn't hurt but let's wait until upstream figures this out. Modified: head/contrib/one-true-awk/tran.c Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Wed Jun 8 19:31:12 2016 (r301690) +++ head/contrib/one-true-awk/tran.c Wed Jun 8 19:39:44 2016 (r301691) @@ -333,7 +333,7 @@ char *setsval(Cell *vp, const char *s) / donefld = 0; /* mark $1... invalid */ donerec = 1; } - t = s ? tostring(s) : tostring(""); /* in case it's self-assign */ + t = tostring(s); /* in case it's self-assign */ if (freeable(vp)) xfree(vp->sval); vp->tval &= ~NUM; From owner-svn-src-all@freebsd.org Wed Jun 8 20:01:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 310C2B70D7E; Wed, 8 Jun 2016 20:01:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2B431E91; Wed, 8 Jun 2016 20:01:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58K1BF2087737; Wed, 8 Jun 2016 20:01:11 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58K1AlA087734; Wed, 8 Jun 2016 20:01:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606082001.u58K1AlA087734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 8 Jun 2016 20:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301692 - in head/sys/modules: bwn bwn_pci siba_bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 20:01:12 -0000 Author: avos Date: Wed Jun 8 20:01:10 2016 New Revision: 301692 URL: https://svnweb.freebsd.org/changeset/base/301692 Log: bwn, bwn_pci, siba_bwn: add missing opt_*.h dependencies. Modified: head/sys/modules/bwn/Makefile head/sys/modules/bwn_pci/Makefile head/sys/modules/siba_bwn/Makefile Modified: head/sys/modules/bwn/Makefile ============================================================================== --- head/sys/modules/bwn/Makefile Wed Jun 8 19:39:44 2016 (r301691) +++ head/sys/modules/bwn/Makefile Wed Jun 8 20:01:10 2016 (r301692) @@ -12,7 +12,7 @@ SRCS+= if_bwn_phy_g.c if_bwn_phy_lp.c SRCS+= if_bwn_phy_n.c # Other -SRCS+= device_if.h bus_if.h pci_if.h +SRCS+= device_if.h bus_if.h pci_if.h opt_bwn.h opt_wlan.h # Uncomment this for the GPL PHY code; this requires the # module be built with BWN_GPL_PHY set in the kernel Modified: head/sys/modules/bwn_pci/Makefile ============================================================================== --- head/sys/modules/bwn_pci/Makefile Wed Jun 8 19:39:44 2016 (r301691) +++ head/sys/modules/bwn_pci/Makefile Wed Jun 8 20:01:10 2016 (r301692) @@ -7,5 +7,6 @@ SRCS= if_bwn_pci.c bwn_mac.c SRCS+= bhnd_bus_if.h bhndb_bus_if.h \ bhndb_if.h bhnd_nvram_map.h SRCS+= device_if.h bus_if.h pci_if.h \ + opt_bwn.h opt_wlan.h opt_global.h .include Modified: head/sys/modules/siba_bwn/Makefile ============================================================================== --- head/sys/modules/siba_bwn/Makefile Wed Jun 8 19:39:44 2016 (r301691) +++ head/sys/modules/siba_bwn/Makefile Wed Jun 8 20:01:10 2016 (r301692) @@ -4,6 +4,6 @@ KMOD= siba_bwn SRCS= siba_core.c siba_bwn.c sibareg.h sibavar.h -SRCS+= device_if.h bus_if.h pci_if.h +SRCS+= device_if.h bus_if.h pci_if.h opt_siba.h .include From owner-svn-src-all@freebsd.org Wed Jun 8 20:22:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F019AB6F292; Wed, 8 Jun 2016 20:22:26 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1A961D10; Wed, 8 Jun 2016 20:22:26 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58KMP0X097506; Wed, 8 Jun 2016 20:22:25 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58KMPpF097505; Wed, 8 Jun 2016 20:22:25 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201606082022.u58KMPpF097505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 8 Jun 2016 20:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301693 - head/sys/dev/dwc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 20:22:27 -0000 Author: jmcneill Date: Wed Jun 8 20:22:25 2016 New Revision: 301693 URL: https://svnweb.freebsd.org/changeset/base/301693 Log: Multicast filters on DWC_GMAC_ALT_DESC type implementations use a different hash register setup. In addition, strip trailing FCS in receive path. Reviewed by: loos Differential Revision: https://reviews.freebsd.org/D6653 Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Wed Jun 8 20:01:10 2016 (r301692) +++ head/sys/dev/dwc/if_dwc.c Wed Jun 8 20:22:25 2016 (r301693) @@ -587,19 +587,26 @@ dwc_setup_rxfilter(struct dwc_softc *sc) struct ifmultiaddr *ifma; struct ifnet *ifp; uint8_t *eaddr, val; - uint32_t crc, ffval, hashbit, hashreg, hi, lo, reg; + uint32_t crc, ffval, hashbit, hashreg, hi, lo, hash[8], hmask; + int nhash, i; DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; + nhash = sc->mactype == DWC_GMAC_ALT_DESC ? 2 : 8; + hmask = ((nhash << 5) - 1) | 0xf; /* * Set the multicast (group) filter hash. */ - if ((ifp->if_flags & IFF_ALLMULTI)) + if ((ifp->if_flags & IFF_ALLMULTI) != 0) { ffval = (FRAME_FILTER_PM); - else { + for (i = 0; i < nhash; i++) + hash[i] = ~0; + } else { ffval = (FRAME_FILTER_HMC); + for (i = 0; i < nhash; i++) + hash[i] = 0; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -608,13 +615,13 @@ dwc_setup_rxfilter(struct dwc_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); /* Take lower 8 bits and reverse it */ - val = bitreverse(~crc & 0xff); - hashreg = (val >> 5); + val = bitreverse(~crc & 0xff) & hmask; + if (sc->mactype == DWC_GMAC_ALT_DESC) + hashreg = (val >> 5) == 0; + else + hashreg = (val >> 5); hashbit = (val & 31); - - reg = READ4(sc, HASH_TABLE_REG(hashreg)); - reg |= (1 << hashbit); - WRITE4(sc, HASH_TABLE_REG(hashreg), reg); + hash[hashreg] |= (1 << hashbit); } if_maddr_runlock(ifp); } @@ -635,6 +642,8 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_LOW(0), lo); WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); + for (i = 0; i < nhash; i++) + WRITE4(sc, HASH_TABLE_REG(i), hash[i]); } static int @@ -759,6 +768,9 @@ dwc_rxfinish_locked(struct dwc_softc *sc m->m_len = len; if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + /* Remove trailing FCS */ + m_adj(m, -ETHER_CRC_LEN); + DWC_UNLOCK(sc); (*ifp->if_input)(ifp, m); DWC_LOCK(sc); From owner-svn-src-all@freebsd.org Wed Jun 8 20:42:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2626EB6F917; Wed, 8 Jun 2016 20:42:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F21011C69; Wed, 8 Jun 2016 20:42:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58KgaB9005712; Wed, 8 Jun 2016 20:42:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58KgavE005711; Wed, 8 Jun 2016 20:42:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606082042.u58KgavE005711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 8 Jun 2016 20:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301694 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 20:42:37 -0000 Author: avos Date: Wed Jun 8 20:42:35 2016 New Revision: 301694 URL: https://svnweb.freebsd.org/changeset/base/301694 Log: bsdinstall: add country/regulatory domain configuration dialog. Allow to setup country and/or regulatory domain before scanning (since channel list is affected by regulatory restrictions this may impact scan results). PR: 182600 (originally) Differential Revision: https://reviews.freebsd.org/D6325 Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Wed Jun 8 20:22:25 2016 (r301693) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Wed Jun 8 20:42:35 2016 (r301694) @@ -31,6 +31,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr ############################################################ MAIN @@ -58,40 +59,190 @@ if [ $? -ne 0 -a -z $BSDINSTALL_CONFIGCU exit 1 fi -output=$( wpa_cli scan 2>&1 ) -f_dprintf "%s" "$output" -dialog --backtitle "FreeBSD Installer" --title "Scanning" --ok-label "Skip" \ - --pause "Waiting 5 seconds to scan for wireless networks..." \ - 9 40 5 || exit 1 - -SCAN_RESULTS=`wpa_cli scan_results` -NETWORKS=`echo "$SCAN_RESULTS" | awk -F '\t' \ - '/..:..:..:..:..:../ {if (length($5) > 0) printf("\"%s\"\t%s\n", $5, $4);}' | - sort | uniq` - -if [ -z "$NETWORKS" ]; then - dialog --backtitle "FreeBSD Installer" --title "Error" \ - --yesno "No wireless networks were found. Rescan?" 0 0 && \ - exec $0 $@ - exit 1 +country_set() +{ + local error_str= + local iface_up= + local ifconfig_args= + + # Setup what was selected + # NB: do not change order of arguments (or regdomain will be ignored) + if [ ! -z "$2" ]; then + ifconfig_args="${ifconfig_args}country $2" + fi + if [ ! -z "$1" ]; then + if [ ! -z "$2" ]; then + ifconfig_args="${ifconfig_args} " + fi + ifconfig_args="${ifconfig_args}regdomain $1" + fi + if [ -z "$ifconfig_args" ]; then + # Nothing to do (everything was skipped) + return $SUCCESS + fi + + # Regdomain/country cannot be applied while interface is running + iface_up=`ifconfig -lu | grep -w $WLAN_IFACE` + if [ ! -z "$iface_up" ]; then + ifconfig $WLAN_IFACE down + fi + error_str=`ifconfig $WLAN_IFACE $ifconfig_args 2>&1 | \ + sed 's/ifconfig: //'` + if [ ! -z "$iface_up" ]; then + # Restart wpa_supplicant(8) (should not fail). + wpa_supplicant -B -i $WLAN_IFACE -c \ + $BSDINSTALL_TMPETC/wpa_supplicant.conf + fi + if [ ! -z "$error_str" ]; then + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --yes-label Change --no-label Ignore --yesno \ + "Error while applying chosen settings ($error_str)" 0 0 + if [ $? -eq $DIALOG_OK ]; then + return $FAILURE # Restart + else + return $SUCCESS # Skip + fi + else + : > $BSDINSTALL_TMPETC/rc.conf.net.wlan + echo create_args_$WLAN_IFACE=\"$ifconfig_args\" >> \ + $BSDINSTALL_TMPETC/rc.conf.net.wlan + fi + + return $SUCCESS +} + +dialog_country_select() +{ + local input= + local def_item_regdomain= + local def_item_country= + local regdomains= + local countries= + local regdomain= + local country= + + # Parse available countries/regdomains + input=`ifconfig $WLAN_IFACE list countries | sed 's/DEBUG//gi'` + regdomains=`echo $input | sed 's/.*domains://' | tr ' ' '\n' | \ + sort | tr '\n' ' '` + countries=`echo $input | sed 's/Country codes://' | \ + sed 's/Regulatory.*//' | awk '{ + for (i = 1; i <= NF; i++) { + printf "%s", $i + if (match($i, "[[:lower:]]")) + if (match($(i+1), "[[:lower:]]")) + printf "\\\\\\ " + else + printf "\n" + else + printf " " + } + }' | sort -k 2 | tr '\n' ' '` + + # Change default cursor position (if required). + if [ "$1" != "" ]; then + def_item_regdomain="--default-item $1" + fi + if [ "$2" != "" ]; then + def_item_country="--default-item $2" + fi + + f_dialog_menu_size height width rows \"Regdomain selection\" \ + \"FreeBSD Installer\" \"Select your regdomain.\" \ + \"\" $regdomains + regdomain=`sh -c "dialog \ + --backtitle \"FreeBSD Installer\" \ + --title \"Regdomain selection\" \ + --cancel-label \"Skip\" \ + $def_item_regdomain \ + --no-items \ + --stdout \ + --menu \"Select your regdomain.\" \ + $height $width $rows $regdomains"` + + f_dialog_menu_size height width rows \"Country selection\" \ + \"FreeBSD Installer\" \"Select your country.\" \ + \"\" $countries + country=`sh -c "dialog \ + --backtitle \"FreeBSD Installer\" \ + --title \"Country selection\" \ + --cancel-label \"Skip\" \ + $def_item_country \ + --stdout \ + --menu \"Select your country.\" \ + $height $width $rows $countries"` + + country_set "$regdomain" "$country" + + return $? +} + +# There is no way to check country/regdomain without (possible) +# interface state modification +if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then + # Get current country/regdomain for selected interface + WLAN_IFACE=`wpa_cli ifname | tail -n 1` + INPUT=`ifconfig $WLAN_IFACE list regdomain | head -n 1` + DEF_REGDOMAIN=`echo $INPUT | cut -w -f 2` + if [ "$DEF_REGDOMAIN" = "0" ]; then + DEF_REGDOMAIN="" + fi + DEF_COUNTRY=`echo $INPUT | cut -w -f 4` + if [ "$DEF_COUNTRY" = "0" ]; then + DEF_COUNTRY="" + fi + dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \ + --yesno "Change regdomain/country (now \ + $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0 + if [ $? -eq 0 ]; then + while : + do + dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY" + if [ $? -eq $SUCCESS ]; then + break + fi + done + fi fi -exec 3>&1 -NETWORK=`sh -c "dialog --extra-button --extra-label \"Rescan\" \ - --backtitle \"FreeBSD Installer\" --title \"Network Selection\" --menu \ - \"Select a wireless network to connect to.\" 0 0 0 \ - $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3` -case $? in -0) # OK - ;; -1) # Cancel - exit 1 - ;; -3) # Rescan - exec $0 $@ - ;; -esac -exec 3>&- +while : +do + output=$( wpa_cli scan 2>&1 ) + f_dprintf "%s" "$output" + dialog --backtitle "FreeBSD Installer" --title "Scanning" \ + --ok-label "Skip" \ + --pause "Waiting 5 seconds to scan for wireless networks..." \ + 9 40 5 || exit 1 + + SCAN_RESULTS=`wpa_cli scan_results` + NETWORKS=`echo "$SCAN_RESULTS" | awk -F '\t' \ + '/..:..:..:..:..:../ {if (length($5) > 0) \ + printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq` + + if [ -z "$NETWORKS" ]; then + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --yesno "No wireless networks were found. Rescan?" 0 0 && \ + continue + exit 1 + fi + + exec 3>&1 + NETWORK=`sh -c "dialog --extra-button --extra-label \"Rescan\" \ + --backtitle \"FreeBSD Installer\" --title \"Network Selection\" \ + --menu \"Select a wireless network to connect to.\" 0 0 0 \ + $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3` + case $? in + 0) # OK + break + ;; + 1) # Cancel + exit 1 + ;; + 3) # Rescan + ;; + esac + exec 3>&- +done ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"` From owner-svn-src-all@freebsd.org Wed Jun 8 20:47:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A68F4B6F9DB; Wed, 8 Jun 2016 20:47:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E4FE1F70; Wed, 8 Jun 2016 20:47:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58KlPgc005962; Wed, 8 Jun 2016 20:47:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58KlP3s005960; Wed, 8 Jun 2016 20:47:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606082047.u58KlP3s005960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 20:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301695 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 20:47:26 -0000 Author: ngie Date: Wed Jun 8 20:47:25 2016 New Revision: 301695 URL: https://svnweb.freebsd.org/changeset/base/301695 Log: MFC r300870,r300884: r300870: Unbreak the zfs(4) build vm/vm_pageout.h grew a dependency on the bool typedef in r300865 arc.c didn't include sys/types.h, which included the definition for the typedef Other items (ofed, drm2) might need to be chased for this commit. Pointyhat to: alc r300884: Fix up r300870 The sys/types.h fix I proposed was only tested with zfs(4), not with libzpool, which is where the build failure actually existed Remove vm/vm_pageout.h from arc.c and zfs_vnops.c because they're both unneeded In collaboration with: kib Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 8 20:42:35 2016 (r301694) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 8 20:47:25 2016 (r301695) @@ -139,7 +139,6 @@ #include #include -#include #include #ifdef illumos Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 8 20:42:35 2016 (r301694) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 8 20:47:25 2016 (r301695) @@ -75,7 +75,6 @@ #include #include #include -#include /* * Programming rules. From owner-svn-src-all@freebsd.org Wed Jun 8 20:54:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA630B6FB5A; Wed, 8 Jun 2016 20:54:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 783FB139B; Wed, 8 Jun 2016 20:54:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Ksu6r009440; Wed, 8 Jun 2016 20:54:56 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58KsuA8009439; Wed, 8 Jun 2016 20:54:56 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201606082054.u58KsuA8009439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 8 Jun 2016 20:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301696 - head/contrib/atf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 20:54:57 -0000 Author: ed Date: Wed Jun 8 20:54:56 2016 New Revision: 301696 URL: https://svnweb.freebsd.org/changeset/base/301696 Log: Don't let ATF call basename() and dirname() in a non-standard way. POSIX basename() and dirname() are allowed to overwrite the input buffer. The advantage of implementing it that way is that the functions can be thread-safe, as they don't store the result in a global buffer. It looks like ATF wants to call basename() and dirname() in the non-standard way where the argument is of type "const char *". This change disables the calls to basename() and dirname(), which only seems to affect the formatting of some rare debug/error messages. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D6627 Modified: head/contrib/atf/config.h Modified: head/contrib/atf/config.h ============================================================================== --- head/contrib/atf/config.h Wed Jun 8 20:47:25 2016 (r301695) +++ head/contrib/atf/config.h Wed Jun 8 20:54:56 2016 (r301696) @@ -2,10 +2,10 @@ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if basename takes a constant pointer */ -#define HAVE_CONST_BASENAME 1 +/* #undef HAVE_CONST_BASENAME */ /* Define to 1 if dirname takes a constant pointer */ -#define HAVE_CONST_DIRNAME 1 +/* #undef HAVE_CONST_DIRNAME */ /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 From owner-svn-src-all@freebsd.org Wed Jun 8 21:31:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4300EB70364; Wed, 8 Jun 2016 21:31:35 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00C28189C; Wed, 8 Jun 2016 21:31:34 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58LVYvY022444; Wed, 8 Jun 2016 21:31:34 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58LVXLo022436; Wed, 8 Jun 2016 21:31:33 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606082131.u58LVXLo022436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 8 Jun 2016 21:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301697 - in head/sys: dev/bhnd dev/bhnd/cores/chipc dev/bhnd/cores/pci dev/bhnd/cores/pcie2 dev/bhnd/siba mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 21:31:35 -0000 Author: landonf Date: Wed Jun 8 21:31:33 2016 New Revision: 301697 URL: https://svnweb.freebsd.org/changeset/base/301697 Log: bhnd(4): Add a vendor parameter to BHND_DEVICE(), replacing vendor-specific BHND_*_DEVICE macros. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6736 Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/pci/bhnd_pci.c head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/mips/broadcom/bcm_mipscore.c Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/dev/bhnd/bhnd.h Wed Jun 8 21:31:33 2016 (r301697) @@ -232,16 +232,8 @@ struct bhnd_device { BHND_COREID_ ## _device) }, _desc, _quirks, \ _flags } -#define BHND_MIPS_DEVICE(_device, _desc, _quirks, ...) \ - _BHND_DEVICE(MIPS, _device, _desc, _quirks, \ - ## __VA_ARGS__, 0) - -#define BHND_ARM_DEVICE(_device, _desc, _quirks, ...) \ - _BHND_DEVICE(ARM, _device, _desc, _quirks, \ - ## __VA_ARGS__, 0) - -#define BHND_DEVICE(_device, _desc, _quirks, ...) \ - _BHND_DEVICE(BCM, _device, _desc, _quirks, \ +#define BHND_DEVICE(_vendor, _device, _desc, _quirks, ...) \ + _BHND_DEVICE(_vendor, _device, _desc, _quirks, \ ## __VA_ARGS__, 0) #define BHND_DEVICE_END { { BHND_MATCH_ANY }, NULL, NULL, 0 } Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Wed Jun 8 21:31:33 2016 (r301697) @@ -84,7 +84,7 @@ static struct bhnd_device_quirk chipc_qu /* Supported device identifiers */ static const struct bhnd_device chipc_devices[] = { - BHND_DEVICE(CC, NULL, chipc_quirks), + BHND_DEVICE(BCM, CC, NULL, chipc_quirks), BHND_DEVICE_END }; Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci.c Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci.c Wed Jun 8 21:31:33 2016 (r301697) @@ -68,8 +68,8 @@ static struct bhnd_device_quirk bhnd_pci #define BHND_PCI_QUIRKS bhnd_pci_quirks #define BHND_PCIE_QUIRKS bhnd_pcie_quirks -#define BHND_PCI_DEV(_core, _desc, ...) \ - { BHND_DEVICE(_core, _desc, BHND_ ## _core ## _QUIRKS, \ +#define BHND_PCI_DEV(_core, _desc, ...) \ + { BHND_DEVICE(BCM, _core, _desc, BHND_ ## _core ## _QUIRKS, \ ## __VA_ARGS__), BHND_PCI_REGFMT_ ## _core } static const struct bhnd_pci_device { Modified: head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c Wed Jun 8 21:31:33 2016 (r301697) @@ -87,7 +87,7 @@ static int bhnd_pci_wars_hwdown(struct b */ #define BHND_PCI_DEV(_core, _quirks) \ - BHND_DEVICE(_core, NULL, _quirks, BHND_DF_HOSTB) + BHND_DEVICE(BCM, _core, NULL, _quirks, BHND_DF_HOSTB) static const struct bhnd_device bhnd_pci_devs[] = { BHND_PCI_DEV(PCI, bhnd_pci_quirks), Modified: head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c ============================================================================== --- head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c Wed Jun 8 21:31:33 2016 (r301697) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); static struct bhnd_device_quirk bhnd_pcie2_quirks[]; #define BHND_PCIE_DEV(_core, _desc, ...) \ - BHND_DEVICE(_core, _desc, bhnd_pcie2_quirks, ## __VA_ARGS__) + BHND_DEVICE(BCM, _core, _desc, bhnd_pcie2_quirks, ## __VA_ARGS__) static const struct bhnd_device bhnd_pcie2_devs[] = { BHND_PCIE_DEV(PCIE2, "PCIe-G2 Host-PCI bridge", BHND_DF_HOSTB), Modified: head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c ============================================================================== --- head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c Wed Jun 8 21:31:33 2016 (r301697) @@ -83,7 +83,7 @@ static int bhnd_pcie2_wars_hwdown(struct */ #define BHND_PCI_DEV(_core, _quirks) \ - BHND_DEVICE(_core, NULL, _quirks, BHND_DF_HOSTB) + BHND_DEVICE(BCM, _core, NULL, _quirks, BHND_DF_HOSTB) static const struct bhnd_device bhnd_pcie2_devs[] = { BHND_PCI_DEV(PCIE2, bhnd_pcie2_quirks), Modified: head/sys/dev/bhnd/siba/siba_bhndb.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_bhndb.c Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/dev/bhnd/siba/siba_bhndb.c Wed Jun 8 21:31:33 2016 (r301697) @@ -74,7 +74,7 @@ static struct bhnd_device_quirk bridge_q }; static struct bhnd_device bridge_devs[] = { - BHND_DEVICE(PCI, NULL, bridge_quirks), + BHND_DEVICE(BCM, PCI, NULL, bridge_quirks), }; static int Modified: head/sys/mips/broadcom/bcm_mipscore.c ============================================================================== --- head/sys/mips/broadcom/bcm_mipscore.c Wed Jun 8 20:54:56 2016 (r301696) +++ head/sys/mips/broadcom/bcm_mipscore.c Wed Jun 8 21:31:33 2016 (r301697) @@ -54,9 +54,9 @@ static const struct resource_spec mipsco }; struct bhnd_device mipscore_match[] = { - BHND_MIPS_DEVICE(MIPS, "BHND MIPS processor", NULL), - BHND_MIPS_DEVICE(MIPS33, "BHND MIPS3302 processor", NULL), - BHND_MIPS_DEVICE(MIPS74K, "BHND MIPS74K processor", NULL), + BHND_DEVICE(BCM, MIPS, NULL, NULL), + BHND_DEVICE(BCM, MIPS33, NULL, NULL), + BHND_DEVICE(MIPS, MIPS74K, NULL, NULL), BHND_DEVICE_END }; From owner-svn-src-all@freebsd.org Wed Jun 8 21:38:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E46E4B704E1; Wed, 8 Jun 2016 21:38:52 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6D6E1CD3; Wed, 8 Jun 2016 21:38:52 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Lcpf4024707; Wed, 8 Jun 2016 21:38:51 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Lcpsk024703; Wed, 8 Jun 2016 21:38:51 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606082138.u58Lcpsk024703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 8 Jun 2016 21:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301698 - in head/sys: dev/bhnd dev/bhnd/bcma dev/bhnd/siba mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 21:38:53 -0000 Author: landonf Date: Wed Jun 8 21:38:51 2016 New Revision: 301698 URL: https://svnweb.freebsd.org/changeset/base/301698 Log: bhnd(4): Fix mips/broadcom core matching and bus pass order. Changes: - Fixed incorrect MIPS74k vendor ID in the bhnd core descriptor tables - Fixed MIPS core driver's matching against MIPS/MIPS33 cores. - Improved MIPS3302 core description. - Enabled BUS_PASS_BUS on the bhnd nexus drivers to allow early probing of the MIPS core. - Enabled BUS_PASS_CPU on the MIPS core driver to ensure correct attach order. - Disabled matching of the MIPS core driver on non-SoC devices. Reviewed by: Michael Zhilin Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6735 Modified: head/sys/dev/bhnd/bcma/bcma_nexus.c head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/siba/siba_nexus.c head/sys/mips/broadcom/bcm_mipscore.c Modified: head/sys/dev/bhnd/bcma/bcma_nexus.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_nexus.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/dev/bhnd/bcma/bcma_nexus.c Wed Jun 8 21:38:51 2016 (r301698) @@ -135,4 +135,5 @@ static device_method_t bcma_nexus_method DEFINE_CLASS_2(bhnd, bcma_nexus_driver, bcma_nexus_methods, sizeof(struct bcma_nexus_softc), bhnd_nexus_driver, bcma_driver); -DRIVER_MODULE(bcma_nexus, nexus, bcma_nexus_driver, bhnd_devclass, 0, 0); +EARLY_DRIVER_MODULE(bcma_nexus, nexus, bcma_nexus_driver, bhnd_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/dev/bhnd/bhnd_subr.c Wed Jun 8 21:38:51 2016 (r301698) @@ -86,7 +86,7 @@ static const struct bhnd_core_desc { BHND_CDESC(BCM, APHY, WLAN_PHY, "802.11a PHY"), BHND_CDESC(BCM, BPHY, WLAN_PHY, "802.11b PHY"), BHND_CDESC(BCM, GPHY, WLAN_PHY, "802.11g PHY"), - BHND_CDESC(BCM, MIPS33, CPU, "MIPS 3302 Core"), + BHND_CDESC(BCM, MIPS33, CPU, "MIPS3302 Core"), BHND_CDESC(BCM, USB11H, OTHER, "USB 1.1 Host Controller"), BHND_CDESC(BCM, USB11D, OTHER, "USB 1.1 Device Core"), BHND_CDESC(BCM, USB20H, OTHER, "USB 2.0 Host Controller"), @@ -108,7 +108,7 @@ static const struct bhnd_core_desc { BHND_CDESC(BCM, SDIOD, OTHER, "SDIO Device Core"), BHND_CDESC(BCM, ARMCM3, CPU, "ARM Cortex-M3 CPU"), BHND_CDESC(BCM, HTPHY, WLAN_PHY, "802.11n 4x4 PHY"), - BHND_CDESC(BCM, MIPS74K, CPU, "MIPS74k CPU"), + BHND_CDESC(MIPS,MIPS74K, CPU, "MIPS74k CPU"), BHND_CDESC(BCM, GMAC, ENET_MAC, "Gigabit MAC core"), BHND_CDESC(BCM, DMEMC, MEMC, "DDR1/DDR2 Memory Controller"), BHND_CDESC(BCM, PCIERC, OTHER, "PCIe Root Complex"), Modified: head/sys/dev/bhnd/siba/siba_nexus.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_nexus.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/dev/bhnd/siba/siba_nexus.c Wed Jun 8 21:38:51 2016 (r301698) @@ -115,4 +115,5 @@ static device_method_t siba_nexus_method DEFINE_CLASS_2(bhnd, siba_nexus_driver, siba_nexus_methods, sizeof(struct siba_nexus_softc), bhnd_nexus_driver, siba_driver); -DRIVER_MODULE(siba_nexus, nexus, siba_nexus_driver, bhnd_devclass, 0, 0); +EARLY_DRIVER_MODULE(siba_nexus, nexus, siba_nexus_driver, bhnd_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/mips/broadcom/bcm_mipscore.c ============================================================================== --- head/sys/mips/broadcom/bcm_mipscore.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/mips/broadcom/bcm_mipscore.c Wed Jun 8 21:38:51 2016 (r301698) @@ -53,10 +53,13 @@ static const struct resource_spec mipsco { -1, -1, 0 } }; +#define MIPSCORE_DEV(_vendor, _core) \ + BHND_DEVICE(_vendor, _core, NULL, NULL, BHND_DF_SOC) + struct bhnd_device mipscore_match[] = { - BHND_DEVICE(BCM, MIPS, NULL, NULL), - BHND_DEVICE(BCM, MIPS33, NULL, NULL), - BHND_DEVICE(MIPS, MIPS74K, NULL, NULL), + MIPSCORE_DEV(BCM, MIPS), + MIPSCORE_DEV(BCM, MIPS33), + MIPSCORE_DEV(MIPS, MIPS74K), BHND_DEVICE_END }; @@ -116,8 +119,8 @@ static device_method_t mipscore_methods[ devclass_t bhnd_mipscore_devclass; -DEFINE_CLASS_0(bhnd_mipscore, mipscore_driver, mipscore_methods, - sizeof(struct mipscore_softc)); -DRIVER_MODULE(bhnd_mipscore, bhnd, mipscore_driver, bhnd_mipscore_devclass, - 0, 0); -MODULE_VERSION(bhnd_mipscore, 1); +DEFINE_CLASS_0(bhnd_mips, mipscore_driver, mipscore_methods, + sizeof(struct mipscore_softc)); +EARLY_DRIVER_MODULE(bhnd_mips, bhnd, mipscore_driver, + bhnd_mipscore_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_EARLY); +MODULE_VERSION(bhnd_mips, 1); From owner-svn-src-all@freebsd.org Wed Jun 8 22:28:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97085B6F01B; Wed, 8 Jun 2016 22:28:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49D591770; Wed, 8 Jun 2016 22:28:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58MSvui042832; Wed, 8 Jun 2016 22:28:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58MSv35042830; Wed, 8 Jun 2016 22:28:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606082228.u58MSv35042830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 22:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301699 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 22:28:58 -0000 Author: ngie Date: Wed Jun 8 22:28:57 2016 New Revision: 301699 URL: https://svnweb.freebsd.org/changeset/base/301699 Log: MFstable/10 r301695: MFC r300870,r300884: r300870: Unbreak the zfs(4) build vm/vm_pageout.h grew a dependency on the bool typedef in r300865 arc.c didn't include sys/types.h, which included the definition for the typedef Other items (ofed, drm2) might need to be chased for this commit. Pointyhat to: alc r300884: Fix up r300870 The sys/types.h fix I proposed was only tested with zfs(4), not with libzpool, which is where the build failure actually existed Remove vm/vm_pageout.h from arc.c and zfs_vnops.c because they're both unneeded In collaboration with: kib Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 8 21:38:51 2016 (r301698) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Jun 8 22:28:57 2016 (r301699) @@ -137,7 +137,6 @@ #include #include -#include #ifdef illumos #ifndef _KERNEL Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 8 21:38:51 2016 (r301698) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jun 8 22:28:57 2016 (r301699) @@ -72,7 +72,6 @@ #include #include #include -#include /* * Programming rules. From owner-svn-src-all@freebsd.org Wed Jun 8 22:29:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ACA5B6F07A; Wed, 8 Jun 2016 22:29:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC353195B; Wed, 8 Jun 2016 22:29:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58MTVEU042898; Wed, 8 Jun 2016 22:29:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58MTUZc042896; Wed, 8 Jun 2016 22:29:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606082229.u58MTUZc042896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 8 Jun 2016 22:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301700 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 22:29:32 -0000 Author: andrew Date: Wed Jun 8 22:29:30 2016 New Revision: 301700 URL: https://svnweb.freebsd.org/changeset/base/301700 Log: Remove the ARMv4/ARMv5 userland atomic support from struct proc on armv6. Nothing should use this on armv6 as we use the atomic instructions added in ARMv6k. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/genassym.c head/sys/arm/include/proc.h Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Wed Jun 8 22:28:57 2016 (r301699) +++ head/sys/arm/arm/genassym.c Wed Jun 8 22:29:30 2016 (r301700) @@ -101,8 +101,10 @@ ASSYM(TD_PROC, offsetof(struct thread, t ASSYM(TD_MD, offsetof(struct thread, td_md)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(MD_TP, offsetof(struct mdthread, md_tp)); +#if __ARM_ARCH < 6 ASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start)); ASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end)); +#endif ASSYM(TF_SPSR, offsetof(struct trapframe, tf_spsr)); ASSYM(TF_R0, offsetof(struct trapframe, tf_r0)); Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Wed Jun 8 22:28:57 2016 (r301699) +++ head/sys/arm/include/proc.h Wed Jun 8 22:29:30 2016 (r301700) @@ -54,8 +54,10 @@ struct mdthread { int md_ptrace_instr_alt; int md_ptrace_addr_alt; register_t md_tp; +#if __ARM_ARCH < 6 void *md_ras_start; void *md_ras_end; +#endif }; struct mdproc { From owner-svn-src-all@freebsd.org Wed Jun 8 22:30:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF281B6F10C; Wed, 8 Jun 2016 22:30:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3A331ACD; Wed, 8 Jun 2016 22:30:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58MULAq042995; Wed, 8 Jun 2016 22:30:21 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58MUL25042990; Wed, 8 Jun 2016 22:30:21 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606082230.u58MUL25042990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 8 Jun 2016 22:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301701 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 22:30:23 -0000 Author: oshogbo Date: Wed Jun 8 22:30:21 2016 New Revision: 301701 URL: https://svnweb.freebsd.org/changeset/base/301701 Log: Fix spelling of the casper introduced in the r296047. PR: 210031 Reported by: AllanJude, jmallett Modified: head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/config.h.in head/contrib/tcpdump/configure head/contrib/tcpdump/tcpdump.c head/usr.sbin/tcpdump/tcpdump/config.h Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Wed Jun 8 22:29:30 2016 (r301700) +++ head/contrib/tcpdump/addrtoname.c Wed Jun 8 22:30:21 2016 (r301701) @@ -29,10 +29,10 @@ #include "config.h" #endif -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER #include #include -#endif /* HAVE_CAPSPER */ +#endif /* HAVE_CASPER */ #include #ifdef USE_ETHER_NTOHOST @@ -204,7 +204,7 @@ intoa(uint32_t addr) static uint32_t f_netmask; static uint32_t f_localnet; -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER extern cap_channel_t *capdns; #endif @@ -252,7 +252,7 @@ getname(netdissect_options *ndo, const u */ if (!ndo->ndo_nflag && (addr & f_netmask) == f_localnet) { -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, 4, AF_INET); @@ -309,7 +309,7 @@ getname6(netdissect_options *ndo, const * Do not print names if -n was given. */ if (!ndo->ndo_nflag) { -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, sizeof(addr), AF_INET6); Modified: head/contrib/tcpdump/config.h.in ============================================================================== --- head/contrib/tcpdump/config.h.in Wed Jun 8 22:29:30 2016 (r301700) +++ head/contrib/tcpdump/config.h.in Wed Jun 8 22:30:21 2016 (r301701) @@ -10,7 +10,7 @@ #undef HAVE_BPF_DUMP /* capsicum support available */ -#undef HAVE_CAPSPER +#undef HAVE_CASPER /* Define to 1 if you have the `cap_enter' function. */ #undef HAVE_CAP_ENTER Modified: head/contrib/tcpdump/configure ============================================================================== --- head/contrib/tcpdump/configure Wed Jun 8 22:29:30 2016 (r301700) +++ head/contrib/tcpdump/configure Wed Jun 8 22:30:21 2016 (r301701) @@ -4566,7 +4566,7 @@ fi $as_echo_n "checking whether to sandbox using capsicum... " >&6; } if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then -$as_echo "#define HAVE_CAPSPER 1" >>confdefs.h +$as_echo "#define HAVE_CASPER 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Wed Jun 8 22:29:30 2016 (r301700) +++ head/contrib/tcpdump/tcpdump.c Wed Jun 8 22:30:21 2016 (r301701) @@ -87,7 +87,7 @@ extern int SIZE_BUF; #include #include #endif /* __FreeBSD__ */ -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER #include #include #include @@ -96,7 +96,7 @@ extern int SIZE_BUF; #include #include #include -#endif /* HAVE_CAPSPER */ +#endif /* HAVE_CASPER */ #include #include #include @@ -160,7 +160,7 @@ static int infoprint; char *program_name; -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER cap_channel_t *capdns; #endif @@ -484,7 +484,7 @@ struct dump_info { char *CurrentFileName; pcap_t *pd; pcap_dumper_t *p; -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER int dirfd; #endif }; @@ -908,7 +908,7 @@ get_next_file(FILE *VFile, char *ptr) return ret; } -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER static cap_channel_t * capdns_setup(void) { @@ -935,7 +935,7 @@ capdns_setup(void) return (capdnsloc); } -#endif /* HAVE_CAPSPER */ +#endif /* HAVE_CASPER */ #ifdef HAVE_PCAP_SET_TSTAMP_PRECISION static int @@ -967,7 +967,7 @@ tstamp_precision_to_string(int precision } #endif -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER /* * Ensure that, on a dump file's descriptor, we have all the rights * necessary to make the standard I/O library work with an fdopen()ed @@ -1067,9 +1067,9 @@ main(int argc, char **argv) #endif int status; FILE *VFile; -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER cap_rights_t rights; -#endif /* HAVE_CAPSPER */ +#endif /* HAVE_CASPER */ int cansandbox; #ifdef WIN32 @@ -1610,7 +1610,7 @@ main(int argc, char **argv) if (pd == NULL) error("%s", ebuf); -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER cap_rights_init(&rights, CAP_READ); if (cap_rights_limit(fileno(pcap_file(pd)), &rights) < 0 && errno != ENOSYS) { @@ -1847,10 +1847,10 @@ main(int argc, char **argv) exit(0); } -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER if (!nflag) capdns = capdns_setup(); -#endif /* HAVE_CAPSPER */ +#endif /* HAVE_CASPER */ init_addrtoname(gndo, localnet, netmask); init_checksum(); @@ -1918,7 +1918,7 @@ main(int argc, char **argv) if (pcap_setfilter(pd, &fcode) < 0) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER if (RFileName == NULL && VFileName == NULL) { static const unsigned long cmds[] = { BIOCGSTATS }; @@ -1968,11 +1968,11 @@ main(int argc, char **argv) #endif /* HAVE_LIBCAP_NG */ if (p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER set_dumper_capsicum_rights(p); #endif if (Cflag != 0 || Gflag != 0) { -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER dumpinfo.WFileName = strdup(basename(WFileName)); dumpinfo.dirfd = open(dirname(WFileName), O_DIRECTORY | O_RDONLY); @@ -1990,7 +1990,7 @@ main(int argc, char **argv) errno != ENOSYS) { error("unable to limit dump descriptor fcntls"); } -#else /* !HAVE_CAPSPER */ +#else /* !HAVE_CASPER */ dumpinfo.WFileName = WFileName; #endif callback = dump_packet_and_trunc; @@ -2066,7 +2066,7 @@ main(int argc, char **argv) #ifdef __FreeBSD__ cansandbox = (VFileName == NULL && zflag == NULL); -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER cansandbox = (cansandbox && (nflag || capdns != NULL)); #else cansandbox = (cansandbox && nflag); @@ -2122,7 +2122,7 @@ main(int argc, char **argv) pd = pcap_open_offline(RFileName, ebuf); if (pd == NULL) error("%s", ebuf); -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER cap_rights_init(&rights, CAP_READ); if (cap_rights_limit(fileno(pcap_file(pd)), &rights) < 0 && errno != ENOSYS) { @@ -2325,7 +2325,7 @@ dump_packet_and_trunc(u_char *user, cons /* If the time is greater than the specified window, rotate */ if (t - Gflag_time >= Gflag) { -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER FILE *fp; int fd; #endif @@ -2383,7 +2383,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); @@ -2397,7 +2397,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !HAVE_CAPSPER */ +#else /* !HAVE_CASPER */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2406,7 +2406,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER set_dumper_capsicum_rights(dump_info->p); #endif } @@ -2423,7 +2423,7 @@ dump_packet_and_trunc(u_char *user, cons if (size == -1) error("ftell fails on output file"); if (size > Cflag) { -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER FILE *fp; int fd; #endif @@ -2455,7 +2455,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); if (fd < 0) { @@ -2468,7 +2468,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !HAVE_CAPSPER */ +#else /* !HAVE_CASPER */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2477,7 +2477,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CAPSPER +#ifdef HAVE_CASPER set_dumper_capsicum_rights(dump_info->p); #endif } Modified: head/usr.sbin/tcpdump/tcpdump/config.h ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/config.h Wed Jun 8 22:29:30 2016 (r301700) +++ head/usr.sbin/tcpdump/tcpdump/config.h Wed Jun 8 22:30:21 2016 (r301701) @@ -15,7 +15,7 @@ /* capsicum support available */ /* See Makefile */ -/* #undef HAVE_CAPSPER */ +/* #undef HAVE_CASPER */ /* Define to 1 if you have the `cap_enter' function. */ #define HAVE_CAP_ENTER 1 From owner-svn-src-all@freebsd.org Wed Jun 8 22:36:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A3D4B6F49B; Wed, 8 Jun 2016 22:36:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39192113C; Wed, 8 Jun 2016 22:36:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58MatvI046640; Wed, 8 Jun 2016 22:36:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58MatqX046639; Wed, 8 Jun 2016 22:36:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606082236.u58MatqX046639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 8 Jun 2016 22:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301702 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 22:36:56 -0000 Author: andrew Date: Wed Jun 8 22:36:55 2016 New Revision: 301702 URL: https://svnweb.freebsd.org/changeset/base/301702 Log: Allow libefi to be built with TERM_EMU undefined. There were a few places where we assumed TERM_EMU was defined but didn't check. Fix these by also including them under the ifdefs. As HO is called from loader we need a null implementation so loader.efi doesn't need to know which version of libefi it is building against. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/efi/libefi/efi_console.c Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Wed Jun 8 22:30:21 2016 (r301701) +++ head/sys/boot/efi/libefi/efi_console.c Wed Jun 8 22:36:55 2016 (r301702) @@ -111,9 +111,9 @@ efi_cons_probe(struct console *cp) static int efi_cons_init(int arg) { +#ifdef TERM_EMU conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, DEFAULT_BGCOLOR)); -#ifdef TERM_EMU end_term(); get_pos(&curx, &cury); curs_move(&curx, &cury, curx, cury); @@ -178,6 +178,7 @@ efi_cons_rawputchar(int c) } } +#ifdef TERM_EMU /* Gracefully exit ESC-sequence processing in case of misunderstanding. */ static void bail_out(int c) @@ -412,6 +413,12 @@ efi_term_emu(int c) break; } } +#else +void +HO(void) +{ +} +#endif void efi_cons_putchar(int c) From owner-svn-src-all@freebsd.org Wed Jun 8 23:13:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D736BB7001B; Wed, 8 Jun 2016 23:13:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4BAD1951; Wed, 8 Jun 2016 23:13:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58NDKDX061565; Wed, 8 Jun 2016 23:13:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58NDKiR061564; Wed, 8 Jun 2016 23:13:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606082313.u58NDKiR061564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 8 Jun 2016 23:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301703 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 23:13:21 -0000 Author: andrew Date: Wed Jun 8 23:13:20 2016 New Revision: 301703 URL: https://svnweb.freebsd.org/changeset/base/301703 Log: Print the newline character along with the carriage return when TERM_EMU is disabled. Without this we print all lines over top of each other. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/efi/libefi/efi_console.c Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Wed Jun 8 22:36:55 2016 (r301702) +++ head/sys/boot/efi/libefi/efi_console.c Wed Jun 8 23:13:20 2016 (r301703) @@ -139,8 +139,7 @@ efi_cons_rawputchar(int c) #ifndef TERM_EMU if (c == '\n') efi_cons_efiputchar('\r'); - else - efi_cons_efiputchar(c); + efi_cons_efiputchar(c); #else switch (c) { case '\r': From owner-svn-src-all@freebsd.org Wed Jun 8 23:17:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67A25B701C8; Wed, 8 Jun 2016 23:17:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A7771D85; Wed, 8 Jun 2016 23:17:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58NHUdc061735; Wed, 8 Jun 2016 23:17:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58NHU4e061734; Wed, 8 Jun 2016 23:17:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606082317.u58NHU4e061734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 23:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301704 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 23:17:31 -0000 Author: ngie Date: Wed Jun 8 23:17:30 2016 New Revision: 301704 URL: https://svnweb.freebsd.org/changeset/base/301704 Log: Test for strchr(3) returning NULL, not 0 MFC after: 3 days Reported by: coccinelle Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/rpc/getnetpath.c Modified: head/lib/libc/rpc/getnetpath.c ============================================================================== --- head/lib/libc/rpc/getnetpath.c Wed Jun 8 23:13:20 2016 (r301703) +++ head/lib/libc/rpc/getnetpath.c Wed Jun 8 23:17:30 2016 (r301704) @@ -262,7 +262,7 @@ _get_next_token(char *npp, int token) *cp++ = '\0'; /* null-terminate token */ /* get rid of any backslash escapes */ ep = npp; - while ((np = strchr(ep, '\\')) != 0) { + while ((np = strchr(ep, '\\')) != NULL) { if (np[1] == '\\') np++; strcpy(np, (ep = &np[1])); /* XXX: overlapping string copy */ From owner-svn-src-all@freebsd.org Wed Jun 8 23:23:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDCE6B70446; Wed, 8 Jun 2016 23:23:00 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA5512AD; Wed, 8 Jun 2016 23:23:00 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58NMxVb065172; Wed, 8 Jun 2016 23:22:59 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58NMxj2065171; Wed, 8 Jun 2016 23:22:59 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606082322.u58NMxj2065171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 8 Jun 2016 23:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301705 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 23:23:00 -0000 Author: oshogbo Date: Wed Jun 8 23:22:59 2016 New Revision: 301705 URL: https://svnweb.freebsd.org/changeset/base/301705 Log: The code responsible for opening and rotating pcap files is independent of Capser and should use openat(2) unconditionally on FreeBSD. openat(2) is mandatory when sandboxed with Capsicum, but still works in the absence of Capsicum. Reviewed by: AllanJude Modified: head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Wed Jun 8 23:17:30 2016 (r301704) +++ head/contrib/tcpdump/tcpdump.c Wed Jun 8 23:22:59 2016 (r301705) @@ -86,6 +86,7 @@ extern int SIZE_BUF; #ifdef __FreeBSD__ #include #include +#include #endif /* __FreeBSD__ */ #ifdef HAVE_CASPER #include @@ -95,7 +96,6 @@ extern int SIZE_BUF; #include #include #include -#include #endif /* HAVE_CASPER */ #include #include @@ -484,7 +484,7 @@ struct dump_info { char *CurrentFileName; pcap_t *pd; pcap_dumper_t *p; -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ int dirfd; #endif }; @@ -967,7 +967,7 @@ tstamp_precision_to_string(int precision } #endif -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ /* * Ensure that, on a dump file's descriptor, we have all the rights * necessary to make the standard I/O library work with an fdopen()ed @@ -1067,9 +1067,9 @@ main(int argc, char **argv) #endif int status; FILE *VFile; -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ cap_rights_t rights; -#endif /* HAVE_CASPER */ +#endif /* !__FreeBSD__ */ int cansandbox; #ifdef WIN32 @@ -1968,11 +1968,11 @@ main(int argc, char **argv) #endif /* HAVE_LIBCAP_NG */ if (p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ set_dumper_capsicum_rights(p); #endif if (Cflag != 0 || Gflag != 0) { -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ dumpinfo.WFileName = strdup(basename(WFileName)); dumpinfo.dirfd = open(dirname(WFileName), O_DIRECTORY | O_RDONLY); @@ -1990,7 +1990,7 @@ main(int argc, char **argv) errno != ENOSYS) { error("unable to limit dump descriptor fcntls"); } -#else /* !HAVE_CASPER */ +#else /* !__FreeBSD__ */ dumpinfo.WFileName = WFileName; #endif callback = dump_packet_and_trunc; @@ -2325,7 +2325,7 @@ dump_packet_and_trunc(u_char *user, cons /* If the time is greater than the specified window, rotate */ if (t - Gflag_time >= Gflag) { -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ FILE *fp; int fd; #endif @@ -2383,7 +2383,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); @@ -2397,7 +2397,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !HAVE_CASPER */ +#else /* !__FreeBSD__ */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2406,7 +2406,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ set_dumper_capsicum_rights(dump_info->p); #endif } @@ -2423,7 +2423,7 @@ dump_packet_and_trunc(u_char *user, cons if (size == -1) error("ftell fails on output file"); if (size > Cflag) { -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ FILE *fp; int fd; #endif @@ -2455,7 +2455,7 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_SELECT_BOTH); #endif /* HAVE_LIBCAP_NG */ -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ fd = openat(dump_info->dirfd, dump_info->CurrentFileName, O_CREAT | O_WRONLY | O_TRUNC, 0644); if (fd < 0) { @@ -2468,7 +2468,7 @@ dump_packet_and_trunc(u_char *user, cons dump_info->CurrentFileName); } dump_info->p = pcap_dump_fopen(dump_info->pd, fp); -#else /* !HAVE_CASPER */ +#else /* !__FreeBSD__ */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); #endif #ifdef HAVE_LIBCAP_NG @@ -2477,7 +2477,7 @@ dump_packet_and_trunc(u_char *user, cons #endif /* HAVE_LIBCAP_NG */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); -#ifdef HAVE_CASPER +#ifdef __FreeBSD__ set_dumper_capsicum_rights(dump_info->p); #endif } From owner-svn-src-all@freebsd.org Wed Jun 8 23:23:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60D31B704A5; Wed, 8 Jun 2016 23:23:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AF9E144E; Wed, 8 Jun 2016 23:23:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58NNGv8065229; Wed, 8 Jun 2016 23:23:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58NNGsP065228; Wed, 8 Jun 2016 23:23:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606082323.u58NNGsP065228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 8 Jun 2016 23:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301706 - head/sys/boot/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 23:23:17 -0000 Author: andrew Date: Wed Jun 8 23:23:16 2016 New Revision: 301706 URL: https://svnweb.freebsd.org/changeset/base/301706 Log: Also set -fshort-wchar on arm64, this fixes parsing strings from UEFI, e.g. on the command line. Sponsored by: ABT Systems Ltd Modified: head/sys/boot/efi/Makefile.inc Modified: head/sys/boot/efi/Makefile.inc ============================================================================== --- head/sys/boot/efi/Makefile.inc Wed Jun 8 23:22:59 2016 (r301705) +++ head/sys/boot/efi/Makefile.inc Wed Jun 8 23:23:16 2016 (r301706) @@ -18,4 +18,8 @@ CFLAGS+= -mno-red-zone CFLAGS+= -mno-aes .endif +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -fshort-wchar +.endif + .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Wed Jun 8 23:23:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4371FB704C3; Wed, 8 Jun 2016 23:23:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1639D1456; Wed, 8 Jun 2016 23:23:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58NNJB1065277; Wed, 8 Jun 2016 23:23:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58NNJPF065276; Wed, 8 Jun 2016 23:23:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606082323.u58NNJPF065276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 23:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301707 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 23:23:20 -0000 Author: ngie Date: Wed Jun 8 23:23:19 2016 New Revision: 301707 URL: https://svnweb.freebsd.org/changeset/base/301707 Log: Use NULL instead of `0` in _ht_getnetbyname(..) - getnetent returns NULL on completion/error. - .h_aliases is NULL terminated. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/net/getnetbyht.c Modified: head/lib/libc/net/getnetbyht.c ============================================================================== --- head/lib/libc/net/getnetbyht.c Wed Jun 8 23:23:16 2016 (r301706) +++ head/lib/libc/net/getnetbyht.c Wed Jun 8 23:23:19 2016 (r301707) @@ -215,10 +215,10 @@ _ht_getnetbyname(void *rval, void *cb_da } _setnethtent(ned->stayopen, ned); - while ((error = getnetent_p(&ne, ned)) == 0) { + while ((error = getnetent_p(&ne, ned)) == NULL) { if (strcasecmp(ne.n_name, name) == 0) break; - for (cp = ne.n_aliases; *cp != 0; cp++) + for (cp = ne.n_aliases; *cp != NULL; cp++) if (strcasecmp(*cp, name) == 0) goto found; } From owner-svn-src-all@freebsd.org Wed Jun 8 23:30:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1655BB70758; Wed, 8 Jun 2016 23:30:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5CF91DB0; Wed, 8 Jun 2016 23:30:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58NUEvV066139; Wed, 8 Jun 2016 23:30:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58NUEUY066138; Wed, 8 Jun 2016 23:30:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606082330.u58NUEUY066138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 8 Jun 2016 23:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301708 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 23:30:15 -0000 Author: ngie Date: Wed Jun 8 23:30:13 2016 New Revision: 301708 URL: https://svnweb.freebsd.org/changeset/base/301708 Log: Revert r301707 getnetent_p doesn't return NULL like getnetent does. coccinelle got confused and I didn't verify that it worked before committing the change MFC after: 1 week X-MFC with: r301707 Pointyhat to: ngie Modified: head/lib/libc/net/getnetbyht.c Modified: head/lib/libc/net/getnetbyht.c ============================================================================== --- head/lib/libc/net/getnetbyht.c Wed Jun 8 23:23:19 2016 (r301707) +++ head/lib/libc/net/getnetbyht.c Wed Jun 8 23:30:13 2016 (r301708) @@ -215,10 +215,10 @@ _ht_getnetbyname(void *rval, void *cb_da } _setnethtent(ned->stayopen, ned); - while ((error = getnetent_p(&ne, ned)) == NULL) { + while ((error = getnetent_p(&ne, ned)) == 0) { if (strcasecmp(ne.n_name, name) == 0) break; - for (cp = ne.n_aliases; *cp != NULL; cp++) + for (cp = ne.n_aliases; *cp != 0; cp++) if (strcasecmp(*cp, name) == 0) goto found; } From owner-svn-src-all@freebsd.org Thu Jun 9 01:05:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 172ABB70BF1; Thu, 9 Jun 2016 01:05:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCAE7136F; Thu, 9 Jun 2016 01:05:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5915Ovk002463; Thu, 9 Jun 2016 01:05:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5915OFJ002462; Thu, 9 Jun 2016 01:05:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606090105.u5915OFJ002462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jun 2016 01:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301709 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 01:05:25 -0000 Author: markj Date: Thu Jun 9 01:05:23 2016 New Revision: 301709 URL: https://svnweb.freebsd.org/changeset/base/301709 Log: Use a more common spelling for "(char *)0" in the getnetgrent man page. MFC after: 3 days Modified: head/lib/libc/gen/getnetgrent.3 Modified: head/lib/libc/gen/getnetgrent.3 ============================================================================== --- head/lib/libc/gen/getnetgrent.3 Wed Jun 8 23:30:13 2016 (r301708) +++ head/lib/libc/gen/getnetgrent.3 Thu Jun 9 01:05:23 2016 (r301709) @@ -68,7 +68,7 @@ The function sets the three pointer arguments to the strings of the next member of the current netgroup. If any of the string pointers are -.Sy (char *)0 +.Dv NULL that field is considered a wildcard. .Pp The functions @@ -95,7 +95,7 @@ If any of the or .Sy domain arguments are -.Sy (char *)0 +.Dv NULL those fields will match any string value in the netgroup member. .Sh RETURN VALUES The function From owner-svn-src-all@freebsd.org Thu Jun 9 01:11:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D42FEB70EA0; Thu, 9 Jun 2016 01:11:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A524B1957; Thu, 9 Jun 2016 01:11:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u591Bmpj003308; Thu, 9 Jun 2016 01:11:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u591BmNn003307; Thu, 9 Jun 2016 01:11:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606090111.u591BmNn003307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jun 2016 01:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301710 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 01:11:49 -0000 Author: markj Date: Thu Jun 9 01:11:48 2016 New Revision: 301710 URL: https://svnweb.freebsd.org/changeset/base/301710 Log: Fix an infinite loop in setnetgrent(3) with NIS netgroups. Handle an empty result from yp_match() by returning NULL, which is consistent with the handling of an empty netgroup in /etc/netgroup. setnetgrent(3) has no return value, so there is no particular need to distinguish this case from an error. PR: 26486 MFC after: 2 weeks Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Thu Jun 9 01:05:23 2016 (r301709) +++ head/lib/libc/gen/getnetgrent.c Thu Jun 9 01:11:48 2016 (r301710) @@ -558,6 +558,10 @@ read_for_group(const char *group) continue; } } + if (strlen(result) == 0) { + free(result); + return (NULL); + } snprintf(line, LINSIZ, "%s %s", group, result); free(result); } From owner-svn-src-all@freebsd.org Thu Jun 9 01:28:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2462B6E2E1; Thu, 9 Jun 2016 01:28:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8438E1FC9; Thu, 9 Jun 2016 01:28:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u591SiNi009991; Thu, 9 Jun 2016 01:28:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u591SivR009985; Thu, 9 Jun 2016 01:28:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606090128.u591SivR009985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jun 2016 01:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301711 - in head: etc include lib/libc/gen share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 01:28:45 -0000 Author: markj Date: Thu Jun 9 01:28:44 2016 New Revision: 301711 URL: https://svnweb.freebsd.org/changeset/base/301711 Log: Implement an NSS backend for netgroups and add getnetgrent_r(3). This support appears to have been documented in nsswitch.conf(5) for some time. The implementation adds two NSS netgroup providers to libc. The default, compat, provides the behaviour documented in netgroup(5), so this change does not make any user-visible behaviour changes. A files provider is also implemented. innetgr(3) is implemented as an optional NSS method so that providers such as NIS which are able to implement efficient reverse lookup can do so. A fallback implementation is used otherwise. getnetgrent_r(3) is added for convenience and to provide compatibility with glibc and Solaris. With a small patch to net/nss_ldap, it's possible to specify an ldap netgroup provider, allowing one to query nisNetgroupTriple entries. Sponsored by: EMC / Isilon Storage Division Modified: head/etc/nsswitch.conf head/include/netdb.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/getnetgrent.3 head/lib/libc/gen/getnetgrent.c head/share/man/man5/nsswitch.conf.5 Modified: head/etc/nsswitch.conf ============================================================================== --- head/etc/nsswitch.conf Thu Jun 9 01:11:48 2016 (r301710) +++ head/etc/nsswitch.conf Thu Jun 9 01:28:44 2016 (r301711) @@ -5,6 +5,7 @@ group: compat group_compat: nis hosts: files dns +netgroup: compat networks: files passwd: compat passwd_compat: nis Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Thu Jun 9 01:11:48 2016 (r301710) +++ head/include/netdb.h Thu Jun 9 01:28:44 2016 (r301711) @@ -275,6 +275,7 @@ int getnetbyname_r(const char *, struct int getnetent_r(struct netent *, char *, size_t, struct netent **, int *); int getnetgrent(char **, char **, char **); +int getnetgrent_r(char **, char **, char **, char *, size_t); int getprotobyname_r(const char *, struct protoent *, char *, size_t, struct protoent **); int getprotobynumber_r(int, struct protoent *, char *, size_t, Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Jun 9 01:11:48 2016 (r301710) +++ head/lib/libc/gen/Symbol.map Thu Jun 9 01:28:44 2016 (r301711) @@ -410,6 +410,7 @@ FBSD_1.3 { }; FBSD_1.4 { + getnetgrent_r; pthread_mutex_consistent; pthread_mutexattr_getrobust; pthread_mutexattr_setrobust; Modified: head/lib/libc/gen/getnetgrent.3 ============================================================================== --- head/lib/libc/gen/getnetgrent.3 Thu Jun 9 01:11:48 2016 (r301710) +++ head/lib/libc/gen/getnetgrent.3 Thu Jun 9 01:28:44 2016 (r301711) @@ -28,7 +28,7 @@ .\" @(#)getnetgrent.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd June 5, 2016 .Dt GETNETGRENT 3 .Os .Sh NAME @@ -44,6 +44,8 @@ .Ft int .Fn getnetgrent "char **host" "char **user" "char **domain" .Ft int +.Fn getnetgrent_r "char **host" "char **user" "char **domain" "char *buf" "size_t bufsize" +.Ft int .Fn innetgr "const char *netgroup" "const char *host" "const char *user" "const char *domain" .Ft void .Fn setnetgrent "const char *netgroup" Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Thu Jun 9 01:11:48 2016 (r301710) +++ head/lib/libc/gen/getnetgrent.c Thu Jun 9 01:28:44 2016 (r301711) @@ -36,12 +36,21 @@ static char sccsid[] = "@(#)getnetgrent. #include __FBSDID("$FreeBSD$"); +#include "namespace.h" + #include +#include +#include +#include +#include +#include #include #include #include #include +#include "nss_tls.h" + #ifdef YP /* * Notes: @@ -98,6 +107,16 @@ static int _yp_innetgr; #define _PATH_NETGROUP "/etc/netgroup" #endif +enum constants { + NGRP_STORAGE_INITIAL = 1 << 10, /* 1 KByte */ + NGRP_STORAGE_MAX = 1 << 20, /* 1 MByte */ +}; + +static const ns_src defaultsrc[] = { + { NSSRC_COMPAT, NS_SUCCESS }, + { NULL, 0 }, +}; + /* * Static Variables and functions used by setnetgrent(), getnetgrent() and * endnetgrent(). @@ -117,51 +136,212 @@ struct netgrp { struct netgrp *ng_next; /* Chain ptr */ char *ng_str[3]; /* Field pointers, see below */ }; + +struct netgr_state { + FILE *st_netf; + struct linelist *st_linehead; + struct netgrp *st_nextgrp; + struct netgrp *st_gr; + char *st_grname; +}; + #define NG_HOST 0 /* Host name */ #define NG_USER 1 /* User name */ #define NG_DOM 2 /* and Domain name */ -static struct linelist *linehead = (struct linelist *)0; -static struct netgrp *nextgrp = (struct netgrp *)0; -static struct { - struct netgrp *gr; - char *grname; -} grouphead = { - (struct netgrp *)0, - (char *)0, -}; -static FILE *netf = (FILE *)0; +static void netgr_endstate(void *); +NSS_TLS_HANDLING(netgr); -static int parse_netgrp(const char *); -static struct linelist *read_for_group(const char *); -void setnetgrent(const char *); -void endnetgrent(void); -int getnetgrent(char **, char **, char **); -int innetgr(const char *, const char *, const char *, const char *); +static int files_endnetgrent(void *, void *, va_list); +static int files_getnetgrent_r(void *, void *, va_list); +static int files_setnetgrent(void *, void *, va_list); + +static int compat_endnetgrent(void *, void *, va_list); +static int compat_innetgr(void *, void *, va_list); +static int compat_getnetgrent_r(void *, void *, va_list); +static int compat_setnetgrent(void *, void *, va_list); + +static void _compat_clearstate(void); +static int _getnetgrent_r(char **, char **, char **, char *, size_t, int *, + struct netgr_state *); +static int _innetgr_fallback(void *, void *, const char *, const char *, + const char *, const char *); +static int innetgr_fallback(void *, void *, va_list); +static int parse_netgrp(const char *, struct netgr_state *, int); +static struct linelist *read_for_group(const char *, struct netgr_state *, int); #define LINSIZ 1024 /* Length of netgroup file line */ +static const ns_dtab getnetgrent_dtab[] = { + NS_FILES_CB(files_getnetgrent_r, NULL) + NS_COMPAT_CB(compat_getnetgrent_r, NULL) + { NULL, NULL, NULL }, +}; + +static const ns_dtab setnetgrent_dtab[] = { + NS_FILES_CB(files_setnetgrent, NULL) + NS_COMPAT_CB(compat_setnetgrent, NULL) + { NULL, NULL, NULL }, +}; + +static const ns_dtab endnetgrent_dtab[] = { + NS_FILES_CB(files_endnetgrent, NULL) + NS_COMPAT_CB(compat_endnetgrent, NULL) + { NULL, NULL, NULL }, +}; + +static struct netgr_state compat_state; + +static void +netgr_endstate(void *arg) +{ + struct linelist *lp, *olp; + struct netgrp *gp, *ogp; + struct netgr_state *st; + + st = (struct netgr_state *)arg; + lp = st->st_linehead; + while (lp != NULL) { + olp = lp; + lp = lp->l_next; + free(olp->l_groupname); + free(olp->l_line); + free(olp); + } + st->st_linehead = NULL; + if (st->st_grname != NULL) { + free(st->st_grname); + st->st_grname = NULL; + } + gp = st->st_gr; + while (gp != NULL) { + ogp = gp; + gp = gp->ng_next; + free(ogp->ng_str[NG_HOST]); + free(ogp->ng_str[NG_USER]); + free(ogp->ng_str[NG_DOM]); + free(ogp); + } + st->st_gr = NULL; + st->st_nextgrp = NULL; +} + +static int +files_getnetgrent_r(void *retval, void *mdata, va_list ap) +{ + struct netgr_state *st; + char **hostp, **userp, **domp, *buf; + size_t bufsize; + int *errnop; + + hostp = va_arg(ap, char **); + userp = va_arg(ap, char **); + domp = va_arg(ap, char **); + buf = va_arg(ap, char *); + bufsize = va_arg(ap, size_t); + errnop = va_arg(ap, int *); + + if (netgr_getstate(&st) != 0) + return (NS_UNAVAIL); + + return (_getnetgrent_r(hostp, userp, domp, buf, bufsize, errnop, st)); +} + +static int +files_setnetgrent(void *retval, void *mdata, va_list ap) +{ + const ns_src src[] = { + { NSSRC_FILES, NS_SUCCESS }, + { NULL, 0 }, + }; + struct netgr_state *st; + const char *group; + int rv; + + group = va_arg(ap, const char *); + + if (group == NULL || group[0] == '\0') + return (NS_RETURN); + + rv = netgr_getstate(&st); + if (rv != 0) + return (NS_UNAVAIL); + + if (st->st_gr == NULL || strcmp(group, st->st_grname) != 0) { + (void)_nsdispatch(NULL, endnetgrent_dtab, NSDB_NETGROUP, + "endnetgrent", src); + if ((st->st_netf = fopen(_PATH_NETGROUP, "re")) != NULL) { + if (parse_netgrp(group, st, 0) != 0) + (void)_nsdispatch(NULL, endnetgrent_dtab, + NSDB_NETGROUP, "endnetgrent", src); + else + st->st_grname = strdup(group); + (void)fclose(st->st_netf); + st->st_netf = NULL; + } + } + st->st_nextgrp = st->st_gr; + return (st->st_grname != NULL ? NS_SUCCESS : NS_NOTFOUND); +} + +static int +files_endnetgrent(void *retval, void *mdata, va_list ap) +{ + struct netgr_state *st; + + if (netgr_getstate(&st) != 0) + return (NS_UNAVAIL); + netgr_endstate(st); + return (NS_SUCCESS); +} + +static int +compat_getnetgrent_r(void *retval, void *mdata, va_list ap) +{ + char **hostp, **userp, **domp, *buf; + size_t bufsize; + int *errnop; +#ifdef YP + _yp_innetgr = 0; +#endif + + hostp = va_arg(ap, char **); + userp = va_arg(ap, char **); + domp = va_arg(ap, char **); + buf = va_arg(ap, char *); + bufsize = va_arg(ap, size_t); + errnop = va_arg(ap, int *); + + return (_getnetgrent_r(hostp, userp, domp, buf, bufsize, errnop, + &compat_state)); +} + /* - * setnetgrent() + * compat_setnetgrent() * Parse the netgroup file looking for the netgroup and build the list * of netgrp structures. Let parse_netgrp() and read_for_group() do * most of the work. */ -void -setnetgrent(const char *group) +static int +compat_setnetgrent(void *retval, void *mdata, va_list ap) { + FILE *netf; + const char *group; #ifdef YP struct stat _yp_statp; char _yp_plus; #endif - /* Sanity check */ + group = va_arg(ap, const char *); + /* Sanity check */ if (group == NULL || !strlen(group)) - return; + return (NS_RETURN); + + if (compat_state.st_gr == NULL || + strcmp(group, compat_state.st_grname) != 0) { + _compat_clearstate(); - if (grouphead.gr == NULL || strcmp(group, grouphead.grname)) { - endnetgrent(); #ifdef YP /* Presumed guilty until proven innocent. */ _use_only_yp = 0; @@ -173,6 +353,7 @@ setnetgrent(const char *group) errno == ENOENT) || _yp_statp.st_size == 0) _use_only_yp = _netgr_yp_enabled = 1; if ((netf = fopen(_PATH_NETGROUP,"re")) != NULL ||_use_only_yp){ + compat_state.st_netf = netf; /* * Icky: grab the first character of the netgroup file * and turn on NIS if it's a '+'. rewind the stream @@ -193,79 +374,81 @@ setnetgrent(const char *group) /* dohw! */ if (netf != NULL) fclose(netf); - return; + return (NS_RETURN); } #else if ((netf = fopen(_PATH_NETGROUP, "re"))) { + compat_state.st_netf = netf; #endif - if (parse_netgrp(group)) - endnetgrent(); - else { - grouphead.grname = strdup(group); + if (parse_netgrp(group, &compat_state, 1)) { + _compat_clearstate(); + } else { + compat_state.st_grname = strdup(group); } if (netf) fclose(netf); } } - nextgrp = grouphead.gr; + compat_state.st_nextgrp = compat_state.st_gr; + return (NS_SUCCESS); } -/* - * Get the next netgroup off the list. - */ -int -getnetgrent(char **hostp, char **userp, char **domp) +static void +_compat_clearstate(void) { + #ifdef YP - _yp_innetgr = 0; + _netgr_yp_enabled = 0; #endif - - if (nextgrp) { - *hostp = nextgrp->ng_str[NG_HOST]; - *userp = nextgrp->ng_str[NG_USER]; - *domp = nextgrp->ng_str[NG_DOM]; - nextgrp = nextgrp->ng_next; - return (1); - } - return (0); + netgr_endstate(&compat_state); } /* - * endnetgrent() - cleanup + * compat_endnetgrent() - cleanup */ -void -endnetgrent(void) +static int +compat_endnetgrent(void *retval, void *mdata, va_list ap) { - struct linelist *lp, *olp; - struct netgrp *gp, *ogp; - lp = linehead; - while (lp) { - olp = lp; - lp = lp->l_next; - free(olp->l_groupname); - free(olp->l_line); - free(olp); - } - linehead = NULL; - if (grouphead.grname) { - free(grouphead.grname); - grouphead.grname = NULL; - } - gp = grouphead.gr; - while (gp) { - ogp = gp; - gp = gp->ng_next; - free(ogp->ng_str[NG_HOST]); - free(ogp->ng_str[NG_USER]); - free(ogp->ng_str[NG_DOM]); - free(ogp); + _compat_clearstate(); + return (NS_SUCCESS); +} + +int +_getnetgrent_r(char **hostp, char **userp, char **domp, char *buf, + size_t bufsize, int *errnop, struct netgr_state *st) +{ + char *p, *src; + size_t len; + int rv; + +#define COPY_NG_ELEM(dstp, i) do { \ + src = st->st_nextgrp->ng_str[(i)]; \ + if (src == NULL) \ + src = ""; \ + len = strlcpy(p, src, bufsize); \ + if (len >= bufsize) { \ + *errnop = ERANGE; \ + return (NS_RETURN); \ + } \ + *(dstp) = p; \ + p += len + 1; \ + bufsize -= len + 1; \ +} while (0) + + p = buf; + if (st->st_nextgrp != NULL) { + COPY_NG_ELEM(hostp, NG_HOST); + COPY_NG_ELEM(userp, NG_USER); + COPY_NG_ELEM(domp, NG_DOM); + st->st_nextgrp = st->st_nextgrp->ng_next; + rv = NS_SUCCESS; + } else { + rv = NS_NOTFOUND; } - grouphead.gr = NULL; - nextgrp = NULL; -#ifdef YP - _netgr_yp_enabled = 0; -#endif +#undef COPY_NG_ELEM + + return (rv); } #ifdef YP @@ -343,20 +526,29 @@ _revnetgr_lookup(char* lookupdom, char* /* * Search for a match in a netgroup. */ -int -innetgr(const char *group, const char *host, const char *user, const char *dom) +static int +compat_innetgr(void *retval, void *mdata, va_list ap) { - char *hst, *usr, *dm; - /* Sanity check */ - +#ifdef YP + const ns_src src[] = { + { mdata, NS_SUCCESS }, + { NULL, 0 }, + }; +#endif + const char *group, *host, *user, *dom; + + group = va_arg(ap, const char *); + host = va_arg(ap, const char *); + user = va_arg(ap, const char *); + dom = va_arg(ap, const char *); + if (group == NULL || !strlen(group)) - return (0); + return (NS_RETURN); #ifdef YP _yp_innetgr = 1; -#endif - setnetgrent(group); -#ifdef YP + (void)_nsdispatch(NULL, setnetgrent_dtab, NSDB_NETGROUP, "setnetgrent", + src, group); _yp_innetgr = 0; /* * If we're in NIS-only mode, do the search using @@ -384,38 +576,105 @@ innetgr(const char *group, const char *h if (_use_only_yp && (host == NULL) != (user == NULL)) { int ret; if(yp_get_default_domain(&_netgr_yp_domain)) - return (0); - ret = _revnetgr_lookup(_netgr_yp_domain, + return (NS_NOTFOUND); + ret = _revnetgr_lookup(_netgr_yp_domain, host?"netgroup.byhost":"netgroup.byuser", host?host:user, dom, group); - if (ret == 1) - return (1); - else if (ret == 0 && dom != NULL) - return (0); + if (ret == 1) { + *(int *)retval = 1; + return (NS_SUCCESS); + } else if (ret == 0 && dom != NULL) { + *(int *)retval = 0; + return (NS_SUCCESS); + } } - - setnetgrent(group); #endif /* YP */ - while (getnetgrent(&hst, &usr, &dm)) - if ((host == NULL || hst == NULL || !strcmp(host, hst)) && - (user == NULL || usr == NULL || !strcmp(user, usr)) && - ( dom == NULL || dm == NULL || !strcmp(dom, dm))) { - endnetgrent(); - return (1); + return (_innetgr_fallback(retval, mdata, group, host, user, dom)); +} + +static int +_innetgr_fallback(void *retval, void *mdata, const char *group, const char *host, + const char *user, const char *dom) +{ + const ns_src src[] = { + { mdata, NS_SUCCESS }, + { NULL, 0 }, + }; + char *h, *u, *d; + char *buf; + size_t bufsize; + int rv, ret_errno; + + if (group == NULL || group[0] == '\0') + return (NS_RETURN); + + bufsize = NGRP_STORAGE_INITIAL; + buf = malloc(bufsize); + if (buf == NULL) + return (NS_UNAVAIL); + + *(int *)retval = 0; + + (void)_nsdispatch(NULL, setnetgrent_dtab, NSDB_NETGROUP, "setnetgrent", + src, group); + + for (;;) { + do { + ret_errno = 0; + rv = _nsdispatch(NULL, getnetgrent_dtab, NSDB_NETGROUP, + "getnetgrent_r", src, &h, &u, &d, buf, bufsize, + &ret_errno); + if (rv != NS_SUCCESS && ret_errno == ERANGE) { + bufsize *= 2; + if (bufsize > NGRP_STORAGE_MAX || + (buf = reallocf(buf, bufsize)) == NULL) + goto out; + } + } while (rv != NS_SUCCESS && ret_errno == ERANGE); + + if (rv != NS_SUCCESS) { + if (rv == NS_NOTFOUND && ret_errno == 0) + rv = NS_SUCCESS; + break; } - endnetgrent(); - return (0); + + if ((host == NULL || h == NULL || strcmp(host, h) == 0) && + (user == NULL || u == NULL || strcmp(user, u) == 0) && + (dom == NULL || d == NULL || strcmp(dom, d) == 0)) { + *(int *)retval = 1; + break; + } + } + +out: + free(buf); + (void)_nsdispatch(NULL, endnetgrent_dtab, NSDB_NETGROUP, "endnetgrent", + src); + return (rv); +} + +static int +innetgr_fallback(void *retval, void *mdata, va_list ap) +{ + const char *group, *host, *user, *dom; + + group = va_arg(ap, const char *); + host = va_arg(ap, const char *); + user = va_arg(ap, const char *); + dom = va_arg(ap, const char *); + + return (_innetgr_fallback(retval, mdata, group, host, user, dom)); } /* * Parse the netgroup file setting up the linked lists. */ static int -parse_netgrp(const char *group) +parse_netgrp(const char *group, struct netgr_state *st, int niscompat) { struct netgrp *grp; - struct linelist *lp = linehead; + struct linelist *lp = st->st_linehead; char **ng; char *epos, *gpos, *pos, *spos; int freepos, len, strpos; @@ -431,7 +690,7 @@ parse_netgrp(const char *group) break; lp = lp->l_next; } - if (lp == NULL && (lp = read_for_group(group)) == NULL) + if (lp == NULL && (lp = read_for_group(group, st, niscompat)) == NULL) return (1); if (lp->l_parsed) { #ifdef DEBUG @@ -493,8 +752,8 @@ parse_netgrp(const char *group) } bcopy(spos, ng[strpos], len + 1); } - grp->ng_next = grouphead.gr; - grouphead.gr = grp; + grp->ng_next = st->st_gr; + st->st_gr = grp; #ifdef DEBUG /* * Note: on other platforms, malformed netgroup @@ -515,7 +774,7 @@ parse_netgrp(const char *group) #endif } else { spos = strsep(&pos, ", \t"); - if (parse_netgrp(spos)) + if (parse_netgrp(spos, st, niscompat)) continue; } if (pos == NULL) @@ -531,19 +790,22 @@ parse_netgrp(const char *group) * is found. Return 1 if eof is encountered. */ static struct linelist * -read_for_group(const char *group) +read_for_group(const char *group, struct netgr_state *st, int niscompat) { char *linep, *olinep, *pos, *spos; int len, olen; int cont; struct linelist *lp; char line[LINSIZ + 2]; + FILE *netf; #ifdef YP char *result; int resultlen; linep = NULL; - while (_netgr_yp_enabled || fgets(line, LINSIZ, netf) != NULL) { + netf = st->st_netf; + while ((_netgr_yp_enabled && niscompat) || + fgets(line, LINSIZ, netf) != NULL) { if (_netgr_yp_enabled) { if(!_netgr_yp_domain) if(yp_get_default_domain(&_netgr_yp_domain)) @@ -571,7 +833,7 @@ read_for_group(const char *group) #endif pos = (char *)&line; #ifdef YP - if (*pos == '+') { + if (niscompat && *pos == '+') { _netgr_yp_enabled = 1; continue; } @@ -588,11 +850,11 @@ read_for_group(const char *group) while (*pos == ' ' || *pos == '\t') pos++; if (*pos != '\n' && *pos != '\0') { - lp = (struct linelist *)malloc(sizeof (*lp)); - if (lp == NULL) + lp = malloc(sizeof (*lp)); + if (lp == NULL) return (NULL); lp->l_parsed = 0; - lp->l_groupname = (char *)malloc(len + 1); + lp->l_groupname = malloc(len + 1); if (lp->l_groupname == NULL) { free(lp); return (NULL); @@ -640,8 +902,8 @@ read_for_group(const char *group) } } while (cont); lp->l_line = linep; - lp->l_next = linehead; - linehead = lp; + lp->l_next = st->st_linehead; + st->st_linehead = lp; /* * If this is the one we wanted, we are done. @@ -662,3 +924,93 @@ read_for_group(const char *group) #endif return (NULL); } + +int +getnetgrent_r(char **hostp, char **userp, char **domp, char *buf, size_t bufsize) +{ + int rv, ret_errno; + + ret_errno = 0; + rv = _nsdispatch(NULL, getnetgrent_dtab, NSDB_NETGROUP, "getnetgrent_r", + defaultsrc, hostp, userp, domp, buf, bufsize, &ret_errno); + if (rv == NS_SUCCESS) { + return (1); + } else { + errno = ret_errno; + return (0); + } +} + +int +getnetgrent(char **hostp, char **userp, char **domp) +{ + static char *ngrp_storage; + static size_t ngrp_storage_size; + int ret_errno, rv; + + if (ngrp_storage == NULL) { + ngrp_storage_size = NGRP_STORAGE_INITIAL; + ngrp_storage = malloc(ngrp_storage_size); + if (ngrp_storage == NULL) + return (0); + } + + do { + ret_errno = 0; + rv = _nsdispatch(NULL, getnetgrent_dtab, NSDB_NETGROUP, + "getnetgrent_r", defaultsrc, hostp, userp, domp, + ngrp_storage, ngrp_storage_size, &ret_errno); + if (rv != NS_SUCCESS && ret_errno == ERANGE) { + ngrp_storage_size *= 2; + if (ngrp_storage_size > NGRP_STORAGE_MAX) { + free(ngrp_storage); + ngrp_storage = NULL; + errno = ERANGE; + return (0); + } + ngrp_storage = reallocf(ngrp_storage, + ngrp_storage_size); + if (ngrp_storage == NULL) + return (0); + } + } while (rv != NS_SUCCESS && ret_errno == ERANGE); + + if (rv == NS_SUCCESS) { + return (1); + } else { + errno = ret_errno; + return (0); + } +} + +void +setnetgrent(const char *netgroup) +{ + + (void)_nsdispatch(NULL, setnetgrent_dtab, NSDB_NETGROUP, "setnetgrent", + defaultsrc, netgroup); +} + +void +endnetgrent(void) +{ + + (void)_nsdispatch(NULL, endnetgrent_dtab, NSDB_NETGROUP, "endnetgrent", + defaultsrc); +} + +int +innetgr(const char *netgroup, const char *host, const char *user, + const char *domain) +{ + static const ns_dtab dtab[] = { + NS_COMPAT_CB(compat_innetgr, NULL) + NS_FALLBACK_CB(innetgr_fallback) + { NULL, NULL, NULL }, + }; + int result, rv; + + rv = _nsdispatch(&result, dtab, NSDB_NETGROUP, "innetgr", defaultsrc, + netgroup, host, user, domain); + return (rv == NS_SUCCESS ? result : 0); +} Modified: head/share/man/man5/nsswitch.conf.5 ============================================================================== --- head/share/man/man5/nsswitch.conf.5 Thu Jun 9 01:11:48 2016 (r301710) +++ head/share/man/man5/nsswitch.conf.5 Thu Jun 9 01:28:44 2016 (r301711) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd June 6, 2016 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -148,7 +148,9 @@ The following databases are used by the .Xr getprotoent 3 .It netgroup .Xr getnetgrent 3 , +.Xr getnetgrent_r 3 , .Xr setnetgrent 3 , +.Xr endnetgrent 3 , .Xr innetgr 3 .El .Ss Status codes From owner-svn-src-all@freebsd.org Thu Jun 9 01:31:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D35EB6E379; Thu, 9 Jun 2016 01:31:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79BD1129D; Thu, 9 Jun 2016 01:31:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u591V9Du012742; Thu, 9 Jun 2016 01:31:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u591V9JB012741; Thu, 9 Jun 2016 01:31:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606090131.u591V9JB012741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 9 Jun 2016 01:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301712 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 01:31:10 -0000 Author: cem Date: Thu Jun 9 01:31:09 2016 New Revision: 301712 URL: https://svnweb.freebsd.org/changeset/base/301712 Log: ioat(4): Add ddb "show ioat " debugger command Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Jun 9 01:28:44 2016 (r301711) +++ head/sys/dev/ioat/ioat.c Thu Jun 9 01:31:09 2016 (r301712) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include @@ -48,6 +50,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB +#include +#endif + #include "ioat.h" #include "ioat_hw.h" #include "ioat_internal.h" @@ -2090,3 +2096,96 @@ ioat_drain_locked(struct ioat_softc *ioa while (ioat->refcnt > 0) msleep(IOAT_REFLK, IOAT_REFLK, 0, "ioat_drain", 0); } + +#ifdef DDB +#define _db_show_lock(lo) LOCK_CLASS(lo)->lc_ddb_show(lo) +#define db_show_lock(lk) _db_show_lock(&(lk)->lock_object) +DB_SHOW_COMMAND(ioat, db_show_ioat) +{ + struct ioat_softc *sc; + unsigned idx; + + if (!have_addr) + goto usage; + idx = (unsigned)addr; + if (addr >= ioat_channel_index) + goto usage; + + sc = ioat_channel[idx]; + db_printf("ioat softc at %p\n", sc); + if (sc == NULL) + return; + + db_printf(" version: %d\n", sc->version); + db_printf(" chan_idx: %u\n", sc->chan_idx); + db_printf(" submit_lock: "); + db_show_lock(&sc->submit_lock); + + db_printf(" capabilities: %b\n", (int)sc->capabilities, + IOAT_DMACAP_STR); + db_printf(" cached_intrdelay: %u\n", sc->cached_intrdelay); + db_printf(" *comp_update: 0x%jx\n", (uintmax_t)*sc->comp_update); + + db_printf(" timer:\n"); + db_printf(" c_time: %ju\n", (uintmax_t)sc->timer.c_time); + db_printf(" c_arg: %p\n", sc->timer.c_arg); + db_printf(" c_func: %p\n", sc->timer.c_func); + db_printf(" c_lock: %p\n", sc->timer.c_lock); + db_printf(" c_flags: 0x%x\n", (unsigned)sc->timer.c_flags); + + db_printf(" quiescing: %d\n", (int)sc->quiescing); + db_printf(" destroying: %d\n", (int)sc->destroying); + db_printf(" is_resize_pending: %d\n", (int)sc->is_resize_pending); + db_printf(" is_completion_pending: %d\n", (int)sc->is_completion_pending); + db_printf(" is_reset_pending: %d\n", (int)sc->is_reset_pending); + db_printf(" is_channel_running: %d\n", (int)sc->is_channel_running); + db_printf(" intrdelay_supported: %d\n", (int)sc->intrdelay_supported); + + db_printf(" head: %u\n", sc->head); + db_printf(" tail: %u\n", sc->tail); + db_printf(" hw_head: %u\n", sc->hw_head); + db_printf(" ring_size_order: %u\n", sc->ring_size_order); + db_printf(" last_seen: 0x%lx\n", sc->last_seen); + db_printf(" ring: %p\n", sc->ring); + + db_printf(" cleanup_lock: "); + db_show_lock(&sc->cleanup_lock); + + db_printf(" refcnt: %u\n", sc->refcnt); +#ifdef INVARIANTS + CTASSERT(IOAT_NUM_REF_KINDS == 2); + db_printf(" refkinds: [ENG=%u, DESCR=%u]\n", sc->refkinds[0], + sc->refkinds[1]); +#endif + db_printf(" stats:\n"); + db_printf(" interrupts: %lu\n", sc->stats.interrupts); + db_printf(" descriptors_processed: %lu\n", sc->stats.descriptors_processed); + db_printf(" descriptors_error: %lu\n", sc->stats.descriptors_error); + db_printf(" descriptors_submitted: %lu\n", sc->stats.descriptors_submitted); + + db_printf(" channel_halts: %u\n", sc->stats.channel_halts); + db_printf(" last_halt_chanerr: %u\n", sc->stats.last_halt_chanerr); + + if (db_pager_quit) + return; + + db_printf(" hw status:\n"); + db_printf(" status: 0x%lx\n", ioat_get_chansts(sc)); + db_printf(" chanctrl: 0x%x\n", + (unsigned)ioat_read_2(sc, IOAT_CHANCTRL_OFFSET)); + db_printf(" chancmd: 0x%x\n", + (unsigned)ioat_read_1(sc, IOAT_CHANCMD_OFFSET)); + db_printf(" dmacount: 0x%x\n", + (unsigned)ioat_read_2(sc, IOAT_DMACOUNT_OFFSET)); + db_printf(" chainaddr: 0x%lx\n", + ioat_read_double_4(sc, IOAT_CHAINADDR_OFFSET_LOW)); + db_printf(" chancmp: 0x%lx\n", + ioat_read_double_4(sc, IOAT_CHANCMP_OFFSET_LOW)); + db_printf(" chanerr: %b\n", + (int)ioat_read_4(sc, IOAT_CHANERR_OFFSET), IOAT_CHANERR_STR); + return; +usage: + db_printf("usage: show ioat <0-%u>\n", ioat_channel_index); + return; +} +#endif /* DDB */ From owner-svn-src-all@freebsd.org Thu Jun 9 01:50:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7322B6EAAB; Thu, 9 Jun 2016 01:50:44 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 870271DCE; Thu, 9 Jun 2016 01:50:44 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u591ohTi019498; Thu, 9 Jun 2016 01:50:43 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u591ohZa019497; Thu, 9 Jun 2016 01:50:43 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606090150.u591ohZa019497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 9 Jun 2016 01:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301713 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 01:50:44 -0000 Author: sjg Date: Thu Jun 9 01:50:43 2016 New Revision: 301713 URL: https://svnweb.freebsd.org/changeset/base/301713 Log: Add a prototype for random_harvest_queue to dev/random/random_harvestq.h This fixes a warning that occurs in a number of files that use the random_harvest_queue function. Differential Revision: https://reviews.freebsd.org/D4229 Submitted by: stevek@juniper.net Reviewed by: markm Approved by: so Modified: head/sys/dev/random/random_harvestq.h Modified: head/sys/dev/random/random_harvestq.h ============================================================================== --- head/sys/dev/random/random_harvestq.h Thu Jun 9 01:31:09 2016 (r301712) +++ head/sys/dev/random/random_harvestq.h Thu Jun 9 01:50:43 2016 (r301713) @@ -43,7 +43,9 @@ struct harvest_event { uint8_t he_source; /* origin of the entropy */ } __packed; -void read_rate_increment(u_int); +void random_harvest_queue(const void *, u_int, u_int, + enum random_entropy_source); +void read_rate_increment(u_int); #define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" From owner-svn-src-all@freebsd.org Thu Jun 9 02:02:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 056B7B6EEC5; Thu, 9 Jun 2016 02:02:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C95E91520; Thu, 9 Jun 2016 02:02:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5922p4h024437; Thu, 9 Jun 2016 02:02:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5922pwl024436; Thu, 9 Jun 2016 02:02:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201606090202.u5922pwl024436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 9 Jun 2016 02:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301714 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 02:02:52 -0000 Author: manu Date: Thu Jun 9 02:02:50 2016 New Revision: 301714 URL: https://svnweb.freebsd.org/changeset/base/301714 Log: Print a message when the efi disk isn't a logical partition. Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D6782 Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Thu Jun 9 01:50:43 2016 (r301713) +++ head/sys/boot/efi/libefi/efipart.c Thu Jun 9 02:02:50 2016 (r301714) @@ -119,8 +119,11 @@ efipart_init(void) (void**)&blkio); if (EFI_ERROR(status)) continue; - if (!blkio->Media->LogicalPartition) + if (!blkio->Media->LogicalPartition) { + printf("%s%d isn't a logical partition, skipping\n", + efipart_dev.dv_name, n); continue; + } /* * If we come across a logical partition of subtype CDROM From owner-svn-src-all@freebsd.org Thu Jun 9 02:18:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75197B6E2DD; Thu, 9 Jun 2016 02:18:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56AC91D82; Thu, 9 Jun 2016 02:18:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [137.122.64.52]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EB760B94C; Wed, 8 Jun 2016 22:18:16 -0400 (EDT) Subject: Re: svn commit: r301562 - head/sys/dev/acpica To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606071908.u57J8EZI011734@repo.freebsd.org> From: John Baldwin Message-ID: <1038ce21-2441-06f0-b849-4c4eab1c3b0e@FreeBSD.org> Date: Wed, 8 Jun 2016 22:18:15 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606071908.u57J8EZI011734@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 08 Jun 2016 22:18:17 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 02:18:18 -0000 On 6/7/16 3:08 PM, Conrad E. Meyer wrote: > Author: cem > Date: Tue Jun 7 19:08:13 2016 > New Revision: 301562 > URL: https://svnweb.freebsd.org/changeset/base/301562 > > Log: > Fix a minor leak in ACPI thermal > > Introduced in r301518. > > Reported by: Coverity > CID: 1356266 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/acpica/acpi_thermal.c > > Modified: head/sys/dev/acpica/acpi_thermal.c > ============================================================================== > --- head/sys/dev/acpica/acpi_thermal.c Tue Jun 7 18:50:36 2016 (r301561) > +++ head/sys/dev/acpica/acpi_thermal.c Tue Jun 7 19:08:13 2016 (r301562) > @@ -335,8 +335,10 @@ acpi_tz_startup(void *arg __unused) > int devcount, error, i; > > devclass_get_devices(acpi_tz_devclass, &devs, &devcount); > - if (devcount == 0) > + if (devcount == 0) { > + free(devs, M_TEMP); > return; > + } Ugh, I assumed we didn't return anything for a count of zero. I kind of think it's a bug that we return malloc(0) instead of NULL in that case. Looks like if malloc fails devclass_get_devices() doesn't set 'dev' or 'devcount' at all. We need to fail if it returns non-zero. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Jun 9 02:21:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2194B6E4E3; Thu, 9 Jun 2016 02:21:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C7051FBD; Thu, 9 Jun 2016 02:21:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u592L7Ak028433; Thu, 9 Jun 2016 02:21:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u592L76C028431; Thu, 9 Jun 2016 02:21:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606090221.u592L76C028431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 Jun 2016 02:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301715 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 02:21:08 -0000 Author: jhb Date: Thu Jun 9 02:21:07 2016 New Revision: 301715 URL: https://svnweb.freebsd.org/changeset/base/301715 Log: Add support for truss'ing Linux/x86_64 binaries under amd64. Prodding by: xmj Added: head/usr.bin/truss/amd64-linux.c (contents, props changed) Modified: head/usr.bin/truss/Makefile Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Thu Jun 9 02:02:50 2016 (r301714) +++ head/usr.bin/truss/Makefile Thu Jun 9 02:21:07 2016 (r301715) @@ -18,6 +18,7 @@ ABIS+= cloudabi64 ABIS+= i386-linux .endif .if ${MACHINE_CPUARCH} == "amd64" +ABIS+= amd64-linux ABIS+= amd64-linux32 ABIS+= freebsd32 ABIS+= cloudabi64 Added: head/usr.bin/truss/amd64-linux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/truss/amd64-linux.c Thu Jun 9 02:21:07 2016 (r301715) @@ -0,0 +1,104 @@ +/* + * Copyright 1997 Sean Eric Fagan + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Sean Eric Fagan + * 4. Neither the name of the author may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * 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$"); + +/* Linux/x86_64-specific system call handling. */ + +#include + +#include +#include + +#include +#include + +#include "truss.h" + +static int +amd64_linux_fetch_args(struct trussinfo *trussinfo, u_int narg) +{ + struct reg regs; + struct current_syscall *cs; + lwpid_t tid; + + tid = trussinfo->curthread->tid; + cs = &trussinfo->curthread->cs; + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return (-1); + } + + switch (narg) { + default: + cs->args[5] = regs.r_r9; + case 5: + cs->args[4] = regs.r_r8; + case 4: + cs->args[3] = regs.r_rcx; + case 3: + cs->args[2] = regs.r_rdx; + case 2: + cs->args[1] = regs.r_rsi; + case 1: + cs->args[0] = regs.r_rdi; + } + + return (0); +} + +static int +amd64_linux_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp) +{ + struct reg regs; + lwpid_t tid; + + tid = trussinfo->curthread->tid; + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return (-1); + } + + retval[0] = regs.r_rax; + retval[1] = regs.r_rdx; + *errorp = !!(regs.r_rflags & PSL_C); + return (0); +} + +static struct procabi amd64_linux = { + "Linux ELF64", + SYSDECODE_ABI_LINUX, + amd64_linux_fetch_args, + amd64_linux_fetch_retval +}; + +PROCABI(amd64_linux); From owner-svn-src-all@freebsd.org Thu Jun 9 02:21:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BF2EB6E572 for ; Thu, 9 Jun 2016 02:21:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F63511A7 for ; Thu, 9 Jun 2016 02:21:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id m62so26244055iof.0 for ; Wed, 08 Jun 2016 19:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dWC3m1rDQo2/NcPjwHWuTCK3Xcp4kUx1gBoQD1sLZpI=; b=Taf55WRKnp95gTaZSTMKpybqNhxCgzm6pTpsEf931etxMyt3iJ13GtbmzrTE86nAr+ iEe3zGcNUOzq/IxX6RN3oYjjcBf1h7NBClqwRsy4TWbPi8CW1dEykvx4gSouRiRA/SM/ AoIfIEjJEHN0bnNvcb6iwUysv+TsdclTlsML4J7g9bya+Wkd1puz1lNKEnoGbCUH1L/a eE9ExFYZgtlpdhf+YhCATY58qCDzzPKeSQEehoAG/puvazScQrD3PV76cE9yQDoQct5h 1oJh51uHPvVWnTC/A9xOCifBxBzxzU4iP1dZ2ikApK2IHXjj74Eymi4j5Wo1U+5s/8RH AWfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dWC3m1rDQo2/NcPjwHWuTCK3Xcp4kUx1gBoQD1sLZpI=; b=f1nH6R2L6phNdCcuv8doxb0ZW2bZt3IzakJNd0CGND4nrPV9bO+F8TKmL9QqCEecRe oRbDq9BUhznbZsot3Bs9KolGGws14QJfTz1VQVZFSKHsyoIAGu3Ioh0qDxoJKlUHSqO3 v+IqGaBk56bB5ulXl/ctwnHeZVPRy90gAN+3iDbpaLk+lp1Jde+OnBb54Z63WAi5DL5I 8WZdFFDiMSwOwC43cMEqq9q0WPBawzsj1tf/OesdpYfN2uLkFMnd41pCstMcSlMDT3b7 G8lnpPQgXnkP6QaesQIiGlJQ49G1crz2OWk9H0MuisW1mMkWKmRaHW2M1NDMQcNLvcFp Zc2g== X-Gm-Message-State: ALyK8tJkfZgllHs83afnnFnd/vFVuiM+k5WHHxC1vDItnXTD1/mvgiFY5BlJfRfwi3VCWg== X-Received: by 10.107.140.6 with SMTP id o6mr8539838iod.42.1465438898561; Wed, 08 Jun 2016 19:21:38 -0700 (PDT) Received: from [172.17.66.143] (69-165-177-132.dsl.teksavvy.com. [69.165.177.132]) by smtp.gmail.com with ESMTPSA id b71sm2151465itd.14.2016.06.08.19.21.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 19:21:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r301714 - head/sys/boot/efi/libefi From: Warner Losh In-Reply-To: <201606090202.u5922pwl024436@repo.freebsd.org> Date: Wed, 8 Jun 2016 22:21:36 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <90D3441D-D130-4D00-A12D-F4D3B81E606B@bsdimp.com> References: <201606090202.u5922pwl024436@repo.freebsd.org> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 02:21:39 -0000 > On Jun 8, 2016, at 10:02 PM, Emmanuel Vadot wrote: >=20 > Author: manu > Date: Thu Jun 9 02:02:50 2016 > New Revision: 301714 > URL: https://svnweb.freebsd.org/changeset/base/301714 >=20 > Log: > Print a message when the efi disk isn't a logical partition. Why on earth would you do that? This will print a message, one per full = disk, and our systems have 36 disks in them=E2=80=A6 Please consider backing this out... Warner > Approved by: andrew (mentor) > Differential Revision: https://reviews.freebsd.org/D6782 >=20 > Modified: > head/sys/boot/efi/libefi/efipart.c >=20 > Modified: head/sys/boot/efi/libefi/efipart.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/boot/efi/libefi/efipart.c Thu Jun 9 01:50:43 2016 = (r301713) > +++ head/sys/boot/efi/libefi/efipart.c Thu Jun 9 02:02:50 2016 = (r301714) > @@ -119,8 +119,11 @@ efipart_init(void)=20 > (void**)&blkio); > if (EFI_ERROR(status)) > continue; > - if (!blkio->Media->LogicalPartition) > + if (!blkio->Media->LogicalPartition) { > + printf("%s%d isn't a logical partition, = skipping\n", > + efipart_dev.dv_name, n); > continue; > + } >=20 > /* > * If we come across a logical partition of subtype = CDROM >=20 From owner-svn-src-all@freebsd.org Thu Jun 9 02:30:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B762EB6E7BC for ; Thu, 9 Jun 2016 02:30:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80EB81734 for ; Thu, 9 Jun 2016 02:30:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id z123so24447255itg.0 for ; Wed, 08 Jun 2016 19:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=e9RWyhf/iGyB/7Ycbixq5mdKdxS/shVQzeszn82IS7I=; b=mpQ4/QOb7mQgCsx5AiS6oDT2/Ki66h7SRMTIg+iAapxFd95TTfDJy4iXUNhpWDJfHW Ip0Tl6iMzXJBPF/f6kW8QbRVU3zmqDFjRnzyRj1M7NqO35nCFydgra0eqwCFIA7bSgaU 55zrSXMXuC+zCmtoyejQh94TpyI5aQGKM4t9QYb+u2X4lqULuYqJCLa1woVZ0WW6XK0Z SCu1uOYdCJyOeLQhAVL1wVKfe2HYQjpdlohaj0lHPI4Ghp65RxToGAfHt6aTblxiw5/g aI/O9CJ8e3dcZXsZiO+T2DHOxuxeNNsyXTt2BG97vr8/Z2gSc+7r/U2Zs+0uvaYEtBX5 kiUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=e9RWyhf/iGyB/7Ycbixq5mdKdxS/shVQzeszn82IS7I=; b=ewyWxee3C8Mh7WJODQFjhO1rxsKnm3P51nmYQg4dn97kfWOqK81XvQF9W3lj4Wh/7b AZX4if5DnJ5IhLaSSVTuEy7G6l/8XQX0Y2zMCVEhlRNteqgs87+LVlBd9Cfjq800LvIa 5lxnQiqEwsg0ZMb6UOm1uYRcUHBJ+mQ5JNUQQkOCNdWnqUtT/fyXd+cHx/vVD+lJS9ck pgYW+trAU4u0hx7mPz5ZWT/EFvj93tL+8vjl587VqrbZyPWxlfaZBjXsE8dGK7k1A0of wV//66lOB8a3CcebXCSznNuT4Qd0ZN10I80TCT8D6Kd7fPmXPb5khjzpRJbX9oRITvyr ER+g== X-Gm-Message-State: ALyK8tKWAXbowEASrpqrTi3vbzmT+z0hu7t4uRaOoEEbiQbiBors0Id7tgqbcrQD7HOnfw== X-Received: by 10.36.184.130 with SMTP id m124mr18495319ite.95.1465439416969; Wed, 08 Jun 2016 19:30:16 -0700 (PDT) Received: from [172.17.66.143] (69-165-177-132.dsl.teksavvy.com. [69.165.177.132]) by smtp.gmail.com with ESMTPSA id g18sm12316084ita.8.2016.06.08.19.30.15 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 19:30:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r301706 - head/sys/boot/efi From: Warner Losh In-Reply-To: <201606082323.u58NNGsP065228@repo.freebsd.org> Date: Wed, 8 Jun 2016 22:30:15 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201606082323.u58NNGsP065228@repo.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 02:30:17 -0000 > On Jun 8, 2016, at 7:23 PM, Andrew Turner wrote: >=20 > Author: andrew > Date: Wed Jun 8 23:23:16 2016 > New Revision: 301706 > URL: https://svnweb.freebsd.org/changeset/base/301706 >=20 > Log: > Also set -fshort-wchar on arm64, this fixes parsing strings from = UEFI, > e.g. on the command line. Maybe this could be used to fix the %S issue instead of the kludge = we=E2=80=99re now doing=E2=80=A6 Warner > Sponsored by: ABT Systems Ltd >=20 > Modified: > head/sys/boot/efi/Makefile.inc >=20 > Modified: head/sys/boot/efi/Makefile.inc > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/efi/Makefile.inc Wed Jun 8 23:22:59 2016 = (r301705) > +++ head/sys/boot/efi/Makefile.inc Wed Jun 8 23:23:16 2016 = (r301706) > @@ -18,4 +18,8 @@ CFLAGS+=3D -mno-red-zone > CFLAGS+=3D -mno-aes > .endif >=20 > +.if ${MACHINE_CPUARCH} =3D=3D "aarch64" > +CFLAGS+=3D -fshort-wchar > +.endif > + > .include "../Makefile.inc" >=20 From owner-svn-src-all@freebsd.org Thu Jun 9 03:54:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A59A9B6E0FB; Thu, 9 Jun 2016 03:54:26 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75DFE1BD3; Thu, 9 Jun 2016 03:54:26 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u593sPAV066059; Thu, 9 Jun 2016 03:54:25 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u593sPgr066058; Thu, 9 Jun 2016 03:54:25 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201606090354.u593sPgr066058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Thu, 9 Jun 2016 03:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301716 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 03:54:26 -0000 Author: cperciva Date: Thu Jun 9 03:54:25 2016 New Revision: 301716 URL: https://svnweb.freebsd.org/changeset/base/301716 Log: Add 'env - PATH=$$PATH' to bsdec2-image-upload make command, in order to avoid environment pollution problems. That port uses but is not compatible with the latest mk bits in HEAD. Reported by: gjb No rush, but make sure it's in the tree before tomorrow by: gjb Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Thu Jun 9 02:21:07 2016 (r301715) +++ head/release/Makefile.ec2 Thu Jun 9 03:54:25 2016 (r301716) @@ -23,7 +23,7 @@ CW_EC2_PORTINSTALL= cw-ec2-portinstall: .if exists(${PORTSDIR}/net/bsdec2-image-upload/Makefile) - make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean + env - PATH=$$PATH make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean .else . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -y From owner-svn-src-all@freebsd.org Thu Jun 9 05:48:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACFE3B70B41; Thu, 9 Jun 2016 05:48:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2B710CE; Thu, 9 Jun 2016 05:48:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u595mZVS005963; Thu, 9 Jun 2016 05:48:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u595mYm5005952; Thu, 9 Jun 2016 05:48:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201606090548.u595mYm5005952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 9 Jun 2016 05:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301717 - in head/sys: modules/tcp/fastpath netinet netinet/tcp_stacks netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 05:48:36 -0000 Author: ae Date: Thu Jun 9 05:48:34 2016 New Revision: 301717 URL: https://svnweb.freebsd.org/changeset/base/301717 Log: Cleanup unneded include "opt_ipfw.h". It was used for conditional build IPFIREWALL_FORWARD support. But IPFIREWALL_FORWARD option was removed a long time ago. Modified: head/sys/modules/tcp/fastpath/Makefile head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/fastpath.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/udp6_usrreq.c Modified: head/sys/modules/tcp/fastpath/Makefile ============================================================================== --- head/sys/modules/tcp/fastpath/Makefile Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/modules/tcp/fastpath/Makefile Thu Jun 9 05:48:34 2016 (r301717) @@ -7,7 +7,7 @@ KMOD= fastpath SRCS= fastpath.c -SRCS+= opt_ipfw.h opt_inet.h opt_inet6.h opt_ipsec.h +SRCS+= opt_inet.h opt_inet6.h opt_ipsec.h SRCS+= opt_tcpdebug.h # Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet/ip_fastfwd.c Thu Jun 9 05:48:34 2016 (r301717) @@ -76,7 +76,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_ipfw.h" #include "opt_ipstealth.h" #include Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet/ip_input.c Thu Jun 9 05:48:34 2016 (r301717) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_bootp.h" -#include "opt_ipfw.h" #include "opt_ipstealth.h" #include "opt_ipsec.h" #include "opt_route.h" Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet/ip_output.c Thu Jun 9 05:48:34 2016 (r301717) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_mbuf_stress_test.h" #include "opt_mpath.h" Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet/tcp_input.c Thu Jun 9 05:48:34 2016 (r301717) @@ -50,7 +50,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_ipfw.h" /* for ipfw_fwd */ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Jun 9 05:48:34 2016 (r301717) @@ -54,7 +54,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_ipfw.h" /* for ipfw_fwd */ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet/udp_usrreq.c Thu Jun 9 05:48:34 2016 (r301717) @@ -39,7 +39,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_ipfw.h" #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet6/ip6_forward.c Thu Jun 9 05:48:34 2016 (r301717) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_ipstealth.h" Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet6/ip6_input.c Thu Jun 9 05:48:34 2016 (r301717) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_route.h" #include "opt_rss.h" Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet6/ip6_output.c Thu Jun 9 05:48:34 2016 (r301717) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_sctp.h" #include "opt_route.h" Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Jun 9 03:54:25 2016 (r301716) +++ head/sys/netinet6/udp6_usrreq.c Thu Jun 9 05:48:34 2016 (r301717) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipfw.h" #include "opt_ipsec.h" #include "opt_rss.h" From owner-svn-src-all@freebsd.org Thu Jun 9 06:10:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EEA8B70EC8; Thu, 9 Jun 2016 06:10:22 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0371AE2; Thu, 9 Jun 2016 06:10:22 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u596ALa8013245; Thu, 9 Jun 2016 06:10:21 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u596AKv0013231; Thu, 9 Jun 2016 06:10:20 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201606090610.u596AKv0013231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Thu, 9 Jun 2016 06:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301718 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 06:10:22 -0000 Author: jasone Date: Thu Jun 9 06:10:20 2016 New Revision: 301718 URL: https://svnweb.freebsd.org/changeset/base/301718 Log: Update jemalloc to 4.2.1. Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_mmap.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/nstime.c Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/ChangeLog Thu Jun 9 06:10:20 2016 (r301718) @@ -4,6 +4,17 @@ brevity. Much more detail can be found https://github.com/jemalloc/jemalloc +* 4.2.1 (June 8, 2016) + + Bug fixes: + - Fix bootstrapping issues for configurations that require allocation during + tsd initialization (e.g. --disable-tls). (@cferris1000, @jasone) + - Fix gettimeofday() version of nstime_update(). (@ronawho) + - Fix Valgrind regressions in calloc() and chunk_alloc_wrapper(). (@ronawho) + - Fix potential VM map fragmentation regression. (@jasone) + - Fix opt_zero-triggered in-place huge reallocation zeroing. (@jasone) + - Fix heap profiling context leaks in reallocation edge cases. (@jasone) + * 4.2.0 (May 12, 2016) New features: Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/FREEBSD-diffs Thu Jun 9 06:10:20 2016 (r301718) @@ -79,7 +79,7 @@ index b1de2b6..da6b6d2 100644 JEMALLOC_ALWAYS_INLINE size_t diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index 51bf897..7de22ea 100644 +index 8f82edd..78e2df2 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -8,6 +8,9 @@ @@ -335,7 +335,7 @@ index f943891..47d032c 100755 +#include "jemalloc_FreeBSD.h" EOF diff --git a/src/jemalloc.c b/src/jemalloc.c -index 40eb2ea..666c49d 100644 +index 5d1f493..46dd1d1 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -4,6 +4,10 @@ Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/VERSION Thu Jun 9 06:10:20 2016 (r301718) @@ -1 +1 @@ -4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc +4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/doc/jemalloc.3 Thu Jun 9 06:10:20 2016 (r301718) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 05/12/2016 +.\" Date: 06/08/2016 .\" Manual: User Manual -.\" Source: jemalloc 4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc +.\" Source: jemalloc 4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8 .\" Language: English .\" -.TH "JEMALLOC" "3" "05/12/2016" "jemalloc 4.2.0-1-gdc7ff6306d7a" "User Manual" +.TH "JEMALLOC" "3" "06/08/2016" "jemalloc 4.2.1-0-g3de035335255" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 4\&.2\&.0\-1\-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc\&. More information can be found at the +This manual describes jemalloc 4\&.2\&.1\-0\-g3de035335255d553bdb344c32ffdb603816195d8\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Thu Jun 9 06:10:20 2016 (r301718) @@ -751,7 +751,7 @@ sa2u(size_t size, size_t alignment) * Calculate the size of the over-size run that arena_palloc() * would need to allocate in order to guarantee the alignment. */ - if (usize + large_pad + alignment <= arena_maxrun) + if (usize + large_pad + alignment - PAGE <= arena_maxrun) return (usize); } @@ -781,7 +781,7 @@ sa2u(size_t size, size_t alignment) * Calculate the multi-chunk mapping that huge_palloc() would need in * order to guarantee the alignment. */ - if (usize + alignment < usize) { + if (usize + alignment - PAGE < usize) { /* size_t overflow. */ return (0); } Modified: head/contrib/jemalloc/include/jemalloc/internal/prof.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/prof.h Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/include/jemalloc/internal/prof.h Thu Jun 9 06:10:20 2016 (r301718) @@ -513,6 +513,7 @@ prof_realloc(tsd_t *tsd, const void *ptr * though its actual usize was insufficient to cross the * sample threshold. */ + prof_alloc_rollback(tsd, tctx, true); tctx = (prof_tctx_t *)(uintptr_t)1U; } } Modified: head/contrib/jemalloc/include/jemalloc/jemalloc.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc.h Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/include/jemalloc/jemalloc.h Thu Jun 9 06:10:20 2016 (r301718) @@ -87,12 +87,12 @@ extern "C" { #include #include -#define JEMALLOC_VERSION "4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc" +#define JEMALLOC_VERSION "4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8" #define JEMALLOC_VERSION_MAJOR 4 #define JEMALLOC_VERSION_MINOR 2 -#define JEMALLOC_VERSION_BUGFIX 0 -#define JEMALLOC_VERSION_NREV 1 -#define JEMALLOC_VERSION_GID "dc7ff6306d7a15b53479e2fb8e5546404b82e6fc" +#define JEMALLOC_VERSION_BUGFIX 1 +#define JEMALLOC_VERSION_NREV 0 +#define JEMALLOC_VERSION_GID "3de035335255d553bdb344c32ffdb603816195d8" # define MALLOCX_LG_ALIGN(la) ((int)(la)) # if LG_SIZEOF_PTR == 2 Modified: head/contrib/jemalloc/src/arena.c ============================================================================== --- head/contrib/jemalloc/src/arena.c Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/src/arena.c Thu Jun 9 06:10:20 2016 (r301718) @@ -2687,7 +2687,7 @@ arena_palloc_large(tsdn_t *tsdn, arena_t return (NULL); alignment = PAGE_CEILING(alignment); - alloc_size = usize + large_pad + alignment; + alloc_size = usize + large_pad + alignment - PAGE; malloc_mutex_lock(tsdn, &arena->lock); run = arena_run_alloc_large(tsdn, arena, alloc_size, false); Modified: head/contrib/jemalloc/src/chunk.c ============================================================================== --- head/contrib/jemalloc/src/chunk.c Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/src/chunk.c Thu Jun 9 06:10:20 2016 (r301718) @@ -421,15 +421,11 @@ chunk_arena_get(tsdn_t *tsdn, unsigned a } static void * -chunk_alloc_default(void *new_addr, size_t size, size_t alignment, bool *zero, - bool *commit, unsigned arena_ind) +chunk_alloc_default_impl(tsdn_t *tsdn, arena_t *arena, void *new_addr, + size_t size, size_t alignment, bool *zero, bool *commit) { void *ret; - tsdn_t *tsdn; - arena_t *arena; - tsdn = tsdn_fetch(); - arena = chunk_arena_get(tsdn, arena_ind); ret = chunk_alloc_core(tsdn, arena, new_addr, size, alignment, zero, commit, arena->dss_prec); if (ret == NULL) @@ -441,6 +437,20 @@ chunk_alloc_default(void *new_addr, size } static void * +chunk_alloc_default(void *new_addr, size_t size, size_t alignment, bool *zero, + bool *commit, unsigned arena_ind) +{ + tsdn_t *tsdn; + arena_t *arena; + + tsdn = tsdn_fetch(); + arena = chunk_arena_get(tsdn, arena_ind); + + return (chunk_alloc_default_impl(tsdn, arena, new_addr, size, alignment, + zero, commit)); +} + +static void * chunk_alloc_retained(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks, void *new_addr, size_t size, size_t alignment, bool *zero, bool *commit) { @@ -472,14 +482,23 @@ chunk_alloc_wrapper(tsdn_t *tsdn, arena_ ret = chunk_alloc_retained(tsdn, arena, chunk_hooks, new_addr, size, alignment, zero, commit); if (ret == NULL) { - ret = chunk_hooks->alloc(new_addr, size, alignment, zero, - commit, arena->ind); + if (chunk_hooks->alloc == chunk_alloc_default) { + /* Call directly to propagate tsdn. */ + ret = chunk_alloc_default_impl(tsdn, arena, new_addr, + size, alignment, zero, commit); + } else { + ret = chunk_hooks->alloc(new_addr, size, alignment, + zero, commit, arena->ind); + } + if (ret == NULL) return (NULL); + + if (config_valgrind && chunk_hooks->alloc != + chunk_alloc_default) + JEMALLOC_VALGRIND_MAKE_MEM_UNDEFINED(ret, chunksize); } - if (config_valgrind && chunk_hooks->alloc != chunk_alloc_default) - JEMALLOC_VALGRIND_MAKE_MEM_UNDEFINED(ret, chunksize); return (ret); } @@ -591,19 +610,30 @@ chunk_dalloc_cache(tsdn_t *tsdn, arena_t } static bool -chunk_dalloc_default(void *chunk, size_t size, bool committed, - unsigned arena_ind) +chunk_dalloc_default_impl(tsdn_t *tsdn, void *chunk, size_t size) { - if (!have_dss || !chunk_in_dss(tsdn_fetch(), chunk)) + if (!have_dss || !chunk_in_dss(tsdn, chunk)) return (chunk_dalloc_mmap(chunk, size)); return (true); } +static bool +chunk_dalloc_default(void *chunk, size_t size, bool committed, + unsigned arena_ind) +{ + tsdn_t *tsdn; + + tsdn = tsdn_fetch(); + + return (chunk_dalloc_default_impl(tsdn, chunk, size)); +} + void chunk_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena, chunk_hooks_t *chunk_hooks, void *chunk, size_t size, bool zeroed, bool committed) { + bool err; assert(chunk != NULL); assert(CHUNK_ADDR2BASE(chunk) == chunk); @@ -612,7 +642,13 @@ chunk_dalloc_wrapper(tsdn_t *tsdn, arena chunk_hooks_assure_initialized(tsdn, arena, chunk_hooks); /* Try to deallocate. */ - if (!chunk_hooks->dalloc(chunk, size, committed, arena->ind)) + if (chunk_hooks->dalloc == chunk_dalloc_default) { + /* Call directly to propagate tsdn. */ + err = chunk_dalloc_default_impl(tsdn, chunk, size); + } else + err = chunk_hooks->dalloc(chunk, size, committed, arena->ind); + + if (!err) return; /* Try to decommit; purge if that fails. */ if (committed) { @@ -681,26 +717,34 @@ chunk_split_default(void *chunk, size_t } static bool -chunk_merge_default(void *chunk_a, size_t size_a, void *chunk_b, size_t size_b, - bool committed, unsigned arena_ind) +chunk_merge_default_impl(tsdn_t *tsdn, void *chunk_a, void *chunk_b) { if (!maps_coalesce) return (true); - if (have_dss) { - tsdn_t *tsdn = tsdn_fetch(); - if (chunk_in_dss(tsdn, chunk_a) != chunk_in_dss(tsdn, chunk_b)) - return (true); - } + if (have_dss && chunk_in_dss(tsdn, chunk_a) != chunk_in_dss(tsdn, + chunk_b)) + return (true); return (false); } +static bool +chunk_merge_default(void *chunk_a, size_t size_a, void *chunk_b, size_t size_b, + bool committed, unsigned arena_ind) +{ + tsdn_t *tsdn; + + tsdn = tsdn_fetch(); + + return (chunk_merge_default_impl(tsdn, chunk_a, chunk_b)); +} + static rtree_node_elm_t * chunks_rtree_node_alloc(size_t nelms) { - return ((rtree_node_elm_t *)base_alloc(tsdn_fetch(), nelms * + return ((rtree_node_elm_t *)base_alloc(TSDN_NULL, nelms * sizeof(rtree_node_elm_t))); } Modified: head/contrib/jemalloc/src/chunk_mmap.c ============================================================================== --- head/contrib/jemalloc/src/chunk_mmap.c Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/src/chunk_mmap.c Thu Jun 9 06:10:20 2016 (r301718) @@ -9,7 +9,7 @@ chunk_alloc_mmap_slow(size_t size, size_ void *ret; size_t alloc_size; - alloc_size = size + alignment; + alloc_size = size + alignment - PAGE; /* Beware size_t wrap-around. */ if (alloc_size < size) return (NULL); Modified: head/contrib/jemalloc/src/huge.c ============================================================================== --- head/contrib/jemalloc/src/huge.c Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/src/huge.c Thu Jun 9 06:10:20 2016 (r301718) @@ -262,19 +262,19 @@ huge_ralloc_no_move_expand(tsdn_t *tsdn, malloc_mutex_unlock(tsdn, &arena->huge_mtx); /* - * Copy zero into is_zeroed_chunk and pass the copy to chunk_alloc(), so - * that it is possible to make correct junk/zero fill decisions below. + * Use is_zeroed_chunk to detect whether the trailing memory is zeroed, + * update extent's zeroed field, and zero as necessary. */ - is_zeroed_chunk = zero; - + is_zeroed_chunk = false; if (arena_chunk_ralloc_huge_expand(tsdn, arena, ptr, oldsize, usize, &is_zeroed_chunk)) return (true); malloc_mutex_lock(tsdn, &arena->huge_mtx); - /* Update the size of the huge allocation. */ huge_node_unset(ptr, node); extent_node_size_set(node, usize); + extent_node_zeroed_set(node, extent_node_zeroed_get(node) && + is_zeroed_chunk); huge_node_reset(tsdn, ptr, node); malloc_mutex_unlock(tsdn, &arena->huge_mtx); Modified: head/contrib/jemalloc/src/jemalloc.c ============================================================================== --- head/contrib/jemalloc/src/jemalloc.c Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/src/jemalloc.c Thu Jun 9 06:10:20 2016 (r301718) @@ -1743,7 +1743,7 @@ je_calloc(size_t num, size_t size) ret = ialloc_body(num_size, true, &tsdn, &usize, true); ialloc_post_check(ret, tsdn, usize, "calloc", true, true); UTRACE(0, num_size, ret); - JEMALLOC_VALGRIND_MALLOC(ret != NULL, tsdn, ret, usize, false); + JEMALLOC_VALGRIND_MALLOC(ret != NULL, tsdn, ret, usize, true); } return (ret); @@ -2226,7 +2226,7 @@ irallocx_prof(tsd_t *tsd, void *old_ptr, prof_active = prof_active_get_unlocked(); old_tctx = prof_tctx_get(tsd_tsdn(tsd), old_ptr); - tctx = prof_alloc_prep(tsd, *usize, prof_active, true); + tctx = prof_alloc_prep(tsd, *usize, prof_active, false); if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) { p = irallocx_prof_sample(tsd, old_ptr, old_usize, *usize, alignment, zero, tcache, arena, tctx); @@ -2235,7 +2235,7 @@ irallocx_prof(tsd_t *tsd, void *old_ptr, tcache, arena); } if (unlikely(p == NULL)) { - prof_alloc_rollback(tsd, tctx, true); + prof_alloc_rollback(tsd, tctx, false); return (NULL); } @@ -2250,7 +2250,7 @@ irallocx_prof(tsd_t *tsd, void *old_ptr, */ *usize = isalloc(tsd_tsdn(tsd), p, config_prof); } - prof_realloc(tsd, p, *usize, tctx, prof_active, true, old_ptr, + prof_realloc(tsd, p, *usize, tctx, prof_active, false, old_ptr, old_usize, old_tctx); return (p); Modified: head/contrib/jemalloc/src/nstime.c ============================================================================== --- head/contrib/jemalloc/src/nstime.c Thu Jun 9 05:48:34 2016 (r301717) +++ head/contrib/jemalloc/src/nstime.c Thu Jun 9 06:10:20 2016 (r301718) @@ -128,9 +128,11 @@ nstime_update(nstime_t *time) time->ns = ts.tv_sec * BILLION + ts.tv_nsec; } #else - struct timeval tv; - gettimeofday(&tv, NULL); - time->ns = tv.tv_sec * BILLION + tv.tv_usec * 1000; + { + struct timeval tv; + gettimeofday(&tv, NULL); + time->ns = tv.tv_sec * BILLION + tv.tv_usec * 1000; + } #endif /* Handle non-monotonic clocks. */ From owner-svn-src-all@freebsd.org Thu Jun 9 06:55:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D4B7B6BD40; Thu, 9 Jun 2016 06:55:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF74D11D7; Thu, 9 Jun 2016 06:55:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u596t2nh031785; Thu, 9 Jun 2016 06:55:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u596t0f5031770; Thu, 9 Jun 2016 06:55:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606090655.u596t0f5031770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Jun 2016 06:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301719 - in head/share/man: man4 man5 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 06:55:03 -0000 Author: trasz Date: Thu Jun 9 06:55:00 2016 New Revision: 301719 URL: https://svnweb.freebsd.org/changeset/base/301719 Log: Fix a bunch of "xref refers to *this* page" igor(1) warnings. MFC after: 1 month Modified: head/share/man/man4/bcma.4 head/share/man/man4/dcons.4 head/share/man/man4/ip.4 head/share/man/man4/ng_tag.4 head/share/man/man4/pass.4 head/share/man/man4/puc.4 head/share/man/man4/random.4 head/share/man/man4/witness.4 head/share/man/man5/ar.5 head/share/man/man5/elf.5 head/share/man/man5/nsswitch.conf.5 head/share/man/man5/rc.conf.5 head/share/man/man9/BUS_NEW_PASS.9 head/share/man/man9/pmap.9 head/share/man/man9/stack.9 Modified: head/share/man/man4/bcma.4 ============================================================================== --- head/share/man/man4/bcma.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/bcma.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -64,7 +64,6 @@ The IP cores used in devices were adapted by Broadcom for compatibility with the new interconnect. .Sh SEE ALSO -.Xr bcma 4 , .Xr bhnd 4 .Sh HISTORY The Modified: head/share/man/man4/dcons.4 ============================================================================== --- head/share/man/man4/dcons.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/dcons.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -100,7 +100,7 @@ See for more details. .Pp If you want to use -.Xr dcons 4 +.Nm as a .Xr gdb 1 port, add the following line into Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/ip.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -122,7 +122,7 @@ may be used to set the Don't Fragment fl Currently this option is respected only on .Xr udp 4 and raw -.Xr ip 4 +.Nm sockets, unless the .Dv IP_HDRINCL option has been set. Modified: head/share/man/man4/ng_tag.4 ============================================================================== --- head/share/man/man4/ng_tag.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/ng_tag.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -230,7 +230,7 @@ node which will check for the specified packets to .Xr ipfw 8 . Matching packets are passed to -.Xr ng_tag 4 +.Nm node, which will set a tag and pass them back to .Xr ng_bpf 4 node on a hook programmed to accept all packets and pass them back to @@ -246,7 +246,7 @@ expressions must be altered accordingly. Thus, there will be expression .Dq Li "ether[40:2]=0x244c && ether[42:4]=0x6f636b20" on incoming hook and empty expression to match all packets from -.Xr ng_tag 4 . +.Nm . .Pp So, this is .Xr ngctl 8 Modified: head/share/man/man4/pass.4 ============================================================================== --- head/share/man/man4/pass.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/pass.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -98,7 +98,7 @@ It is probably more useful to issue this device. .It CAMIOQUEUE union ccb * Queue a CCB to the -.Xr pass 4 +.Nm driver to be executed asynchronously. The caller may use .Xr select 2 , @@ -167,7 +167,7 @@ ioctl. An error will only be returned from the .Dv CAMIOGET ioctl if the -.Xr pass 4 +.Nm driver fails to copy data to the user process or if there are no completed CCBs available to retrieve. If no CCBs are available to retrieve, Modified: head/share/man/man4/puc.4 ============================================================================== --- head/share/man/man4/puc.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/puc.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -53,5 +53,5 @@ Support for new cards should be added th .Sh HISTORY This driver took the idea from the .Nx -.Xr puc 4 +.Nm driver. Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/random.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -48,7 +48,7 @@ it is seeded for the first time. This may cause trouble at system boot when keys and the like are generated from -.Xr random 4 +.Nm so steps should be taken to ensure a seeding as soon as possible. .Pp @@ -63,7 +63,7 @@ this could be done by This sysctl will not return random bytes unless the -.Xr random 4 +.Nm device is seeded. .Pp This initial seeding Modified: head/share/man/man4/witness.4 ============================================================================== --- head/share/man/man4/witness.4 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man4/witness.4 Thu Jun 9 06:55:00 2016 (r301719) @@ -62,7 +62,7 @@ If any of these checks fail, then the ke The .Dv WITNESS_COUNT kernel option controls the maximum number of -.Xr witness 4 +.Nm entries that are tracked in the kernel. The maximum number of entries can be queried via the .Va debug.witness.count @@ -76,7 +76,7 @@ environment variable. The .Dv WITNESS_NO_VNODE kernel option tells -.Xr witness 4 +.Nm to ignore locking issues between .Xr vnode 9 objects. Modified: head/share/man/man5/ar.5 ============================================================================== --- head/share/man/man5/ar.5 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man5/ar.5 Thu Jun 9 06:55:00 2016 (r301719) @@ -70,7 +70,7 @@ file attributes associated with the memb An archive header describes the file attributes for the archive member that follows it. The -.Xr ar 5 +.Nm format only supports a limited number of attributes: the file name, the file creation time stamp, the uid and gid of the creator, the file mode and the file size. Modified: head/share/man/man5/elf.5 ============================================================================== --- head/share/man/man5/elf.5 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man5/elf.5 Thu Jun 9 06:55:00 2016 (r301719) @@ -1308,5 +1308,5 @@ This manual page was written by .An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org with inspiration from BSDi's .Bsx -.Xr elf 5 +.Nm manpage. Modified: head/share/man/man5/nsswitch.conf.5 ============================================================================== --- head/share/man/man5/nsswitch.conf.5 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man5/nsswitch.conf.5 Thu Jun 9 06:55:00 2016 (r301719) @@ -223,7 +223,7 @@ and continue on anything else (i.e, You can enable caching for the particular database by specifying .Dq cache as the first source in the -.Xr nsswitch.conf 5 +.Nm file. You should also enable caching for this database in .Xr nscd.conf 5 . Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man5/rc.conf.5 Thu Jun 9 06:55:00 2016 (r301719) @@ -1207,12 +1207,12 @@ Note that the maximum number of the gene specification is limited to an integer value specified in .Va netif_ipexpand_max in -.Xr rc.conf 5 +.Nm because a small typo can unexpectedly generate a large number of addresses. The default value is .Li 2048 . It can be increased by adding the following line into -.Xr rc.conf 5 : +.Nm : .Bd -literal netif_ipexpand_max="4096" .Ed @@ -3900,7 +3900,7 @@ all configured jails in are stopped in reverse order. .It Va jail_* variables Note that older releases supported per-jail configuration via -.Xr rc.conf 5 +.Nm variables. For example, hostname of a jail named Modified: head/share/man/man9/BUS_NEW_PASS.9 ============================================================================== --- head/share/man/man9/BUS_NEW_PASS.9 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man9/BUS_NEW_PASS.9 Thu Jun 9 06:55:00 2016 (r301719) @@ -44,7 +44,7 @@ The method is called on each bus device to rescan the device tree when the pass level has been changed. This method is responsible for invoking -.Xr BUS_NEW_PASS 9 +.Nm on child bus devices to propagate the rescan to child devices. It is also responsible for reprobing any unattached child devices and allowing drivers for the current pass to identify new children. Modified: head/share/man/man9/pmap.9 ============================================================================== --- head/share/man/man9/pmap.9 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man9/pmap.9 Thu Jun 9 06:55:00 2016 (r301719) @@ -87,7 +87,6 @@ and it must be updated by the implementa .Nm operation. .Sh SEE ALSO -.Xr pmap 9 , .Xr pmap_activate 9 , .Xr pmap_clear_modify 9 , .Xr pmap_copy 9 , Modified: head/share/man/man9/stack.9 ============================================================================== --- head/share/man/man9/stack.9 Thu Jun 9 06:10:20 2016 (r301718) +++ head/share/man/man9/stack.9 Thu Jun 9 06:55:00 2016 (r301719) @@ -171,10 +171,10 @@ is returned if the operation is not impl .Sh AUTHORS .An -nosplit The -.Xr stack 9 +.Nm function suite was created by .An Antoine Brodin . -.Xr stack 9 +.Nm was extended by .An Robert Watson for general-purpose use outside of From owner-svn-src-all@freebsd.org Thu Jun 9 07:19:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB8BAC81AF; Thu, 9 Jun 2016 07:19:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80F991C06; Thu, 9 Jun 2016 07:19:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u597J2wP039043; Thu, 9 Jun 2016 07:19:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u597J2fr039041; Thu, 9 Jun 2016 07:19:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606090719.u597J2fr039041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Jun 2016 07:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301720 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 07:19:03 -0000 Author: trasz Date: Thu Jun 9 07:19:02 2016 New Revision: 301720 URL: https://svnweb.freebsd.org/changeset/base/301720 Log: Don't cap FirstBurstLength to maximum MaxRecvDataSegmentLength claimed by the offload driver; there is no reason to do so, and it actually harms performance. MFC after: 1 month Modified: head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Thu Jun 9 06:55:00 2016 (r301719) +++ head/usr.sbin/ctld/ctld.h Thu Jun 9 07:19:02 2016 (r301720) @@ -49,6 +49,7 @@ #define MAX_NAME_LEN 223 #define MAX_DATA_SEGMENT_LENGTH (128 * 1024) #define MAX_BURST_LENGTH 16776192 +#define FIRST_BURST_LENGTH (128 * 1024) #define SOCKBUF_SIZE 1048576 struct auth { Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Thu Jun 9 06:55:00 2016 (r301719) +++ head/usr.sbin/ctld/login.c Thu Jun 9 07:19:02 2016 (r301720) @@ -574,13 +574,12 @@ login_negotiate_key(struct pdu *request, tmp = strtoul(value, NULL, 10); if (tmp <= 0) { login_send_error(request, 0x02, 0x00); - log_errx(1, "received invalid " - "FirstBurstLength"); + log_errx(1, "received invalid FirstBurstLength"); } - if (tmp > conn->conn_data_segment_limit) { - log_debugx("capping FirstBurstLength from %zd to %zd", - tmp, conn->conn_data_segment_limit); - tmp = conn->conn_data_segment_limit; + if (tmp > FIRST_BURST_LENGTH) { + log_debugx("capping FirstBurstLength from %zd to %d", + tmp, FIRST_BURST_LENGTH); + tmp = FIRST_BURST_LENGTH; } conn->conn_first_burst_length = tmp; keys_add_int(response_keys, name, tmp); From owner-svn-src-all@freebsd.org Thu Jun 9 07:49:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1772BADC22F; Thu, 9 Jun 2016 07:49:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDA721D58; Thu, 9 Jun 2016 07:49:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u597nLX1049803; Thu, 9 Jun 2016 07:49:21 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u597nKer049801; Thu, 9 Jun 2016 07:49:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606090749.u597nKer049801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Jun 2016 07:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301721 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 07:49:22 -0000 Author: trasz Date: Thu Jun 9 07:49:20 2016 New Revision: 301721 URL: https://svnweb.freebsd.org/changeset/base/301721 Log: Decouple MaxBurstLength and FirstBurstLength from MaxRecvDataSegmentLength reported by the ICL module in iscsid(8). This harmed performance and was just wrong. MFC after: 1 month Modified: head/usr.sbin/iscsid/iscsid.h head/usr.sbin/iscsid/login.c Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Thu Jun 9 07:19:02 2016 (r301720) +++ head/usr.sbin/iscsid/iscsid.h Thu Jun 9 07:49:20 2016 (r301721) @@ -42,8 +42,10 @@ #define CONN_DIGEST_NONE 0 #define CONN_DIGEST_CRC32C 1 -#define CONN_MUTUAL_CHALLENGE_LEN 1024 +#define CONN_MUTUAL_CHALLENGE_LEN 1024 #define SOCKBUF_SIZE 1048576 +#define MAX_BURST_LENGTH (256 * 1024) +#define FIRST_BURST_LENGTH (128 * 1024) struct connection { int conn_iscsi_fd; Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Thu Jun 9 07:19:02 2016 (r301720) +++ head/usr.sbin/iscsid/login.c Thu Jun 9 07:49:20 2016 (r301721) @@ -395,16 +395,24 @@ login_negotiate_key(struct connection *c } conn->conn_max_data_segment_length = tmp; } else if (strcmp(name, "MaxBurstLength") == 0) { - if (conn->conn_immediate_data) { - tmp = strtoul(value, NULL, 10); - if (tmp <= 0) - log_errx(1, "received invalid MaxBurstLength"); - conn->conn_max_burst_length = tmp; + tmp = strtoul(value, NULL, 10); + if (tmp <= 0) + log_errx(1, "received invalid MaxBurstLength"); + if (tmp > MAX_BURST_LENGTH) { + log_debugx("capping MaxBurstLength " + "from %d to %d", tmp, MAX_BURST_LENGTH); + tmp = MAX_BURST_LENGTH; } + conn->conn_max_burst_length = tmp; } else if (strcmp(name, "FirstBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) log_errx(1, "received invalid FirstBurstLength"); + if (tmp > FIRST_BURST_LENGTH) { + log_debugx("capping FirstBurstLength " + "from %d to %d", tmp, FIRST_BURST_LENGTH); + tmp = FIRST_BURST_LENGTH; + } conn->conn_first_burst_length = tmp; } else if (strcmp(name, "DefaultTime2Wait") == 0) { /* Ignore */ @@ -489,10 +497,8 @@ login_negotiate(struct connection *conn) keys_add(request_keys, "DataDigest", "None"); keys_add(request_keys, "ImmediateData", "Yes"); - keys_add_int(request_keys, "MaxBurstLength", - 2 * conn->conn_limits.isl_max_data_segment_length); - keys_add_int(request_keys, "FirstBurstLength", - conn->conn_limits.isl_max_data_segment_length); + keys_add_int(request_keys, "MaxBurstLength", MAX_BURST_LENGTH); + keys_add_int(request_keys, "FirstBurstLength", FIRST_BURST_LENGTH); keys_add(request_keys, "InitialR2T", "Yes"); keys_add(request_keys, "MaxOutstandingR2T", "1"); if (conn->conn_conf.isc_iser == 1) { From owner-svn-src-all@freebsd.org Thu Jun 9 08:19:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F06A2ADCED4; Thu, 9 Jun 2016 08:19:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1D4C1D8A; Thu, 9 Jun 2016 08:19:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u598JgrS060926; Thu, 9 Jun 2016 08:19:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u598JgB8060924; Thu, 9 Jun 2016 08:19:42 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606090819.u598JgB8060924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 9 Jun 2016 08:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301722 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 08:19:44 -0000 Author: avos Date: Thu Jun 9 08:19:42 2016 New Revision: 301722 URL: https://svnweb.freebsd.org/changeset/base/301722 Log: net80211: fix duplicate packet counter incrementation. Remove 'if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);' from raw xmit and apbridge path; it will be incremented by ieee80211_tx_complete() after packet transmission. Noticed by: Imre Vadasz Modified: head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Thu Jun 9 07:49:20 2016 (r301721) +++ head/sys/net80211/ieee80211_hostap.c Thu Jun 9 08:19:42 2016 (r301722) @@ -412,8 +412,8 @@ hostap_deliver_data(struct ieee80211vap ieee80211_free_node(sta); } } - if (mcopy != NULL && ieee80211_vap_xmitpkt(vap, mcopy) == 0) - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if (mcopy != NULL) + (void) ieee80211_vap_xmitpkt(vap, mcopy); } if (m != NULL) { /* Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 9 07:49:20 2016 (r301721) +++ head/sys/net80211/ieee80211_output.c Thu Jun 9 08:19:42 2016 (r301722) @@ -647,7 +647,6 @@ ieee80211_output(struct ifnet *ifp, stru if (ieee80211_classify(ni, m)) senderr(EIO); /* XXX */ - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { IEEE80211_NODE_STAT(ni, tx_mcast); From owner-svn-src-all@freebsd.org Thu Jun 9 11:39:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB327B6D8D9; Thu, 9 Jun 2016 11:39:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C8841A41; Thu, 9 Jun 2016 11:39:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59BdoV5035213; Thu, 9 Jun 2016 11:39:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Bdomd035212; Thu, 9 Jun 2016 11:39:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606091139.u59Bdomd035212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Jun 2016 11:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301723 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 11:39:51 -0000 Author: trasz Date: Thu Jun 9 11:39:50 2016 New Revision: 301723 URL: https://svnweb.freebsd.org/changeset/base/301723 Log: Add some spares to structs used by iscsi(4), to avoid ABI problems during 11-STABLE. MFC after: 1 month Modified: head/sys/dev/iscsi/iscsi_ioctl.h Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Thu Jun 9 08:19:42 2016 (r301722) +++ head/sys/dev/iscsi/iscsi_ioctl.h Thu Jun 9 11:39:50 2016 (r301723) @@ -68,7 +68,7 @@ struct iscsi_session_conf { int isc_iser; char isc_offload[ISCSI_OFFLOAD_LEN]; int isc_enable; - int isc_spare[1]; + int isc_spare[4]; }; /* @@ -77,6 +77,7 @@ struct iscsi_session_conf { */ struct iscsi_session_limits { size_t isl_max_data_segment_length; + int isl_spare[8]; }; /* @@ -89,12 +90,13 @@ struct iscsi_session_state { int iss_header_digest; int iss_data_digest; int iss_max_data_segment_length; + int iss_max_burst_length; + int iss_first_burst_length; int iss_immediate_data; int iss_connected; char iss_reason[ISCSI_REASON_LEN]; char iss_offload[ISCSI_OFFLOAD_LEN]; - int iss_max_burst_length; - int iss_first_burst_length; + int iss_spare[4]; }; /* @@ -107,7 +109,7 @@ struct iscsi_daemon_request { uint16_t idr_tsih; uint16_t idr_spare_cid; struct iscsi_session_limits idr_limits; - int idr_spare[2]; + int idr_spare[4]; }; struct iscsi_daemon_handoff { @@ -120,11 +122,11 @@ struct iscsi_daemon_handoff { uint32_t idh_statsn; int idh_header_digest; int idh_data_digest; - int idh_initial_r2t; - int idh_immediate_data; size_t idh_max_data_segment_length; size_t idh_max_burst_length; size_t idh_first_burst_length; + int idh_immediate_data; + int idh_initial_r2t; int idh_spare[4]; }; From owner-svn-src-all@freebsd.org Thu Jun 9 12:29:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2291AEEFE8; Thu, 9 Jun 2016 12:29:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A9261858; Thu, 9 Jun 2016 12:29:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59CT3Xx053593; Thu, 9 Jun 2016 12:29:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59CT3b5053591; Thu, 9 Jun 2016 12:29:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606091229.u59CT3b5053591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 9 Jun 2016 12:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301724 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 12:29:04 -0000 Author: arybchik Date: Thu Jun 9 12:29:03 2016 New Revision: 301724 URL: https://svnweb.freebsd.org/changeset/base/301724 Log: sfxge(4): handle negative ticks difference correctly ticks are signed int and if statistics is not updated for a long time (more than INT_MAX ticks, but less than UINT_MAX) difference becomes negative and less than hz for a long time. Other option to repeat is simply load driver (which initializes timestamps to 0) when ticks are negative. Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6777 Modified: head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Thu Jun 9 11:39:50 2016 (r301723) +++ head/sys/dev/sfxge/sfxge_ev.c Thu Jun 9 12:29:03 2016 (r301724) @@ -453,7 +453,7 @@ sfxge_ev_stat_update(struct sfxge_softc goto out; now = ticks; - if (now - sc->ev_stats_update_time < hz) + if ((unsigned int)(now - sc->ev_stats_update_time) < (unsigned int)hz) goto out; sc->ev_stats_update_time = now; Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Thu Jun 9 11:39:50 2016 (r301723) +++ head/sys/dev/sfxge/sfxge_port.c Thu Jun 9 12:29:03 2016 (r301724) @@ -62,7 +62,7 @@ sfxge_mac_stat_update(struct sfxge_softc } now = ticks; - if (now - port->mac_stats.update_time < hz) { + if ((unsigned int)(now - port->mac_stats.update_time) < (unsigned int)hz) { rc = 0; goto out; } @@ -570,7 +570,7 @@ sfxge_phy_stat_update(struct sfxge_softc } now = ticks; - if (now - port->phy_stats.update_time < hz) { + if ((unsigned int)(now - port->phy_stats.update_time) < (unsigned int)hz) { rc = 0; goto out; } From owner-svn-src-all@freebsd.org Thu Jun 9 12:33:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8D03B6E29B; Thu, 9 Jun 2016 12:33:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB0261DFC; Thu, 9 Jun 2016 12:33:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59CXrjK057010; Thu, 9 Jun 2016 12:33:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59CXrPh057009; Thu, 9 Jun 2016 12:33:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606091233.u59CXrPh057009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 9 Jun 2016 12:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301725 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 12:33:55 -0000 Author: arybchik Date: Thu Jun 9 12:33:53 2016 New Revision: 301725 URL: https://svnweb.freebsd.org/changeset/base/301725 Log: sfxge(4): bump version to the closest out-of-tree driver version Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/sfxge_version.h Modified: head/sys/dev/sfxge/sfxge_version.h ============================================================================== --- head/sys/dev/sfxge/sfxge_version.h Thu Jun 9 12:29:03 2016 (r301724) +++ head/sys/dev/sfxge/sfxge_version.h Thu Jun 9 12:33:53 2016 (r301725) @@ -36,6 +36,6 @@ #ifndef _SFXGE_VERSION_H #define _SFXGE_VERSION_H -#define SFXGE_VERSION_STRING "v4.8.0.1071" +#define SFXGE_VERSION_STRING "v4.8.0.1081" #endif /* _SFXGE_DRIVER_VERSION_H */ From owner-svn-src-all@freebsd.org Thu Jun 9 12:49:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 688EEB6E7C5; Thu, 9 Jun 2016 12:49:52 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 674F31684; Thu, 9 Jun 2016 12:49:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id e7d5e33c; Thu, 9 Jun 2016 14:43:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=URpB82clsJ5C+P67mKFjRe1UiAQ=; b=Dgi9ZhucTNdzEiywP1B5y2Q9Cmik xL3FXxHd0G1GVuLRPIKxCWvi71t7hA7lBZ4bYC788L88cJ2JkZgF7P51PgpnJ5T1 Ao6QZXFufFsXV5iK0HzfVZUWf+df5NrpyVUgoQGA84lkK4mlsHRsp0hjCcbq92OU i+c+2vlaNh3Fxh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=Ieds3hR0X5ly8GR57Nd23/4LYQJZyBXysumvNlA+7ESPPifJWDyDKdwB qkHjXERnRWT7Cg/WKdQHGT7HJNoyW9YNmeSJCSJ55Zq8BfHE8hmG/RpQAZZ5/+bY fAc3gYfMyciNAdj7eRiH/4ZBY6NBIfFUMD9mahZiN14NZvXqKxo= Received: from knuckles.blih.net (137.122.64.8 [137.122.64.8]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 210e9768 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 9 Jun 2016 14:43:08 +0200 (CEST) Date: Thu, 9 Jun 2016 14:43:04 +0200 From: Emmanuel Vadot To: Warner Losh Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301714 - head/sys/boot/efi/libefi Message-Id: <20160609144304.05437ef3d7f2fe9cd26704ac@bidouilliste.com> In-Reply-To: <90D3441D-D130-4D00-A12D-F4D3B81E606B@bsdimp.com> References: <201606090202.u5922pwl024436@repo.freebsd.org> <90D3441D-D130-4D00-A12D-F4D3B81E606B@bsdimp.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 12:49:52 -0000 I wanted to more verbose in case of the system don't have partition o n disk (or the EFI implementation only support raw disks like U-Boot) but this might be a bad way of doing saw, I didn't think about the implication you're talking about. I'll try to figure a better way to do this. On Wed, 8 Jun 2016 22:21:36 -0400 Warner Losh wrote: >=20 > > On Jun 8, 2016, at 10:02 PM, Emmanuel Vadot wrote: > >=20 > > Author: manu > > Date: Thu Jun 9 02:02:50 2016 > > New Revision: 301714 > > URL: https://svnweb.freebsd.org/changeset/base/301714 > >=20 > > Log: > > Print a message when the efi disk isn't a logical partition. >=20 > Why on earth would you do that? This will print a message, one per full d= isk, and our systems have 36 disks in them? > Please consider backing this out... >=20 > Warner >=20 >=20 > > Approved by: andrew (mentor) > > Differential Revision: https://reviews.freebsd.org/D6782 > >=20 > > Modified: > > head/sys/boot/efi/libefi/efipart.c > >=20 > > Modified: head/sys/boot/efi/libefi/efipart.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/boot/efi/libefi/efipart.c Thu Jun 9 01:50:43 2016 (r30171= 3) > > +++ head/sys/boot/efi/libefi/efipart.c Thu Jun 9 02:02:50 2016 (r30171= 4) > > @@ -119,8 +119,11 @@ efipart_init(void)=20 > > (void**)&blkio); > > if (EFI_ERROR(status)) > > continue; > > - if (!blkio->Media->LogicalPartition) > > + if (!blkio->Media->LogicalPartition) { > > + printf("%s%d isn't a logical partition, skipping\n", > > + efipart_dev.dv_name, n); > > continue; > > + } > >=20 > > /* > > * If we come across a logical partition of subtype CDROM > >=20 --=20 Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Jun 9 13:01:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7163BB6EBD0; Thu, 9 Jun 2016 13:01:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 630781E66; Thu, 9 Jun 2016 13:01:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id A411F1A12; Thu, 9 Jun 2016 13:01:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Thu, 9 Jun 2016 13:01:08 +0000 From: Glen Barber To: "Simon J. Gerraty" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301713 - head/sys/dev/random Message-ID: <20160609130108.GN2323@FreeBSD.org> References: <201606090150.u591ohZa019497@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wmhq21yAGFMoSpeN" Content-Disposition: inline In-Reply-To: <201606090150.u591ohZa019497@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:01:11 -0000 --wmhq21yAGFMoSpeN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 09, 2016 at 01:50:43AM +0000, Simon J. Gerraty wrote: > Author: sjg > Date: Thu Jun 9 01:50:43 2016 > New Revision: 301713 > URL: https://svnweb.freebsd.org/changeset/base/301713 >=20 > Log: > Add a prototype for random_harvest_queue to dev/random/random_harvestq.h > This fixes a warning that occurs in a number of files that use the > random_harvest_queue function. > =20 > Differential Revision: https://reviews.freebsd.org/D4229 > Submitted by: stevek@juniper.net > Reviewed by: markm > Approved by: so >=20 > Modified: > head/sys/dev/random/random_harvestq.h >=20 > Modified: head/sys/dev/random/random_harvestq.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/random_harvestq.h Thu Jun 9 01:31:09 2016 (r3017= 12) > +++ head/sys/dev/random/random_harvestq.h Thu Jun 9 01:50:43 2016 (r3017= 13) > @@ -43,7 +43,9 @@ struct harvest_event { > uint8_t he_source; /* origin of the entropy */ > } __packed; > =20 > -void read_rate_increment(u_int); > +void random_harvest_queue(const void *, u_int, u_int, > + enum random_entropy_source); > +void read_rate_increment(u_int); > =20 > #define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" > =20 This breaks sparc64. cc1: warnings being treated as errors In file included from /usr/src/sys/modules/random_other/../../dev/random/ot= her_algorithm.c:62: /usr/src/sys/dev/random/random_harvestq.h:47: warning: redundant redeclarat= ion of 'random_harvest_queue' [-Wredundant-decls] /usr/src/sys/sys/random.h:99: warning: previous declaration of 'random_harv= est_queue' was here Glen --wmhq21yAGFMoSpeN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXWWiUAAoJEAMUWKVHj+KTcFMP/RPEOU14PFRuFLyA16SYgL0u CeoHfHOnTl3sjyb2fGmcdQn/a+rQDY1yFNNVidKvT0ZgPxlN66nX06F8GrK2BzhY SJZ8bOtp3MHPj7msRNrtnR47QiqxAbBFoci7nz3bBPr1R3QU5MKGQ2ZpKlAkA1Y1 EErLYF3nXJqaTiE7i2B17/+sKSRvOy/Lxv0By4ZD/T57KzblK6aNdSJyqpFVP1Zx GhiuG4uy4L5+LgcHTaz3GNLrZpJ1j2ncDSTp/uVv/r9QENBpvgs6D8XVklkEqIuN VFzxsUQxs6lq7iOY1nZ4UytpeDwqnAXMkQnJ2oz0XMoAP+9Y1PaJBahKOiX8vm6S D9YQhraGQxKLNSYJ8K3/6yKlP688ssGGK+ILAcaSYluIL6Gd9J+IJWXWRGuLaabq Jhqt59VgczetwhlpN/7IDZ4cYeMn4CRHP/bav8h7s392/MAhrUlqMU3pgv5ugxCo SP9JWrawdQ5iiqq4ju+AWGCXw8fB0V7uYvQupM9DbL/VGJ0GyjCsMsY+0Xgx/9rc DnRpCuJ7zfSTFrpY+Atsk2UzAi5G9A0ZafgrQtMPK9Sm1NQqTdGO+KGBznufGs7X 5s4v6ZkS1BEhAgfBZevxoL5sNTb0Wz4eSzRe/g4lezAf3F30+/D89GsjggqPbfXx upCdHufQyYNKtw8+9tn0 =AA/o -----END PGP SIGNATURE----- --wmhq21yAGFMoSpeN-- From owner-svn-src-all@freebsd.org Thu Jun 9 13:04:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A16EFB6EDDC; Thu, 9 Jun 2016 13:04:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A421871; Thu, 9 Jun 2016 13:04:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59D4v8H068149; Thu, 9 Jun 2016 13:04:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59D4vCS068148; Thu, 9 Jun 2016 13:04:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606091304.u59D4vCS068148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Jun 2016 13:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301726 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:04:58 -0000 Author: trasz Date: Thu Jun 9 13:04:57 2016 New Revision: 301726 URL: https://svnweb.freebsd.org/changeset/base/301726 Log: Consistently use 'unsigned int' for session IDs. MFC after: 1 month Modified: head/sys/dev/iscsi/iscsi_ioctl.h Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Thu Jun 9 12:33:53 2016 (r301725) +++ head/sys/dev/iscsi/iscsi_ioctl.h Thu Jun 9 13:04:57 2016 (r301726) @@ -158,7 +158,7 @@ struct iscsi_daemon_fail { */ struct iscsi_daemon_connect { - int idc_session_id; + unsigned int idc_session_id; int idc_iser; int idc_domain; int idc_socktype; @@ -171,7 +171,7 @@ struct iscsi_daemon_connect { }; struct iscsi_daemon_send { - int ids_session_id; + unsigned int ids_session_id; void *ids_bhs; size_t ids_spare; void *ids_spare2; @@ -181,7 +181,7 @@ struct iscsi_daemon_send { }; struct iscsi_daemon_receive { - int idr_session_id; + unsigned int idr_session_id; void *idr_bhs; size_t idr_spare; void *idr_spare2; From owner-svn-src-all@freebsd.org Thu Jun 9 13:17:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9B4B6F50E; Thu, 9 Jun 2016 13:17:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C865189E; Thu, 9 Jun 2016 13:17:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59DH816072081; Thu, 9 Jun 2016 13:17:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59DH8Wa072080; Thu, 9 Jun 2016 13:17:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606091317.u59DH8Wa072080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Jun 2016 13:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301727 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:17:09 -0000 Author: markj Date: Thu Jun 9 13:17:08 2016 New Revision: 301727 URL: https://svnweb.freebsd.org/changeset/base/301727 Log: Fix some cosmetic issues in kern_fail.c omitted from r296927. Obtained from: Matthew Bryan Modified: head/sys/kern/kern_fail.c Modified: head/sys/kern/kern_fail.c ============================================================================== --- head/sys/kern/kern_fail.c Thu Jun 9 13:04:57 2016 (r301726) +++ head/sys/kern/kern_fail.c Thu Jun 9 13:17:08 2016 (r301727) @@ -82,13 +82,13 @@ static MALLOC_DEFINE(M_FAIL_POINT, "Fail #define fp_malloc(size, flags) malloc((size), M_FAIL_POINT, (flags)) #define fs_free(ptr) fp_free(ptr) #define fs_malloc() fp_malloc(sizeof(struct fail_point_setting), \ - M_WAITOK | M_ZERO) + M_WAITOK | M_ZERO) - /** - * These define the wchans that are used for sleeping, pausing respectively. - * They are chosen arbitrarily but need to be distinct to the failpoint and - * the sleep/pause distinction. - */ +/** + * These define the wchans that are used for sleeping, pausing respectively. + * They are chosen arbitrarily but need to be distinct to the failpoint and + * the sleep/pause distinction. + */ #define FP_SLEEP_CHANNEL(fp) (void*)(fp) #define FP_PAUSE_CHANNEL(fp) __DEVOLATILE(void*, &fp->fp_setting) @@ -166,7 +166,7 @@ struct fail_point_entry { enum fail_point_t fe_type; /**< type of entry */ int fe_arg; /**< argument to type (e.g. return value) */ int fe_prob; /**< likelihood of firing in millionths */ - int fe_count; /**< number of times to fire, -1 means infinite */ + int32_t fe_count; /**< number of times to fire, -1 means infinite */ pid_t fe_pid; /**< only fail for this process */ struct fail_point *fe_parent; /**< backpointer to fp */ TAILQ_ENTRY(fail_point_entry) fe_entries; /**< next entry ptr */ @@ -354,7 +354,7 @@ fail_point_eval_swap_out(struct fail_poi /* Free up any zero-ref entries in the garbage queue */ static void -fail_point_garbage_collect() +fail_point_garbage_collect(void) { struct fail_point_setting *fs_current, *fs_next; struct fail_point_setting_garbage fp_ents_free_list; @@ -441,7 +441,7 @@ fail_point_sleep(struct fail_point *fp, fp->fp_pre_sleep_fn(fp->fp_pre_sleep_arg); timeout(fp->fp_post_sleep_fn, fp->fp_post_sleep_arg, - timo); + timo); *pret = FAIL_POINT_RC_QUEUED; } } @@ -635,7 +635,6 @@ abort: fail_point_setting_release_ref(fp); return (ret); - } /** @@ -844,19 +843,17 @@ end: /** * Handle kernel failpoint set/get. */ - int fail_point_sysctl(SYSCTL_HANDLER_ARGS) { struct fail_point *fp; char *buf; - struct sbuf *sb_check; - struct sbuf sb; + struct sbuf sb, *sb_check; int error; + buf = NULL; error = 0; fp = arg1; - buf = NULL; sb_check = sbuf_new(&sb, NULL, 1024, SBUF_AUTOEXTEND); if (sb_check != &sb) @@ -949,7 +946,6 @@ fail_sysctl_drain_func(void *sysctl_args return (len); } - /** * Internal helper function to translate a human-readable failpoint string * into a internally-parsable fail_point structure. From owner-svn-src-all@freebsd.org Thu Jun 9 13:17:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1355B6F562; Thu, 9 Jun 2016 13:17:30 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bn0108.outbound.protection.outlook.com [157.56.110.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B98971A6A; Thu, 9 Jun 2016 13:17:26 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8QRlJ0moeWBd9gvfDuSmnjSK13N2ZfPbkP9+NrmoMFo=; b=Rkq4JzVGavs7U5CVvu91AVjeDR3Tse0SO1/rcc/B/rh6nsxpJov2TBrN27uAb5gAAqIIe8gSS9fEO3MFFsDVf7lAUaP8z0Rm3vfBLZ09W58Es7TEI/mYAeCMy5TfIcNwrN0+WcSMez48rrvdQwLZeF6eqTuJnU5CZGsaTrGBuIw= Received: from BLUPR05CA0057.namprd05.prod.outlook.com (10.141.20.27) by DM2PR0501MB812.namprd05.prod.outlook.com (10.242.115.142) with Microsoft SMTP Server (TLS) id 15.1.517.8; Thu, 9 Jun 2016 13:17:18 +0000 Received: from BL2FFO11FD045.protection.gbl (2a01:111:f400:7c09::105) by BLUPR05CA0057.outlook.office365.com (2a01:111:e400:855::27) with Microsoft SMTP Server (TLS) id 15.1.511.8 via Frontend Transport; Thu, 9 Jun 2016 13:17:18 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.19) by BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Thu, 9 Jun 2016 13:17:18 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 9 Jun 2016 06:17:16 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u59DHGE86483; Thu, 9 Jun 2016 06:17:16 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 83139385551; Thu, 9 Jun 2016 06:17:16 -0700 (PDT) To: Glen Barber CC: , , , , Subject: Re: svn commit: r301713 - head/sys/dev/random In-Reply-To: <20160609130108.GN2323@FreeBSD.org> References: <201606090150.u591ohZa019497@repo.freebsd.org> <20160609130108.GN2323@FreeBSD.org> Comments: In-reply-to: Glen Barber message dated "Thu, 09 Jun 2016 13:01:08 -0000." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <90037.1465478236.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Thu, 9 Jun 2016 06:17:16 -0700 Message-ID: <90038.1465478236@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(51344004)(24454002)(189002)(199003)(8936002)(8746002)(81166006)(81156014)(8676002)(11100500001)(4001430100002)(86362001)(23726003)(69596002)(50466002)(87936001)(77096005)(5003600100002)(2906002)(189998001)(97756001)(2950100001)(107886002)(97736004)(110136002)(450100001)(117636001)(586003)(9686002)(2810700001)(4326007)(106466001)(92566002)(76506005)(105596002)(53416004)(50226002)(68736007)(5008740100001)(19580395003)(6806005)(76176999)(47776003)(19580405001)(50986999)(46406003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0501MB812; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:l0a6gyVtoaxQ6+QzzU7ai6vVt9+XLHmjfWpU2SmwhJflN3JldIIRYhR+gSiHNOm5gTkWbjBFB+T6dlmsgRNP+pI5A4l/ZYPV1ixmicY98lZtXBk/1QpYo/ZiPI6YkZBNFkfNIsmmKodBYUHgUMRFxwCv5Wm9ZZSfsFV2jnPnXP0LMq7Rkm925hdaSXAW9bEMdWLsOwqoJdJ6LLrDos2InuAcXhKM6cICdlUnvpL6g1WeOlbQHaJqsdmM8aMT/uO0PVruPyZ+ziAbj51jOtHVen3we3IcZW+X3OpC6fdZV+eYBhFn8f+WMYU7a8Z4PJ2+i9jKVNCUZ0IfMv3qpNkQjxhMZoky33z8FDyF+DFp8jhGgA0spKzXFLTdenOAmbj0y2UevIFbxzb4Ul9SWMHPMJD96waTjTrAj8FIfVQZddJexpwP5j1UAGbTAsjd1MLmpnJDab9maIdWe+Ct2RYgkJI/k2t62S0+Zf9d0W5tnKk= X-MS-Office365-Filtering-Correlation-Id: 28037e1d-97a5-468d-c318-08d390686213 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB812; 2:T2FqKjZy8HOToYGWyVeazGcLDCCnljEp5BXQq/InwbQOFSIFxRBBD4jLfVO65KB9NSZe3pbY+lhQrh3++i4Xxh8sZCdgwl2saOA42gVKIoh308wVWdoI2z8XnPIDTo2nsgeTHO50YxZrMkmoX1LzEVJBnLn5rgFvX7ZLNUma3nngV+nz+3luebnK0Q5NJGOs; 3:xrU1L9KGj3cxp/4mSv4n4TN5O5zpWnGvLaJh81soR1ECqLzrydmPWu+GMGbnNgNFpc35noTj4LkRwnnrU3PWXaGgAt7Ru8PLer4tVxF2nkvlYs5h4vsfjkc9I/9jOIu7PPmx012cDIYuXEGZkX/nbftMIYSoedk6JkFbBaTExOCC5rkNh59VK87ABn3NGh6cbIOU66qJKT5t9urKr8o1vzvLhPgj9uklLnUSZKqPRA4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0501MB812; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB812; 25:xK//F3Q9VXpFpjkGFas7FI3oVcopuuCz7TGEO5IbfcksfSxieqq9K7akWfZaFn1+VlXcZJzH9C/YbK8xpZfZzvU93MYfYnQtEQ37PIyWZMSAGKxJ+Ku5kr+p2kLV5/iAUrJSGl43vPtgqAnbsVVo7m/nxF0Ty7wvPDBfKYZZFirvzetaSYK+S+P18OdVx7PExuWyZc62SEBCmzh0A2uANQ0ixj1Csef6XK1SzcXoIcGhmKD0imySVjcIzDxaIF26nXAUtcpnGxjo8SSGq6GbNgYKJsjujxpv1np37Q32w38iZkzqowq9oCoEWFB9KrZcmMxm1fWzkez0PpChQR94EwPF12sWh5Rh79Iffezuse0Qv8bHcAdqpB5uD/u618+kgov79CzXgLs5ssu+3tbQOt/RvKHeTgW2CeSi6ios9GAabjStjKfGQlMO2QWxrGgXaNsROYCXeyi3v0ZrK8zsYWufTMMdl+GNb3aQEAgCgumWHFLgl0z7eKbj+3ozYFJz708hsVKb8w7Uu1vbSwoJsNa9VrkCvJqcg+s/cVOWd8rMZva6YZTLy2dHOjuYM8KHxkjo2w/UJpxOB2HFrMwebOf5RhtMVtMgLIIOe5QPxtmKQEfPSWvXzF7PDnmA1zb+P2pAYT6sET6ZrIqHyZGMSVHQ6d1EDwFFIMeHJoF3WvA/W6MqgqOpX5oPSA1dLQUrLcDJvSQw0Zi9OKNNgUVtVXFx42JopMD5ktDR66AHRk0= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB812; 20:TarFFWf/BTGgsmw3QfEkUheTsyGJTyFIdEDj6tapGBf1FPxnX+Z0TqoK+Pn2PEqt1RYVE4QSF1ateW3JcnEUD2HF5Fy9CSAcp1A9PDfdtNqi+bDWqI7FBWZmQqwVLwIAD/wohuJD1E1KR3Hk0dk4sOmPlOZnBaVBdHcCO6IEV+1YfHVmHoEjK8NB1GoRMoedRGcoswNEm2p3+zvfsE0Hd40+dXLVF1vyW2Q/bIx/iO6ic2AgqFuonr0sJuVypPv9Dav66vqM2DBGSrASEwAOsF+hsvt9VeIwlYNKhmvqkDC/xzBb8g+KOHDu9c5uhpAqqizkvDCgC/31wnMPsswUMyrjVRIEh86LT23S0r0gfbt7jx8h75KRvMEAJAnRXmsDeY5+4p/gwU7dn1jScQ3WBNvJSDtBtekVIOnnY4K5hGHuYBHUeG5/BpyFxbs4RwzUGSLiRE1sS9AZ+7MJX5t6vu1t0+9BKU2i3+UyH64GYNLQXbcv2n8G3zeCI0kqVonT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13024025)(13023025)(13017025)(13015025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:DM2PR0501MB812; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0501MB812; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB812; 4:6Bd6DyGTMVUrdq5EdD165lv5L32p/bnVRmOmL/MKmowVXHfGXwa7h9SP7pdLfIHzojJUR0FOlCpwypoEJwM50jogEWSl+GwDDSkPnsiCVvC8ejTHQQxDmoN5/oj3RlTeWQOmb9J5AHMb/E10rAWMrOfnz5Wnb6wmZofzIcEPRlNIPSwpqOVl/XA9iCDL/cLiO2DjxjWhUyjlQ9vZdt3CI3ou/dT/P0Y/l76vJek4vBSfPbsfSLoiYcEvFXypUI/ymeYX3zdsMA7R+DFFEgHMVYuPJ9KSgv9aO7KWRF99UviFrsUls2tUb5rMiQv4iJSBy5SYbXs2cKpCuvVVu2B+nGmgwTBpAwQBOnRQcK9AUbA9RJANx3zUO3++/Q4K8ZDA2je3f9Qb70snmd0qiZXP2QPlmeDuaD/HokBAhNUz4gEnHyqOZMX5y2QcRds4kgSwikbwSp8Iuzo61rDI6ftRwmHxNM7ZIndWqHxvy0WijRQ= X-Forefront-PRVS: 0968D37274 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0501MB812; 23:x90POwBqQxV1tnWdnRfLNA2w7om8TOR/shIVkGVG?= =?us-ascii?Q?vUbdX4AOF6oDRTXgzJpgmDTgBUpwDi8ZLo3K2+rrXGStt82XgoCoI9bYQiSa?= =?us-ascii?Q?OLYa72nYaKnogZIxh0VYZKVe4SZb997E/FQ0QqvesbmZ09TLeqBiLLbN/DiW?= =?us-ascii?Q?sxFi2naJCNOOCuHQvSXVemdOW8R5soVW2tcspmocex6T6FdqRMH0iAExAPQC?= =?us-ascii?Q?DAG2mBHUbBr+1Lt/TBprFCkq98VsHnsLHhS0KZiYeGR7O47dQdNyM3S62yrt?= =?us-ascii?Q?rxyxsIcV7JiSEZ4cJPu6GfQNSQGGsjGIjXUMGJLwajOhgVun3aWC0FvnZZ2t?= =?us-ascii?Q?kZsvTbWycgRmrQNrkeJCdg0q9tHG8rr+RIPPPF+nDW29MCdp6MN4djK1Jfat?= =?us-ascii?Q?BICDfDt9B60c6GMXQQ1o2Flvc5TZlGf3+vG7Bo01+StkET7qlF4Xs0RhAhsR?= =?us-ascii?Q?8+Hn6lROffayz5w4d1rvyYk0ktep+4H+knDHjWzsNODB9W3+vhXrP5Zk0Yb3?= =?us-ascii?Q?WmB/Z/XJDHMg+bBrl88C0///mLqmGk+vUwPm84r82hX0xndNyMIjPkFmnaAM?= =?us-ascii?Q?IG6sqJP0Cl4cHkIJHawLII0KYO5yA/3uPjVh5KjfWBvZpZWcxHXh5Na18FCC?= =?us-ascii?Q?oyLl52AVg0ZLy5wRKY83h3O1t2aNBzCxad5t5vqLX7i9kaXgeLevkPwu/uk8?= =?us-ascii?Q?BIC/dJdx8RrAScbDBW/LoLv89oX/RZycUUHX8TOBOoQQ0WFoXffeM/vAZaSp?= =?us-ascii?Q?5aFeABdo9CphPFkc6p6j7uJ9VbWdOl/6nEgoktAhINqUjQnV8AuZsGpOs+T3?= =?us-ascii?Q?7GeudjiqOgKtEGsUh0LvOsYeaoT7SLq8pVZdDDe7RBoiD34wgIiqgL7Dbk6Z?= =?us-ascii?Q?a2Atu901oJpeOOQLoq5QtcAG5begTaa4iSIOnPZMOfXGC3QvOZzikovRF9Kq?= =?us-ascii?Q?lscUYLVOIujOE6LplIyDWpY1mNGKLBdecADNr4Iu0iUvHQbjyh6Vu+S8k9mv?= =?us-ascii?Q?kDfefLooHKXEaLH9JORZ1uikJkvOrgb0WUl7JlOlb26fGPgSpRtyUxPv+DB6?= =?us-ascii?Q?iIMnNT/anOubgEGnEHk1IMlLjL2JS/5OihDN/HPL44VIZAZ8/Mx3OId0v5M8?= =?us-ascii?Q?SmxSxJubJqRb3UL+/l0pD3qiOeg8pSYjlxhKlWiRUNhCmLStiA0HDS6TJSH1?= =?us-ascii?Q?eor7LXmrvTWnMHMwPpYAJ+JB7uLx7VkmEVDbyD2NVDlM32U1qqGMJrHoYErL?= =?us-ascii?Q?DcDelf5gq+qKwDQDSB4=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB812; 6:tcRubTceJA5ZoEM2NVRZAwZHEaE+yVMBTMN6uYBKcZ4gZGtYVnw+3N/2PUJXRl5sHjNQXE9LxmzqpvB/FNZVV7Tb4FkZbW88EewZnrJPYNcn0t7CkGctxP3vacpV7AZE1FV8MukTnpusM6Tq589m/sXobzvM2TMqWoaO0RFA9N+Nd9rfzdN47Y0rPDRQ/BPybYIk9kmEJ1joB59QPwJlUNnzWYmnWVjOFfOlvvPeKoziE5eBObYEyIAdzcVN3dfn5qCnY95EAqK7Fi00wpo3fNOTgEXtE8c1I6yc2LrZzFFFQC9JtYIUcf+D5IPTH0ZQ; 5:KcoUPcW454MwkQE2+RZzIDHjJYSu/32ydWr6lK2rvXP8/5hKsKp46t8Y9HnEx/ZQ8dr5UaSICqfzPe7jO2QksCHqDNpc7i55XBk3d6K+7J5aJ5UZmRmBKucNp4ckX2koFSf5Lw5UssDw9aBodb/SWw==; 24:kX/u8q++0mzWUQ6QaxT0E8BVo8pzBWS8gs4r6xYI9lyt/h/ayiLmee+HiDaES+/COta0l6yv5mRDKQ3jDfIaOxRkdg36BV4LQMaC1YIrARo=; 7:OnaMJ30PskLabXpa3minI+0CzZB9Sao8QtDk+mWuQB3+YGx6LDx/N09X1UUFHehu/MArp1fd3TIeeyGkcA0CFJdA8s6rNPNs2YBD1xeRM7CYdiAyjhtonut+SCh3WWBhVflZHJkLJFG2+Yf73G7/Uao1GVns0gU3P4gU2Y1gCGDc8Uvh32xCQhtWnO7sRCZE5/5K7tbutJ4ZueSoyQC3kQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2016 13:17:18.2088 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0501MB812 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:17:30 -0000 Glen Barber wrote: > This breaks sparc64. Ouch. I only tested on x86 before commit. I can back it out, while we work out what's up. > = > cc1: warnings being treated as errors > In file included from /usr/src/sys/modules/random_other/../../dev/random= /other_algorithm.c:62: > /usr/src/sys/dev/random/random_harvestq.h:47: warning: redundant redecla= ration of 'random_harvest_queue' [-Wredundant-decls] > /usr/src/sys/sys/random.h:99: warning: previous declaration of 'random_h= arvest_queue' was here > = > Glen > = From owner-svn-src-all@freebsd.org Thu Jun 9 13:23:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1B79B6F960; Thu, 9 Jun 2016 13:23:14 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 838301196; Thu, 9 Jun 2016 13:23:14 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59DNDU8075769; Thu, 9 Jun 2016 13:23:13 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59DNDqT075768; Thu, 9 Jun 2016 13:23:13 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201606091323.u59DNDqT075768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Thu, 9 Jun 2016 13:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301728 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:23:14 -0000 Author: skreuzer (doc,ports committer) Date: Thu Jun 9 13:23:13 2016 New Revision: 301728 URL: https://svnweb.freebsd.org/changeset/base/301728 Log: Document 291125, xz updated to version 5.2.2 Approved by: re (gjb, implicit, relnotes) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 9 13:17:08 2016 (r301727) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 9 13:23:13 2016 (r301728) @@ -505,8 +505,8 @@ elftoolchain utilities have been updated to version 3179. - The &man.xz.1; utility has been updated - to version 5.2.1. + The &man.xz.1; utility has been updated + to version 5.2.2. The &man.nvi.1; utility has been updated to version 2.1.3. From owner-svn-src-all@freebsd.org Thu Jun 9 13:27:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57ED9B6FA70; Thu, 9 Jun 2016 13:27:40 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0102.outbound.protection.outlook.com [65.55.169.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DC0B147B; Thu, 9 Jun 2016 13:27:38 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xDCiGBeN1j2Sfh6Ezz9l3T94tJH+VnGYNeRJkwSOCho=; b=b3lkwUmXJ3goj5s5O2kdlwiuB90HthQuGo3wHRgRWYyudDs94GIsq3Vxv2WK8ZF15Gjn6EUvQM8FOZjscxLV3rWDQ2i04YH92PBCSOWZiwpOdBZBMaJn/jFmLgYChXItWik2RPNXFT0YNr5VBCVg/8aCtvrI0TCGsSjS2PjeWSw= Received: from SN1PR0501CA0034.namprd05.prod.outlook.com (10.163.126.172) by CO2PR0501MB808.namprd05.prod.outlook.com (10.141.244.142) with Microsoft SMTP Server (TLS) id 15.1.511.8; Thu, 9 Jun 2016 13:27:35 +0000 Received: from BN1BFFO11OLC004.protection.gbl (2a01:111:f400:7c10::1:177) by SN1PR0501CA0034.outlook.office365.com (2a01:111:e400:52fe::44) with Microsoft SMTP Server (TLS) id 15.1.511.8 via Frontend Transport; Thu, 9 Jun 2016 13:27:35 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.19) by BN1BFFO11OLC004.mail.protection.outlook.com (10.58.145.15) with Microsoft SMTP Server (TLS) id 15.1.497.8 via Frontend Transport; Thu, 9 Jun 2016 13:27:34 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 9 Jun 2016 06:25:34 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u59DPYE93342; Thu, 9 Jun 2016 06:25:34 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 2B1E0385508; Thu, 9 Jun 2016 06:25:34 -0700 (PDT) To: Glen Barber CC: , , , , Subject: Re: svn commit: r301713 - head/sys/dev/random In-Reply-To: <20160609130108.GN2323@FreeBSD.org> References: <201606090150.u591ohZa019497@repo.freebsd.org> <20160609130108.GN2323@FreeBSD.org> Comments: In-reply-to: Glen Barber message dated "Thu, 09 Jun 2016 13:01:08 -0000." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <90182.1465478734.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Thu, 9 Jun 2016 06:25:34 -0700 Message-ID: <90183.1465478734@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(24454002)(189002)(50226002)(450100001)(9686002)(4326007)(81156014)(76176999)(106466001)(92566002)(81166006)(69596002)(189998001)(68736007)(2950100001)(8746002)(76506005)(77096005)(19580395003)(110136002)(19580405001)(4001430100002)(8676002)(2906002)(117636001)(23726003)(8936002)(47776003)(50986999)(105596002)(586003)(46406003)(5008740100001)(50466002)(86362001)(5003600100002)(11100500001)(97756001)(2810700001)(107886002)(6806005)(87936001)(97736004)(53416004)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR0501MB808; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC004; 1:ey0m9MDITY7LOpU0gFK8qh1UXiQIMdB0s7DONd7mE3BGFCM67lvSPNJvZOQx4JpCkJGdeONdDqo4uWxea9zr7PevHKm36ei5cuMXyR4La7cIHt0/hYsQM/8l4Vir4rfXqBdEcYS0I1rm+f7zG1AhjJec0raZd8h9O27SGZXKYnTG7LkYDDYIY+cpshQWGOJaQk13G99pzfszz0SwGUo4KrtBAl9jhBd3ZzSXgqCMrsQiTU5sne286P/9tec+9x0OYIt0CxC+FL8Rm+mUrE8qY8x4RWc78nZEqOjZ6hWjK1jvi+7W9WBGdKc48O7ZDcx5Xed3EFuYK5O6UfRiuHywC1oO0t85M/vtasK28H8vlq+LKJC4Dvf+4fCV2KATPC9zrQcVa1e38TvLukAQw0mfRFmqx71BAy2XaF5BjmmFVCk2nFAQgF4G1dMoPk0W2h/KXqOtlpk1TNCayANHT/2+L6+K5P98/PxXosku6AskC/o= X-MS-Office365-Filtering-Correlation-Id: 2cadebca-38d4-4f75-c540-08d39069d199 X-Microsoft-Exchange-Diagnostics: 1; CO2PR0501MB808; 2:6FfD+ez32lP5YnpyI1OFZcQpwTkftUl1F5qiIabXeMwBHI3mrU4gKYpT6yM2RE/CJipkuE6Q+NsDDQcsAYYI3zzC8+RrCMngcEegOooyZeAy2iaTKGW/T1qIR/djmmD8VoY+VQv+fEQ+aJ90JXA4XZoYDduwkQVwDKi747Ak+THq0mlU/mUtJd0xndWGBsZe; 3:W8OkwqdH0wBnpEHKstKKFupQWIhDCeP5yqe15omPw3FHXeqcbjVidsD2OqISFT2eb6LywGdi47lQS9XgGbLLX1nzXdACg9SeozSHquqQegK5Zm+CAZDa5/w4SJASTWCm9RvdKZcoqwmKsxVtwM+kNUEOxY0n88L0n8lK6BDzumD9ry+pNTwT13tf1aGTUsu6cP341XadTupzPCHWmIUKEnyjFgS70hVwSVGc71QMKkA=; 25:05JHLqkOCsxIP1Kj3DG+EX2iYKnVMRwp5tqiEm4GILg4MP6MMtG1hAhLgLwCdrfiAuRonEr/rzJwyM8r6ykbVwvBo2SRH4MMX0CDIlLFykHMA4cg6bFZWmqQM6hvJB2X/TXNaQxxmVgE16oG9OZ+NWKGUdAlS2TcRA/ph1O740M9VmygwkBc4frti0xyTwJ/kp2V6FP3661t5XX0e9BwEleG66r6gT3GPlNIGhPPomFGUFHE6015pgfQ+GJ0i4cNp8RtlbEJ3h4zbDxNf4MaihuMgLwoiie3EheXeV7yXIoPm9yHL2Cw2tNqs+ge0FxnoIO5WKETWmOjsKbYVRDDZWt0AAoV0bUYKX+cJLGUSwA4i7sNn/1Wlm2TCwblyeap1ymS5vnQ2eCp2YFubYKteNRP21xc6l34dE+6+0GY22Q= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR0501MB808; X-Microsoft-Exchange-Diagnostics: 1; CO2PR0501MB808; 20:vXMGl6VZmNW/+JmWbdNf4gCfAkgHom8vMqBr9jYgaJeMebm0j3bYazSi7tUfCt22ZJV+a+LNn70RKFfaBBQ7YQdLKvhQnzm91I48D8biYBKNHKdRwRIGyM8W6QTHg8zLSHo+PSg4TbstP9rL99oyptVYzLid4hCGJTl7sRFfSzAuTlKD+FVWhP+l/AUR3GHqoFLcjS/oyfc3Zu6jZyGGL0t9aNQouPZSKbsKWnn/ElVa/wLFn4PWRMUkqrb7CUv/X1ohaAy6S9Ba0L/V4m+fkwHb/uuJkmz/mjjtaX7NmyiNDoKApwvhNQocnymN+3wCNghZvOTvjVdtr9TIKXwGqHpjp3BkBcw/eyuGhTAQc5wz6mkaYGMgrC5qad9lhdqTIIYAdHoJxw3SP11H40BBANRqC1UMr+DllT+/hXWCSfNIUwO1Q1OMEyfBeiN2GAJ5S2UxlRBQqGNOERHQXYY8Wx2CpAUUTh/X6guE5DLVHNrbC/tp58ho2uBTo5Lo4xnu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13024025)(13017025)(13023025)(13018025)(8121501046)(13015025)(10201501046)(3002001)(6055026); SRVR:CO2PR0501MB808; BCL:0; PCL:0; RULEID:; SRVR:CO2PR0501MB808; X-Microsoft-Exchange-Diagnostics: 1; CO2PR0501MB808; 4:fGt1z1eGEBE3UIVUaTRbd1QcF6QFyC0o4QnTPSenMs9cgg7tdvEP19aypM2Hj7BXE4F2brIM5+hrN0vHmbH7GM+gIBv7/V0DFp3Dvjo+vhRwfHgUeUtM0Ug7ouge28q2dGI6bPtzOTokMZmV8fvnvffFPMZVs5amPduKPDmTPxvNzhe4L8OnMCoGJHzI4tpUXL668412zOw13m3/keZEGos8pQmovGRK1yyfWYioA4VF90/r9bbTPrw7OY5I+Y9FBE6iCTKC6ijjeUR9lmTLH0sv+xOdbTCDD8KF6ZXW3y4qLTaFAaD7wethiCNJ80Gc7yIWaQ1LVbEzCjzbPJYNgv0arVkWY2h2uU6FrhODX3rtn02wjbbFfki5qMYGYYvjrXDqgaCti0/sSNstqhOUtm6MOK82oyQ+R3JNE+0OhL7K8pVC574/IdAWMwaHA+fwpQefwePczo80N2f6uoWzr5Xm2jHgEmfuIFiWWXzJWb0= X-Forefront-PRVS: 0968D37274 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR0501MB808; 23:VTPTpRv7feBFuVSFNNrLra1YZJeTr6kVpI22B/Tq?= =?us-ascii?Q?CiTjR9LQTK7lCbemJ+QVGoO3mp8ymKjrd0lFJIj8H5jdvyYnukeNOByJ17Oj?= =?us-ascii?Q?GYEeeirWzucIOSc3SD+71suNxsf5jEXYvZhI3TnFmgInsPZte6Kdpebk8LrT?= =?us-ascii?Q?bIhjQicVeSs61dgr1dp14kZnGnOcdBAEpbHSNQYEvIkAacIf/7eRDK+a/W4t?= =?us-ascii?Q?ZSGdTorHGYAjVop9YpF5NL29aLvRln/q7pZ+We7KoFru9DSnK/Hwvi4jmERe?= =?us-ascii?Q?zZcqkf+VZCWnL8ReCAbtMotNaiMqiTHCy2YJZEJdgDUr1hS6iWZwys9KvbH4?= =?us-ascii?Q?geDAr995Lg58BJctPbwRjVQJzRQkv5wMOG3nAeSZJvuRwp21mZ2gnE+ODq46?= =?us-ascii?Q?NucS/PZOi6DQFNqGgABpkLHCX7Amc2dficYHALwOaTHh5TaldDyMYY7zsWmo?= =?us-ascii?Q?V3XIfvfyyocDAEObAs0jpV7NRiA/k6/cv1pLC/1DxuJA3XfIcePyTFAiYnbF?= =?us-ascii?Q?xPaEmXfTpYEJ3fNPwG72TyN1teGfxbkEGpT9FA+5ghGDXtxg+3prWp1Ud87d?= =?us-ascii?Q?yDvYjakpjz9q9HhK9IajDnhHpAWnx4Nv4n4W69/c+VeJWxbrje0QPZ0fuz3L?= =?us-ascii?Q?y7g1WwEA7jyBOYS9EVKgNfQw8Cp+uYwcJ63RKj4LSbzHHcuyDwchz3AU/O52?= =?us-ascii?Q?jGN6j9CWOb8BRlHCb8ur42cqg9iKc2JcB6QMnx3X4Ptb+hnkV9Fuxr02ELQO?= =?us-ascii?Q?yCwEqdzTxq582pCzYDuFvgOLAIU7QhU9ySI4hZ43RVyl8iDeTX6nmd201xvw?= =?us-ascii?Q?+5gaOuclwwh8TPNerZUOkQyzDfBumzKQYhDChEkcbQN4cI9omFdAm+E7YYhQ?= =?us-ascii?Q?PXg7knVMewd10bpcKztFBIvmcaZPvehP+xtrHuXClWyq/T+sKzYfOcOPtoF2?= =?us-ascii?Q?di0Ni2xlupI/NoNIA/Z41Ez7GNhAqBTLboODtpvWslNAWBAamawH9R7tbNaY?= =?us-ascii?Q?IMbcqLH0lyW+lBhuuS8JyfmEXZKSahHkOM45/4ner9q45zCF0qlLezCTeQ6E?= =?us-ascii?Q?rbbXyFvXHD880v38zv/74sGGI8jd8EKMkebu4XIMsZHYs14ZNNMsE6RhKNNC?= =?us-ascii?Q?bCNmyGA5DN0GrI3t9Bb6B+IbwCKamaBKWV4xa7Jd5rcl5mLf8bNe8LR1oJzs?= =?us-ascii?Q?cFJxiOVavu4ZsDA5MNob9ON2HSv1JrUn79Oys/cSjkEFbRgw3Qn6S2GrMg?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR0501MB808; 5:nNXdIzmP69RwPAOeft2u3D4WV6qLr6XHxHngKPfl0n7TFX9ZZLWE9ZvmPWnOJV2f3sxrztdbkRpRN9XPawMQTy+AHy8MCAlzotarPGZKsxh3tMOsGhRW9urMEoFpf/j4K3nagXVA7tQa04Z7HwfmMA==; 24:F0kK2RyW76Gd41Iues5+xhvMnGxHucj/LxOcMVdzwrdAy/0htQWDBUsbmQG1ZEoSxjmxAJu52dE2aolJYxXq7Lsxme0jKWBK/85EqG1zwiE=; 7:nJJKlTKroR7Mw/7bDuskDudtehzOEca9stMLVNtkL4s1aGiD29JV7CTif8qS5S5dZIrL/3cP8fafws3PVQmfixU83mgOUoD6M0qhQ2QxC5oCSOEoPAzIYoBOn3z9SZhYEaolnPyXv0SbNdWoo7f60r6YNnHIItpaixfle57PzP31hmkA8m0s5Xb+8TRLUtWXJS3v+qyIkf0NH1WXWYRdQnXtDA/kDfunUC6iIcU2tMg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2016 13:27:34.8109 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR0501MB808 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:27:40 -0000 Glen Barber wrote: > > = > > -void read_rate_increment(u_int); > > +void random_harvest_queue(const void *, u_int, u_int, > > + enum random_entropy_source); > > +void read_rate_increment(u_int); > > = > > #define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" > > = > = > This breaks sparc64. Looks like defined(DEV_RANDOM) is relevant. Wrapping the prototype in random_harvestq.h in #ifndef DEV_RANDOM would avoid this issue. But backing out until we check if that fixes the original issue steve hit is probably best? > = > cc1: warnings being treated as errors > In file included from /usr/src/sys/modules/random_other/../../dev/random= /other_algorithm.c:62: > /usr/src/sys/dev/random/random_harvestq.h:47: warning: redundant redecla= ration of 'random_harvest_queue' [-Wredundant-decls] > /usr/src/sys/sys/random.h:99: warning: previous declaration of 'random_h= arvest_queue' was here > = > Glen > = From owner-svn-src-all@freebsd.org Thu Jun 9 13:33:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF9A0B6FFB6; Thu, 9 Jun 2016 13:33:14 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE671D5E; Thu, 9 Jun 2016 13:33:14 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59DXD32079773; Thu, 9 Jun 2016 13:33:13 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59DXD8d079772; Thu, 9 Jun 2016 13:33:13 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201606091333.u59DXD8d079772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Thu, 9 Jun 2016 13:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301729 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:33:14 -0000 Author: skreuzer (doc,ports committer) Date: Thu Jun 9 13:33:13 2016 New Revision: 301729 URL: https://svnweb.freebsd.org/changeset/base/301729 Log: Document 300879, acpica updated to version 20160527 Approved by: re (gjb, implicit, relnotes) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 9 13:23:13 2016 (r301728) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 9 13:33:13 2016 (r301729) @@ -601,6 +601,10 @@ The compiler_rt utility has been updated to version 3.8.0. + + ACPICA has been + updated to version 20160527. + From owner-svn-src-all@freebsd.org Thu Jun 9 13:36:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86E25B7006A; Thu, 9 Jun 2016 13:36:32 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 500281FF9; Thu, 9 Jun 2016 13:36:32 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59DaVTn079930; Thu, 9 Jun 2016 13:36:31 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59DaVnh079929; Thu, 9 Jun 2016 13:36:31 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201606091336.u59DaVnh079929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Thu, 9 Jun 2016 13:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301730 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:36:32 -0000 Author: skreuzer (doc,ports committer) Date: Thu Jun 9 13:36:31 2016 New Revision: 301730 URL: https://svnweb.freebsd.org/changeset/base/301730 Log: Document 292432, OpenBSM updated to version 1.2 alpha 4. Approved by: re (gjb, implicit, relnotes) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 9 13:33:13 2016 (r301729) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 9 13:36:31 2016 (r301730) @@ -605,6 +605,9 @@ ACPICA has been updated to version 20160527. + OpenBSM has been + updated to version 1.2 alpha 4. + From owner-svn-src-all@freebsd.org Thu Jun 9 13:42:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6394B703A1; Thu, 9 Jun 2016 13:42:19 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B769B18A6; Thu, 9 Jun 2016 13:42:19 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59DgIvw083519; Thu, 9 Jun 2016 13:42:18 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59DgIAc083518; Thu, 9 Jun 2016 13:42:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606091342.u59DgIAc083518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 9 Jun 2016 13:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301731 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:42:20 -0000 Author: avos Date: Thu Jun 9 13:42:18 2016 New Revision: 301731 URL: https://svnweb.freebsd.org/changeset/base/301731 Log: net80211: discard an injected frame if it is smaller than header length. Do not try to pass such frames; a correct frame cannot be smaller than (the corresponding) header size. (for wpi(4) an additional check was added in r289012). PR: 144987 Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 9 13:36:31 2016 (r301730) +++ head/sys/net80211/ieee80211_output.c Thu Jun 9 13:42:18 2016 (r301731) @@ -608,6 +608,8 @@ ieee80211_output(struct ifnet *ifp, stru if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != IEEE80211_FC0_VERSION_0) senderr(EIO); /* XXX */ + if (m->m_pkthdr.len < ieee80211_anyhdrsize(wh)) + senderr(EIO); /* XXX */ /* locate destination node */ switch (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) { @@ -617,8 +619,6 @@ ieee80211_output(struct ifnet *ifp, stru break; case IEEE80211_FC1_DIR_TODS: case IEEE80211_FC1_DIR_DSTODS: - if (m->m_pkthdr.len < sizeof(struct ieee80211_frame)) - senderr(EIO); /* XXX */ ni = ieee80211_find_txnode(vap, wh->i_addr3); break; default: From owner-svn-src-all@freebsd.org Thu Jun 9 13:58:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC494B70883; Thu, 9 Jun 2016 13:58:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE5AC12B0; Thu, 9 Jun 2016 13:58:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59DwVp1087623; Thu, 9 Jun 2016 13:58:31 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59DwV0X087622; Thu, 9 Jun 2016 13:58:31 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201606091358.u59DwV0X087622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Thu, 9 Jun 2016 13:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301732 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 13:58:33 -0000 Author: cperciva Date: Thu Jun 9 13:58:31 2016 New Revision: 301732 URL: https://svnweb.freebsd.org/changeset/base/301732 Log: Switch from console="comconsole" to boot_multicons="YES" in EC2. Amazon recently introduced an API for capturing screenshots of an emulated VGA device; this commit makes that (somewhat) useful. MFC after: 3 weeks Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Thu Jun 9 13:42:18 2016 (r301731) +++ head/release/tools/ec2.conf Thu Jun 9 13:58:31 2016 (r301732) @@ -62,8 +62,10 @@ vm_extra_pre_umount() { echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf - # The EC2 console is an emulated serial port. - echo 'console="comconsole"' >> ${DESTDIR}/boot/loader.conf + # EC2 has two consoles: An emulated serial port ("system log"), + # which has been present since 2006; and a VGA console ("instance + # screenshot") which was introduced in 2016. + echo 'boot_multicons="YES"' >> ${DESTDIR}/boot/loader.conf # Some older EC2 hardware used a version of Xen with a bug in its # emulated serial port. It is not clear if EC2 still has any such From owner-svn-src-all@freebsd.org Thu Jun 9 14:09:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B7EB70BDF for ; Thu, 9 Jun 2016 14:09:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F8E91C1A for ; Thu, 9 Jun 2016 14:09:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id h190so35753106ith.1 for ; Thu, 09 Jun 2016 07:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mDgJYi7Ua4Rj4WmP/PG5QFn+efq97JtCOSLqsmUGuyA=; b=YX5gwIq5DJbaQdl0mlTv/SuPggZEljxVw5zjmcFshjZVsMDzx4NOx33hWFtrLIu4WW VBMygCCLZNs4iLuokNQuB+szwrPrj5f/dROQCzoVhKuE/TR3rvi8OijLLXGcQ11cWRDa sW/AsL0UVgkiBvt2HMcTT4KmFHDkkoqCJonnBODyNbGSngHsbcHgA65tna9GkfJ3h/lN RgvX0Km2uVvixSZBKoJ9q6dvJgIIcxvUyhL18WQPsiNdMlk8D1SGDT2rm0FKyhxXF712 oi1Lmx1a5Wn/S/on0F3t2iMNkf+Vf4PpUBRFIIwT3F0XJeWnTkzXMGbLDkg5lppNRD/Q qL6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=mDgJYi7Ua4Rj4WmP/PG5QFn+efq97JtCOSLqsmUGuyA=; b=XMg6ZAPl5a2dbMGZf5Vqs2KBoti7BbYLI2zD2Lj69NmSWCOe+YxQ4/SgH6hlC725Cr Lc8+GAs69/ZmLvSjifORf70CaV7vsYIjBwUmMTqlyb7yzVZ2xOblgGgv6qwa/66iv2hm bmQNrUcBlUzgMdc+I9/hPnpCzxDG9S5W14b7uoJIbMmiQ/aXlIY3IFbjJ9u3pRACt1bO fg1C27ujSuMS76DwzThC0pXcfMSGvIjsS/rjy8puS8sOdHNF8RY2oBQdBZW9Dmk2R5HJ hgmmD2iO+szCMqdnruYNbElxs7K9/aiDxsgLVneoYrefxJkWM43tevxC8RYlS+WWfhCV Hd5A== X-Gm-Message-State: ALyK8tIgBq8KBztLWPYrRCrrHhgwfUISmYU0WXjNbjMcnBKesl+n1IiDKMPxupMSVefpzA== X-Received: by 10.36.28.201 with SMTP id c192mr17224739itc.96.1465481347506; Thu, 09 Jun 2016 07:09:07 -0700 (PDT) Received: from [10.65.212.14] ([137.122.64.8]) by smtp.gmail.com with ESMTPSA id j137sm3255516ioe.18.2016.06.09.07.09.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jun 2016 07:09:06 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r301714 - head/sys/boot/efi/libefi From: Warner Losh In-Reply-To: <20160609144304.05437ef3d7f2fe9cd26704ac@bidouilliste.com> Date: Thu, 9 Jun 2016 10:09:06 -0400 Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <012000B7-2E79-48BE-B0AB-6C0D39DF8EAA@bsdimp.com> References: <201606090202.u5922pwl024436@repo.freebsd.org> <90D3441D-D130-4D00-A12D-F4D3B81E606B@bsdimp.com> <20160609144304.05437ef3d7f2fe9cd26704ac@bidouilliste.com> To: Emmanuel Vadot X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 14:09:08 -0000 We already have debugging framework for boot1.efi which we could use = here? I=E2=80=99m working on setting / getting of UEFI variables with support = for UEFI=E2=80=99s bootmgr protocol. That=E2=80=99s going to need some = way to debug it because it=E2=80=99s kinda complex... Warner > On Jun 9, 2016, at 8:43 AM, Emmanuel Vadot = wrote: >=20 >=20 > I wanted to more verbose in case of the system don't have partition o > n disk (or the EFI implementation only support raw disks like U-Boot) > but this might be a bad way of doing saw, I didn't think about the > implication you're talking about. I'll try to figure a better way to = do > this. >=20 > On Wed, 8 Jun 2016 22:21:36 -0400 > Warner Losh wrote: >=20 >>=20 >>> On Jun 8, 2016, at 10:02 PM, Emmanuel Vadot = wrote: >>>=20 >>> Author: manu >>> Date: Thu Jun 9 02:02:50 2016 >>> New Revision: 301714 >>> URL: https://svnweb.freebsd.org/changeset/base/301714 >>>=20 >>> Log: >>> Print a message when the efi disk isn't a logical partition. >>=20 >> Why on earth would you do that? This will print a message, one per = full disk, and our systems have 36 disks in them? >> Please consider backing this out... >>=20 >> Warner >>=20 >>=20 >>> Approved by: andrew (mentor) >>> Differential Revision: https://reviews.freebsd.org/D6782 >>>=20 >>> Modified: >>> head/sys/boot/efi/libefi/efipart.c >>>=20 >>> Modified: head/sys/boot/efi/libefi/efipart.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/boot/efi/libefi/efipart.c Thu Jun 9 01:50:43 2016 = (r301713) >>> +++ head/sys/boot/efi/libefi/efipart.c Thu Jun 9 02:02:50 2016 = (r301714) >>> @@ -119,8 +119,11 @@ efipart_init(void)=20 >>> (void**)&blkio); >>> if (EFI_ERROR(status)) >>> continue; >>> - if (!blkio->Media->LogicalPartition) >>> + if (!blkio->Media->LogicalPartition) { >>> + printf("%s%d isn't a logical partition, = skipping\n", >>> + efipart_dev.dv_name, n); >>> continue; >>> + } >>>=20 >>> /* >>> * If we come across a logical partition of subtype = CDROM >>>=20 >=20 >=20 > --=20 > Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Jun 9 14:10:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CBF7B70D0C; Thu, 9 Jun 2016 14:10:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8E0911EDA; Thu, 9 Jun 2016 14:10:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id C09FB124D; Thu, 9 Jun 2016 14:10:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Thu, 9 Jun 2016 14:10:25 +0000 From: Glen Barber To: "Simon J. Gerraty" Cc: svn-src-head@FreeBSD.org, stevek@juniper.net, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r301713 - head/sys/dev/random Message-ID: <20160609141025.GQ2323@FreeBSD.org> References: <201606090150.u591ohZa019497@repo.freebsd.org> <20160609130108.GN2323@FreeBSD.org> <90183.1465478734@kaos.jnpr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SvyA5ywaG/v2A5dH" Content-Disposition: inline In-Reply-To: <90183.1465478734@kaos.jnpr.net> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 14:10:43 -0000 --SvyA5ywaG/v2A5dH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 09, 2016 at 06:25:34AM -0700, Simon J. Gerraty wrote: > Glen Barber wrote: > > > =20 > > > -void read_rate_increment(u_int); > > > +void random_harvest_queue(const void *, u_int, u_int, > > > + enum random_entropy_source); > > > +void read_rate_increment(u_int); > > > =20 > > > #define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" > > > =20 > >=20 > > This breaks sparc64. >=20 > Looks like defined(DEV_RANDOM) is relevant. > Wrapping the prototype in random_harvestq.h in >=20 > #ifndef DEV_RANDOM >=20 > would avoid this issue. > But backing out until we check if that fixes the original issue steve > hit is probably best? >=20 IMHO, backing it out is the best solution for now, since a followup review will be required by so@ for a subsequent commit here. Glen --SvyA5ywaG/v2A5dH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXWXjRAAoJEAMUWKVHj+KTtQ4P/3wokoas8qRa8Lg922JAWVLY LM7o5/i0y9Yvx0pnYvxDiG5ksEiJ6gR8O7Mqasu1Ez8ajnXE1pn7IGNUTPKf9fcb w6FB78D6Bi1mxas0OeFe2HarL8JFNUQP4sCBxJNYWnqFARcsWr9qMlZpv3S0DKTW 2Oh+1jOZweJC7m/mO828mbs2guX6MGZ4pEDk1cDBvDPLNyK8d5AMM5E/RkEvzLx7 409Ko93mWsVK/RttolE2eV6QG0w9knSo4TST0a+rvvX80fxNf5SpqFc/OGrB0Xrr pDOW+f3G2Nnowgc0r1ZrABX+/qlnxhdFW/tNsuQpnSOjcBww5dJ15aj3PgyFr7Ew S5cL16idoF0BC0p4QsJACIX1FhveAXPJerPDn9+bS7Gp665ubsygL+dAHd+et23Q YOX5q8H1qMPq86A5gO/tPbsWoemiCqvqnig2qdjDx4ZdbvmpmecfhPjnEW3ziwh6 cXZfWQDvZPmcLEl6EoU2IewfvDiAaF0mO/oRhqLyFLWHdmwtZvbVKsXO1jKQB3OA SFX56R+jkw3OxcDjO+VGaHHr1pMWEThFnHZn9hPzHaTOtzzKzqdUGV0n05cu2lY4 yEo0+zRJ1/FsJBoVLkgTFzX6pZClZPN8SyyZrDWwMkbsc7YM9WiYRL0z+NGIDRR1 oRZ2mD77InMJXpG9uRTx =rBXV -----END PGP SIGNATURE----- --SvyA5ywaG/v2A5dH-- From owner-svn-src-all@freebsd.org Thu Jun 9 14:18:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32096B70F8D; Thu, 9 Jun 2016 14:18:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23F113D8; Thu, 9 Jun 2016 14:18:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59EIDTD094746; Thu, 9 Jun 2016 14:18:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59EIDga094745; Thu, 9 Jun 2016 14:18:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606091418.u59EIDga094745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 9 Jun 2016 14:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301733 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 14:18:14 -0000 Author: avos Date: Thu Jun 9 14:18:12 2016 New Revision: 301733 URL: https://svnweb.freebsd.org/changeset/base/301733 Log: rum(4): refresh manpage. Add a note about hardware encryption support (r288633), adhoc-demo mode (r288622) and remove BUGS section (fixed in r288632). Modified: head/share/man/man4/rum.4 Modified: head/share/man/man4/rum.4 ============================================================================== --- head/share/man/man4/rum.4 Thu Jun 9 13:58:31 2016 (r301732) +++ head/share/man/man4/rum.4 Thu Jun 9 14:18:12 2016 (r301733) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 13, 2008 +.Dd June 9, 2016 .Dt RUM 4 .Os .Sh NAME @@ -64,10 +64,14 @@ This chipset uses the MIMO (multiple-inp with multiple antennas to extend the operating range of the adapter and to achieve higher throughput. .Pp +All chips have hardware support for WEP, AES-CCM, TKIP, and Michael +cryptographic operations. +.Pp .Nm supports .Cm station , .Cm adhoc , +.Cm adhoc-demo , .Cm hostap , and .Cm monitor @@ -182,7 +186,3 @@ driver was written by .An Niall O'Higgins Aq Mt niallo@openbsd.org and .An Damien Bergamini Aq Mt damien@openbsd.org . -.Sh BUGS -Host AP mode doesn't support client power save. -Clients using power save mode will experience -packet loss (disabling power saving on the client will fix this). From owner-svn-src-all@freebsd.org Thu Jun 9 14:33:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3DBBB6F6A1; Thu, 9 Jun 2016 14:33:01 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7449211E4; Thu, 9 Jun 2016 14:33:01 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59EX0PS002115; Thu, 9 Jun 2016 14:33:00 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59EX0ht002113; Thu, 9 Jun 2016 14:33:00 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201606091433.u59EX0ht002113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 9 Jun 2016 14:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301734 - in head: lib/libc/rpc sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 14:33:01 -0000 Author: kevlo Date: Thu Jun 9 14:33:00 2016 New Revision: 301734 URL: https://svnweb.freebsd.org/changeset/base/301734 Log: Fix the rpcb_getaddr() definition to match its declaration. Submitted by: Sebastian Huber Modified: head/lib/libc/rpc/rpcb_clnt.c head/sys/rpc/rpcb_clnt.c Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Thu Jun 9 14:18:12 2016 (r301733) +++ head/lib/libc/rpc/rpcb_clnt.c Thu Jun 9 14:33:00 2016 (r301734) @@ -1010,7 +1010,7 @@ done: * * Assuming that the address is all properly allocated */ -int +bool_t rpcb_getaddr(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, struct netbuf *address, const char *host) { Modified: head/sys/rpc/rpcb_clnt.c ============================================================================== --- head/sys/rpc/rpcb_clnt.c Thu Jun 9 14:18:12 2016 (r301733) +++ head/sys/rpc/rpcb_clnt.c Thu Jun 9 14:33:00 2016 (r301734) @@ -1051,7 +1051,7 @@ done: * * Assuming that the address is all properly allocated */ -int +bool_t rpcb_getaddr(program, version, nconf, address, host) rpcprog_t program; rpcvers_t version; From owner-svn-src-all@freebsd.org Thu Jun 9 14:44:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55001B6FD0E; Thu, 9 Jun 2016 14:44:06 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 225F41C3F; Thu, 9 Jun 2016 14:44:06 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59Ei5pv005715; Thu, 9 Jun 2016 14:44:05 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Ei50p005714; Thu, 9 Jun 2016 14:44:05 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606091444.u59Ei50p005714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 9 Jun 2016 14:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301735 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 14:44:06 -0000 Author: sjg Date: Thu Jun 9 14:44:05 2016 New Revision: 301735 URL: https://svnweb.freebsd.org/changeset/base/301735 Log: Revert previous commit, until issue with sparc64 resolved. Approved by: so (implicit) Modified: head/sys/dev/random/random_harvestq.h Modified: head/sys/dev/random/random_harvestq.h ============================================================================== --- head/sys/dev/random/random_harvestq.h Thu Jun 9 14:33:00 2016 (r301734) +++ head/sys/dev/random/random_harvestq.h Thu Jun 9 14:44:05 2016 (r301735) @@ -43,9 +43,7 @@ struct harvest_event { uint8_t he_source; /* origin of the entropy */ } __packed; -void random_harvest_queue(const void *, u_int, u_int, - enum random_entropy_source); -void read_rate_increment(u_int); +void read_rate_increment(u_int); #define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" From owner-svn-src-all@freebsd.org Thu Jun 9 15:11:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F46AEF41D; Thu, 9 Jun 2016 15:11:54 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 151D11126; Thu, 9 Jun 2016 15:11:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (unknown [137.122.64.8]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 7DAA8D7A17; Thu, 9 Jun 2016 15:11:22 +0000 (UTC) Date: Thu, 9 Jun 2016 11:11:16 -0400 From: Andrew Turner To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301706 - head/sys/boot/efi Message-ID: <20160609111116.38055e82@zapp> In-Reply-To: References: <201606082323.u58NNGsP065228@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 15:11:54 -0000 On Wed, 8 Jun 2016 22:30:15 -0400 Warner Losh wrote: > > On Jun 8, 2016, at 7:23 PM, Andrew Turner > > wrote: > >=20 > > Author: andrew > > Date: Wed Jun 8 23:23:16 2016 > > New Revision: 301706 > > URL: https://svnweb.freebsd.org/changeset/base/301706 > >=20 > > Log: > > Also set -fshort-wchar on arm64, this fixes parsing strings from > > UEFI, e.g. on the command line. =20 >=20 > Maybe this could be used to fix the %S issue instead of the kludge > we=E2=80=99re now doing=E2=80=A6 It may still be needed for arm. The linker checks the compatibility of the attributes so we would need to set -fshort-wchar on all the loader components meaning it would need to be set on all arm loader implementations. Andrew From owner-svn-src-all@freebsd.org Thu Jun 9 15:19:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56275AEF637; Thu, 9 Jun 2016 15:19:49 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 238DF1667; Thu, 9 Jun 2016 15:19:49 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59FJmDp017294; Thu, 9 Jun 2016 15:19:48 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59FJm84017293; Thu, 9 Jun 2016 15:19:48 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606091519.u59FJm84017293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Thu, 9 Jun 2016 15:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301736 - head/contrib/blacklist/libexec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 15:19:49 -0000 Author: lidl Date: Thu Jun 9 15:19:48 2016 New Revision: 301736 URL: https://svnweb.freebsd.org/changeset/base/301736 Log: Add IPFW support to blacklistd-helper Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6753 Modified: head/contrib/blacklist/libexec/blacklistd-helper Modified: head/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- head/contrib/blacklist/libexec/blacklistd-helper Thu Jun 9 14:44:05 2016 (r301735) +++ head/contrib/blacklist/libexec/blacklistd-helper Thu Jun 9 15:19:48 2016 (r301736) @@ -16,6 +16,11 @@ for f in npf pf; do break fi done +if [ -f "/etc/ipfw-blacklist.rc" ]; then + pf="ipfw" + . /etc/ipfw-blacklist.rc + ipfw_offset=${ipfw_offset:-2000} +fi if [ -z "$pf" ]; then echo "$0: Unsupported packet filter" 1>&2 @@ -43,6 +48,13 @@ esac case "$1" in add) case "$pf" in + ipfw) + rule=$(( $ipfw_offset + $6 )) # use $ipfw_offset+$port for rule number + tname="port$6" + /sbin/ipfw table $tname create type addr 2>/dev/null + /sbin/ipfw -q table $tname add "$addr/$mask" + /sbin/ipfw -q add $rule drop $3 from "table("$tname")" to any dst-port $6 + ;; npf) /sbin/npfctl rule "$2" add block in final $proto from \ "$addr/$mask" to any $port @@ -57,6 +69,9 @@ add) ;; rem) case "$pf" in + ipfw) + /sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null + ;; npf) /sbin/npfctl rule "$2" rem-id "$7" ;; @@ -67,6 +82,9 @@ rem) ;; flush) case "$pf" in + ipfw) + /sbin/ipfw table "port$6" flush 2>/dev/null + ;; npf) /sbin/npfctl rule "$2" flush ;; From owner-svn-src-all@freebsd.org Thu Jun 9 15:34:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C989AEFB31; Thu, 9 Jun 2016 15:34:34 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D89316D8; Thu, 9 Jun 2016 15:34:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59FYXuF026070; Thu, 9 Jun 2016 15:34:33 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59FYX8H026069; Thu, 9 Jun 2016 15:34:33 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606091534.u59FYX8H026069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 9 Jun 2016 15:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301737 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 15:34:34 -0000 Author: jamie Date: Thu Jun 9 15:34:33 2016 New Revision: 301737 URL: https://svnweb.freebsd.org/changeset/base/301737 Log: Remove a comment that was part of copied code, and is misleading in the new location. Modified: head/sys/kern/sysv_msg.c Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Thu Jun 9 15:19:48 2016 (r301736) +++ head/sys/kern/sysv_msg.c Thu Jun 9 15:34:33 2016 (r301737) @@ -320,12 +320,6 @@ msgunload() #endif for (msqid = 0; msqid < msginfo.msgmni; msqid++) { - /* - * Look for an unallocated and unlocked msqid_ds. - * msqid_ds's can be locked by msgsnd or msgrcv while - * they are copying the message in/out. We can't - * re-use the entry until they release it. - */ msqkptr = &msqids[msqid]; if (msqkptr->u.msg_qbytes != 0 || (msqkptr->u.msg_perm.mode & MSG_LOCKED) != 0) From owner-svn-src-all@freebsd.org Thu Jun 9 15:43:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D62DAEFD3A; Thu, 9 Jun 2016 15:43:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBCF01C63; Thu, 9 Jun 2016 15:43:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59Fh0pf029619; Thu, 9 Jun 2016 15:43:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Fh0hn029618; Thu, 9 Jun 2016 15:43:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606091543.u59Fh0hn029618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 9 Jun 2016 15:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301738 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 15:43:02 -0000 Author: bdrewery Date: Thu Jun 9 15:43:00 2016 New Revision: 301738 URL: https://svnweb.freebsd.org/changeset/base/301738 Log: MFC r301465: Fix bmake version upgrade logic to use the new bmake. The '${WANT_MAKE} != "bmake"' logic seems wrong but is not being modified. Modified: stable/10/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Thu Jun 9 15:34:33 2016 (r301737) +++ stable/10/Makefile Thu Jun 9 15:43:00 2016 (r301738) @@ -155,9 +155,13 @@ HAVE_MAKE= bmake .else HAVE_MAKE= fmake .endif +.if ${HAVE_MAKE} != ${WANT_MAKE} || \ + (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) +NEED_MAKE_UPGRADE= t +.endif .if exists(${MYMAKE}) SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk -.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" +.elif defined(NEED_MAKE_UPGRADE) || ${WANT_MAKE} != "bmake" # It may not exist yet but we may cause it to. # In the case of fmake, upgrade_checks may cause a newer version to be built. SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ @@ -334,8 +338,7 @@ kernel: buildkernel installkernel # for building the world. # upgrade_checks: -.if ${HAVE_MAKE} != ${WANT_MAKE} || \ - (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) +.if defined(NEED_MAKE_UPGRADE) @${_+_}(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) .elif ${WANT_MAKE} == "fmake" @if ! (cd ${.CURDIR}/tools/build/make_check && \ From owner-svn-src-all@freebsd.org Thu Jun 9 16:05:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01DFBB6E492; Thu, 9 Jun 2016 16:05:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85D51C6B; Thu, 9 Jun 2016 16:05:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59G5erk037459; Thu, 9 Jun 2016 16:05:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59G5evI037458; Thu, 9 Jun 2016 16:05:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201606091605.u59G5evI037458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 9 Jun 2016 16:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301739 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:05:42 -0000 Author: imp Date: Thu Jun 9 16:05:40 2016 New Revision: 301739 URL: https://svnweb.freebsd.org/changeset/base/301739 Log: Improve debugging of xpt. Sponsored by: Netflix Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jun 9 15:43:00 2016 (r301738) +++ head/sys/cam/cam_xpt.c Thu Jun 9 16:05:40 2016 (r301739) @@ -309,6 +309,7 @@ static xpt_devicefunc_t xptsetasyncfunc; static xpt_busfunc_t xptsetasyncbusfunc; static cam_status xptregister(struct cam_periph *periph, void *arg); +static const char * xpt_action_name(uint32_t action); static __inline int device_is_queued(struct cam_ed *device); static __inline int @@ -812,6 +813,10 @@ xpt_rescan(union ccb *ccb) xpt_free_ccb(ccb); return; } + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("xpt_rescan: func %#x %s\n", ccb->ccb_h.func_code, + xpt_action_name(ccb->ccb_h.func_code))); + ccb->ccb_h.ppriv_ptr1 = ccb->ccb_h.cbfcnp; ccb->ccb_h.cbfcnp = xpt_rescan_done; xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, CAM_PRIORITY_XPT); @@ -2451,7 +2456,8 @@ xpt_action(union ccb *start_ccb) { CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, - ("xpt_action: func=%#x\n", start_ccb->ccb_h.func_code)); + ("xpt_action: func %#x %s\n", start_ccb->ccb_h.func_code, + xpt_action_name(start_ccb->ccb_h.func_code))); start_ccb->ccb_h.status = CAM_REQ_INPROG; (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); @@ -2466,7 +2472,8 @@ xpt_action_default(union ccb *start_ccb) path = start_ccb->ccb_h.path; CAM_DEBUG(path, CAM_DEBUG_TRACE, - ("xpt_action_default: func=%#x\n", start_ccb->ccb_h.func_code)); + ("xpt_action_default: func %#x %s\n", start_ccb->ccb_h.func_code, + xpt_action_name(start_ccb->ccb_h.func_code))); switch (start_ccb->ccb_h.func_code) { case XPT_SCSI_IO: @@ -3012,6 +3019,11 @@ call_sim: } break; } + CAM_DEBUG(path, CAM_DEBUG_TRACE, + ("xpt_action_default: func= %#x %s status %#x\n", + start_ccb->ccb_h.func_code, + xpt_action_name(start_ccb->ccb_h.func_code), + start_ccb->ccb_h.status)); } void @@ -4234,6 +4246,12 @@ xpt_async(u_int32_t async_code, struct c ccb->casync.async_code = async_code; ccb->casync.async_arg_size = 0; size = xpt_async_size(async_code); + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("xpt_async: func %#x %s aync_code %d %s\n", + ccb->ccb_h.func_code, + xpt_action_name(ccb->ccb_h.func_code), + async_code, + xpt_async_string(async_code))); if (size > 0 && async_arg != NULL) { ccb->casync.async_arg_ptr = malloc(size, M_CAMXPT, M_NOWAIT); if (ccb->casync.async_arg_ptr == NULL) { @@ -4441,7 +4459,11 @@ xpt_done(union ccb *done_ccb) struct cam_doneq *queue; int run, hash; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_done\n")); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("xpt_done: func= %#x %s status %#x\n", + done_ccb->ccb_h.func_code, + xpt_action_name(done_ccb->ccb_h.func_code), + done_ccb->ccb_h.status)); if ((done_ccb->ccb_h.func_code & XPT_FC_QUEUED) == 0) return; @@ -4463,7 +4485,8 @@ void xpt_done_direct(union ccb *done_ccb) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_done_direct\n")); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("xpt_done_direct: status %#x\n", done_ccb->ccb_h.status)); if ((done_ccb->ccb_h.func_code & XPT_FC_QUEUED) == 0) return; @@ -5050,6 +5073,9 @@ xpt_register_async(int event, ac_callbac xpt_action((union ccb *)&csa); status = csa.ccb_h.status; + CAM_DEBUG(csa.ccb_h.path, CAM_DEBUG_TRACE, + ("xpt_register_async: func %p\n", cbfunc)); + if (xptpath) { xpt_path_unlock(path); xpt_free_path(path); @@ -5301,3 +5327,67 @@ camisr_runqueue(void) mtx_unlock(&queue->cam_doneq_mtx); } } + +struct kv +{ + uint32_t v; + const char *name; +}; + +static struct kv map[] = { + { XPT_NOOP, "XPT_NOOP" }, + { XPT_SCSI_IO, "XPT_SCSI_IO" }, + { XPT_GDEV_TYPE, "XPT_GDEV_TYPE" }, + { XPT_GDEVLIST, "XPT_GDEVLIST" }, + { XPT_PATH_INQ, "XPT_PATH_INQ" }, + { XPT_REL_SIMQ, "XPT_REL_SIMQ" }, + { XPT_SASYNC_CB, "XPT_SASYNC_CB" }, + { XPT_SDEV_TYPE, "XPT_SDEV_TYPE" }, + { XPT_SCAN_BUS, "XPT_SCAN_BUS" }, + { XPT_DEV_MATCH, "XPT_DEV_MATCH" }, + { XPT_DEBUG, "XPT_DEBUG" }, + { XPT_PATH_STATS, "XPT_PATH_STATS" }, + { XPT_GDEV_STATS, "XPT_GDEV_STATS" }, + { XPT_DEV_ADVINFO, "XPT_DEV_ADVINFO" }, + { XPT_ASYNC, "XPT_ASYNC" }, + { XPT_ABORT, "XPT_ABORT" }, + { XPT_RESET_BUS, "XPT_RESET_BUS" }, + { XPT_RESET_DEV, "XPT_RESET_DEV" }, + { XPT_TERM_IO, "XPT_TERM_IO" }, + { XPT_SCAN_LUN, "XPT_SCAN_LUN" }, + { XPT_GET_TRAN_SETTINGS, "XPT_GET_TRAN_SETTINGS" }, + { XPT_SET_TRAN_SETTINGS, "XPT_SET_TRAN_SETTINGS" }, + { XPT_CALC_GEOMETRY, "XPT_CALC_GEOMETRY" }, + { XPT_ATA_IO, "XPT_ATA_IO" }, + { XPT_GET_SIM_KNOB, "XPT_GET_SIM_KNOB" }, + { XPT_SET_SIM_KNOB, "XPT_SET_SIM_KNOB" }, + { XPT_SMP_IO, "XPT_SMP_IO" }, + { XPT_SCAN_TGT, "XPT_SCAN_TGT" }, + { XPT_ENG_INQ, "XPT_ENG_INQ" }, + { XPT_ENG_EXEC, "XPT_ENG_EXEC" }, + { XPT_EN_LUN, "XPT_EN_LUN" }, + { XPT_TARGET_IO, "XPT_TARGET_IO" }, + { XPT_ACCEPT_TARGET_IO, "XPT_ACCEPT_TARGET_IO" }, + { XPT_CONT_TARGET_IO, "XPT_CONT_TARGET_IO" }, + { XPT_IMMED_NOTIFY, "XPT_IMMED_NOTIFY" }, + { XPT_NOTIFY_ACK, "XPT_NOTIFY_ACK" }, + { XPT_IMMEDIATE_NOTIFY, "XPT_IMMEDIATE_NOTIFY" }, + { XPT_NOTIFY_ACKNOWLEDGE, "XPT_NOTIFY_ACKNOWLEDGE" }, + { 0, 0 } +}; + +static const char * +xpt_action_name(uint32_t action) +{ + static char buffer[32]; /* Only for unknown messages -- racy */ + struct kv *walker = map; + + while (walker->name != NULL) { + if (walker->v == action) + return (walker->name); + walker++; + } + + snprintf(buffer, sizeof(buffer), "%#x", action); + return (buffer); +} From owner-svn-src-all@freebsd.org Thu Jun 9 16:05:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE2E8B6E4D6; Thu, 9 Jun 2016 16:05:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D68E1D91; Thu, 9 Jun 2016 16:05:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59G5nWD037506; Thu, 9 Jun 2016 16:05:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59G5nL4037504; Thu, 9 Jun 2016 16:05:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201606091605.u59G5nL4037504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 9 Jun 2016 16:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301740 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:05:51 -0000 Author: imp Date: Thu Jun 9 16:05:49 2016 New Revision: 301740 URL: https://svnweb.freebsd.org/changeset/base/301740 Log: Add NVME IO type. Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Jun 9 16:05:40 2016 (r301739) +++ head/sys/cam/cam_ccb.h Thu Jun 9 16:05:49 2016 (r301740) @@ -204,6 +204,9 @@ typedef enum { XPT_SMP_IO = 0x1b | XPT_FC_DEV_QUEUED, /* Serial Management Protocol */ + XPT_NVME_IO = 0x1c | XPT_FC_DEV_QUEUED, + /* Execiute the requestred NVMe I/O operation */ + XPT_SCAN_TGT = 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_FC_XPT_ONLY, /* Scan Target */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jun 9 16:05:40 2016 (r301739) +++ head/sys/cam/cam_xpt.c Thu Jun 9 16:05:49 2016 (r301740) @@ -5361,6 +5361,7 @@ static struct kv map[] = { { XPT_ATA_IO, "XPT_ATA_IO" }, { XPT_GET_SIM_KNOB, "XPT_GET_SIM_KNOB" }, { XPT_SET_SIM_KNOB, "XPT_SET_SIM_KNOB" }, + { XPT_NVME_IO, "XPT_NVME_IO" }, { XPT_SMP_IO, "XPT_SMP_IO" }, { XPT_SCAN_TGT, "XPT_SCAN_TGT" }, { XPT_ENG_INQ, "XPT_ENG_INQ" }, From owner-svn-src-all@freebsd.org Thu Jun 9 16:05:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA12B6E514; Thu, 9 Jun 2016 16:05:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6AE1EEA; Thu, 9 Jun 2016 16:05:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59G5uNS037553; Thu, 9 Jun 2016 16:05:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59G5u1O037551; Thu, 9 Jun 2016 16:05:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201606091605.u59G5u1O037551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 9 Jun 2016 16:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301741 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:05:58 -0000 Author: imp Date: Thu Jun 9 16:05:56 2016 New Revision: 301741 URL: https://svnweb.freebsd.org/changeset/base/301741 Log: Add place holder for SDIO CAM stuff for CCB XPT type. Sponsored by: Netflix Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Jun 9 16:05:49 2016 (r301740) +++ head/sys/cam/cam_ccb.h Thu Jun 9 16:05:56 2016 (r301741) @@ -207,6 +207,9 @@ typedef enum { XPT_NVME_IO = 0x1c | XPT_FC_DEV_QUEUED, /* Execiute the requestred NVMe I/O operation */ + XPT_MMCSD_IO = 0x1d | XPT_FC_DEV_QUEUED, + /* Placeholder for MMC / SD / SDIO I/O stuff */ + XPT_SCAN_TGT = 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_FC_XPT_ONLY, /* Scan Target */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jun 9 16:05:49 2016 (r301740) +++ head/sys/cam/cam_xpt.c Thu Jun 9 16:05:56 2016 (r301741) @@ -5362,6 +5362,7 @@ static struct kv map[] = { { XPT_GET_SIM_KNOB, "XPT_GET_SIM_KNOB" }, { XPT_SET_SIM_KNOB, "XPT_SET_SIM_KNOB" }, { XPT_NVME_IO, "XPT_NVME_IO" }, + { XPT_MMCSD_IO, "XPT_MMCSD_IO" }, { XPT_SMP_IO, "XPT_SMP_IO" }, { XPT_SCAN_TGT, "XPT_SCAN_TGT" }, { XPT_ENG_INQ, "XPT_ENG_INQ" }, From owner-svn-src-all@freebsd.org Thu Jun 9 16:15:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56C23B6E7EF; Thu, 9 Jun 2016 16:15:02 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26CFB147E; Thu, 9 Jun 2016 16:15:02 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59GF1ZS041299; Thu, 9 Jun 2016 16:15:01 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59GF1Ae041298; Thu, 9 Jun 2016 16:15:01 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606091615.u59GF1Ae041298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 9 Jun 2016 16:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301742 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:15:02 -0000 Author: royger Date: Thu Jun 9 16:15:01 2016 New Revision: 301742 URL: https://svnweb.freebsd.org/changeset/base/301742 Log: xen/timer: re-introduce the inittodr call in the resume path r298930 removed the inittodr call, but it seems like this prevents "calcru: runtime went backwards ..." messages from occasionally appearing when resuming from migration. Reported by: Karl Pielorz Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Thu Jun 9 16:05:56 2016 (r301741) +++ head/sys/dev/xen/timer/timer.c Thu Jun 9 16:15:01 2016 (r301742) @@ -477,6 +477,9 @@ xentimer_resume(device_t dev) /* Reset the last uptime value */ pvclock_resume(); + /* Reset the RTC clock */ + inittodr(time_second); + /* Kick the timers on all CPUs */ smp_rendezvous(NULL, xentimer_percpu_resume, NULL, dev); From owner-svn-src-all@freebsd.org Thu Jun 9 16:29:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3C6B7005A; Thu, 9 Jun 2016 16:29:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7971C94; Thu, 9 Jun 2016 16:29:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59GTJAU045071; Thu, 9 Jun 2016 16:29:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59GTJXv045070; Thu, 9 Jun 2016 16:29:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606091629.u59GTJXv045070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 9 Jun 2016 16:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301743 - stable/10/usr.bin/indent X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:29:20 -0000 Author: pfg Date: Thu Jun 9 16:29:19 2016 New Revision: 301743 URL: https://svnweb.freebsd.org/changeset/base/301743 Log: MFC r301513: indent(1): Fix old typo. It's typedef, not typdef. Obtained from: NetBSD (CVS rev. 1.14) Modified: stable/10/usr.bin/indent/lexi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/indent/lexi.c ============================================================================== --- stable/10/usr.bin/indent/lexi.c Thu Jun 9 16:15:01 2016 (r301742) +++ stable/10/usr.bin/indent/lexi.c Thu Jun 9 16:29:19 2016 (r301743) @@ -79,7 +79,7 @@ struct templ specials[1000] = {"double", 4}, {"long", 4}, {"short", 4}, - {"typdef", 4}, + {"typedef", 4}, {"unsigned", 4}, {"register", 4}, {"static", 4}, From owner-svn-src-all@freebsd.org Thu Jun 9 16:30:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919B8B700EA; Thu, 9 Jun 2016 16:30:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63BBD1DEA; Thu, 9 Jun 2016 16:30:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59GURPJ045177; Thu, 9 Jun 2016 16:30:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59GURdu045176; Thu, 9 Jun 2016 16:30:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606091630.u59GURdu045176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 9 Jun 2016 16:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301744 - stable/9/usr.bin/indent X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:30:28 -0000 Author: pfg Date: Thu Jun 9 16:30:27 2016 New Revision: 301744 URL: https://svnweb.freebsd.org/changeset/base/301744 Log: MFC r301513: indent(1): Fix old typo. It's typedef, not typdef. Obtained from: NetBSD (CVS rev. 1.14) Modified: stable/9/usr.bin/indent/lexi.c Directory Properties: stable/9/usr.bin/indent/ (props changed) Modified: stable/9/usr.bin/indent/lexi.c ============================================================================== --- stable/9/usr.bin/indent/lexi.c Thu Jun 9 16:29:19 2016 (r301743) +++ stable/9/usr.bin/indent/lexi.c Thu Jun 9 16:30:27 2016 (r301744) @@ -79,7 +79,7 @@ struct templ specials[1000] = {"double", 4}, {"long", 4}, {"short", 4}, - {"typdef", 4}, + {"typedef", 4}, {"unsigned", 4}, {"register", 4}, {"static", 4}, From owner-svn-src-all@freebsd.org Thu Jun 9 16:41:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AED4B7034D; Thu, 9 Jun 2016 16:41:43 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2DDE1364; Thu, 9 Jun 2016 16:41:42 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59GfgiE052025; Thu, 9 Jun 2016 16:41:42 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59GfgbF052024; Thu, 9 Jun 2016 16:41:42 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606091641.u59GfgbF052024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 9 Jun 2016 16:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301745 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 16:41:43 -0000 Author: jamie Date: Thu Jun 9 16:41:41 2016 New Revision: 301745 URL: https://svnweb.freebsd.org/changeset/base/301745 Log: Make sure the OSD methods for jail set and remove can't run concurrently, by holding allprison_lock exclusively (even if only for a moment before downgrading) on all paths that call PR_METHOD_REMOVE. Since they may run on a downgraded lock, it's still possible for them to run concurrently with PR_METHOD_GET, which will need to use the prison lock. Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Jun 9 16:30:27 2016 (r301744) +++ head/sys/kern/kern_jail.c Thu Jun 9 16:41:41 2016 (r301745) @@ -2383,7 +2383,14 @@ sys_jail_attach(struct thread *td, struc if (error) return (error); - sx_slock(&allprison_lock); + /* + * Start with exclusive hold on allprison_lock to ensure that a possible + * PR_METHOD_REMOVE call isn't concurrent with jail_set or jail_remove. + * But then immediately downgrade it since we don't need to stop + * readers. + */ + sx_xlock(&allprison_lock); + sx_downgrade(&allprison_lock); pr = prison_find_child(td->td_ucred->cr_prison, uap->jid); if (pr == NULL) { sx_sunlock(&allprison_lock); @@ -2601,9 +2608,11 @@ prison_complete(void *context, int pendi { struct prison *pr = context; + sx_xlock(&allprison_lock); mtx_lock(&pr->pr_mtx); prison_deref(pr, pr->pr_uref - ? PD_DEREF | PD_DEUREF | PD_LOCKED : PD_LOCKED); + ? PD_DEREF | PD_DEUREF | PD_LOCKED | PD_LIST_XLOCKED + : PD_LOCKED | PD_LIST_XLOCKED); } /* @@ -2647,13 +2656,8 @@ prison_deref(struct prison *pr, int flag */ if (lasturef) { if (!(flags & (PD_LIST_SLOCKED | PD_LIST_XLOCKED))) { - if (ref > 1) { - sx_slock(&allprison_lock); - flags |= PD_LIST_SLOCKED; - } else { - sx_xlock(&allprison_lock); - flags |= PD_LIST_XLOCKED; - } + sx_xlock(&allprison_lock); + flags |= PD_LIST_XLOCKED; } (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); mtx_lock(&pr->pr_mtx); From owner-svn-src-all@freebsd.org Thu Jun 9 17:03:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BDBDB709AA; Thu, 9 Jun 2016 17:03:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9B7126E; Thu, 9 Jun 2016 17:03:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59H33gi059723; Thu, 9 Jun 2016 17:03:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59H33v6059722; Thu, 9 Jun 2016 17:03:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606091703.u59H33v6059722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 9 Jun 2016 17:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301746 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 17:03:04 -0000 Author: emaste Date: Thu Jun 9 17:03:03 2016 New Revision: 301746 URL: https://svnweb.freebsd.org/changeset/base/301746 Log: Use -L to specify compat32 library paths instead of -Y -Y is an uncommon linker option that is rather similar to -L. In discussion with Peter it seems early amd64 development might have required the -Y-specific behaviour, but it is no longer necessary. Switch to -L which is more widely supported and much more commonly used, to make it easier to link the FreeBSD base system with linkers other than ld.bfd. Submitted by: Rafael Ávila de Espíndola Differential Revision: https://reviews.freebsd.org/D6681 Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Jun 9 16:41:41 2016 (r301745) +++ head/Makefile.libcompat Thu Jun 9 17:03:03 2016 (r301746) @@ -19,7 +19,7 @@ LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH MACHINE_CPU="i686 mmx sse sse2" LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ - LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ + LD="${XLD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" \ OBJCOPY="${XOBJCOPY}" .elif ${TARGET_ARCH} == "powerpc64" From owner-svn-src-all@freebsd.org Thu Jun 9 17:10:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D09B70B36; Thu, 9 Jun 2016 17:10:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478A21799; Thu, 9 Jun 2016 17:10:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59HAJKN060152; Thu, 9 Jun 2016 17:10:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59HAJiK060150; Thu, 9 Jun 2016 17:10:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201606091710.u59HAJiK060150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 9 Jun 2016 17:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301747 - in head/sys: boot/fdt/dts/arm modules/dtb/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 17:10:20 -0000 Author: manu Date: Thu Jun 9 17:10:19 2016 New Revision: 301747 URL: https://svnweb.freebsd.org/changeset/base/301747 Log: Add PCDuino3b dts. It uses the pcduino3 dts from upstream and adds the hdmi node, axp gpio and changes the phy mode to rgmii. Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D6775 Added: head/sys/boot/fdt/dts/arm/pcduino3b.dts (contents, props changed) Modified: head/sys/modules/dtb/allwinner/Makefile Added: head/sys/boot/fdt/dts/arm/pcduino3b.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/pcduino3b.dts Thu Jun 9 17:10:19 2016 (r301747) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "sun7i-a20-pcduino3.dts" +#include "sun7i-a20-hdmi.dtsi" +#include "xpowers-axp209.dtsi" + +/ { + soc@01c00000 { + hdmi@01c16000 { + status = "okay"; + }; + + hdmiaudio { + status = "okay"; + }; + }; +}; + +&gmac { + pinctrl-0 = <&gmac_pins_rgmii_a>; + phy-mode = "rgmii"; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Thu Jun 9 17:03:03 2016 (r301746) +++ head/sys/modules/dtb/allwinner/Makefile Thu Jun 9 17:10:19 2016 (r301747) @@ -7,6 +7,7 @@ DTS= \ cubieboard2.dts \ olimex-a20-som-evb.dts \ olinuxino-lime.dts \ + pcduino3b.dts \ sinovoip-bpi-m3.dts .include From owner-svn-src-all@freebsd.org Thu Jun 9 17:26:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9FA1B70EC6; Thu, 9 Jun 2016 17:26:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 945D61691; Thu, 9 Jun 2016 17:26:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59HQslQ067430; Thu, 9 Jun 2016 17:26:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59HQsl7067429; Thu, 9 Jun 2016 17:26:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606091726.u59HQsl7067429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 9 Jun 2016 17:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301748 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 17:26:55 -0000 Author: avos Date: Thu Jun 9 17:26:54 2016 New Revision: 301748 URL: https://svnweb.freebsd.org/changeset/base/301748 Log: urtwn(4): refresh manpage. Mention URTWN_WITHOUT_UCODE option (r295871), hardware encryption support (r292175), IBSS (r290651) and HOSTAP (r290631) mode support; cleanup CAVEATS section (some 11n support was added in r297175 + add a note about current rate control issues). Modified: head/share/man/man4/urtwn.4 Modified: head/share/man/man4/urtwn.4 ============================================================================== --- head/share/man/man4/urtwn.4 Thu Jun 9 17:10:19 2016 (r301747) +++ head/share/man/man4/urtwn.4 Thu Jun 9 17:26:54 2016 (r301748) @@ -14,13 +14,15 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2015 +.Dd June 9, 2016 .Dt URTWN 4 .Os .Sh NAME .Nm urtwn .Nd Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device .Sh SYNOPSIS +.Cd "options URTWN_WITHOUT_UCODE" +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -39,13 +41,6 @@ module at boot time, place the following .Bd -literal -offset indent if_urtwn_load="YES" .Ed -.Pp -In both cases, place the following line in -.Xr loader.conf 5 -to acknowledge the firmware license (see below): -.Bd -literal -offset indent -legal.realtek.license_ack=1 -.Ed .Sh DESCRIPTION The .Nm @@ -64,15 +59,21 @@ The RTL8192CU is a highly integrated mul RF in a single chip. It operates in the 2GHz spectrum only. .Pp -This driver requires the firmware built with the -.Nm urtwnfw -module to work. -For the loaded firmware to be enabled for use the license at -.Pa /usr/share/doc/legal/realtek.LICENSE -must be agreed by adding the following line to -.Xr loader.conf 5 : +All chips have hardware support for WEP, AES-CCM and TKIP encryption. +.Pp +The driver supports +.Cm station , +.Cm adhoc , +.Cm hostap , +and +.Cm monitor +mode operation. +Only one virtual interface may be configured at any time. .Pp -.Dl "legal.realtek.license_ack=1" +This driver may use the firmware built with the +.Nm urtwnfw +module for some additional features +(when URTWN_WITHOUT_UCODE kernel option is not set). .Sh FILES .Bl -tag -width ".Pa /usr/share/doc/legal/realtek.LICENSE" -compact .It Pa /usr/share/doc/legal/realtek.LICENSE @@ -117,6 +118,28 @@ Join a specific BSS network with 64-bit ifconfig wlan create wlandev urtwn0 ssid my_net \e wepmode on wepkey 0x1234567890 weptxkey 1 up .Ed +.Pp +Create an IBSS network with 128-bit WEP encryption on the channel 4: +.Bd -literal -offset indent +ifconfig wlan0 create wlandev urtwn0 wlanmode adhoc ssid my_net \e + wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 \e + channel 4 +.Ed +.Pp +Join/create an 802.11b IBSS network with network name +.Dq Li my_net : +.Bd -literal -offset indent +ifconfig wlan0 create wlandev urtwn0 wlanmode adhoc +ifconfig wlan0 inet 192.168.0.22 netmask 0xffffff00 ssid my_net \e + mode 11b +.Ed +.Pp +Create an 802.11g host-based access point: +.Bd -literal -offset indent +ifconfig wlan0 create wlandev urtwn0 wlanmode hostap +ifconfig wlan0 inet 192.168.0.10 netmask 0xffffff00 ssid my_ap \e + mode 11g +.Ed .Sh DIAGNOSTICS .Bl -diag .It "urtwn%d: error %d, could not read firmware %s" @@ -134,6 +157,7 @@ This should not happen. .Xr urtwnfw 4 , .Xr usb 4 , .Xr wlan 4 , +.Xr wlan_amrr 4 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 , @@ -158,5 +182,9 @@ driver was written by .Sh CAVEATS The .Nm -driver does not support any of the 802.11n capabilities offered by the -adapters. +driver currently does not support A-MPDU 802.11n transmit aggregation. +.Pp +For non-RTL8188EUS chips +.Dq "rate control" +algorithm is absent; this may result in increased packet loss in noisy +networks. From owner-svn-src-all@freebsd.org Thu Jun 9 18:11:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35ABAB70AD0; Thu, 9 Jun 2016 18:11:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06ED2111D; Thu, 9 Jun 2016 18:11:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59IBgNe085647; Thu, 9 Jun 2016 18:11:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59IBgx9085646; Thu, 9 Jun 2016 18:11:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606091811.u59IBgx9085646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 9 Jun 2016 18:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301749 - head/contrib/netbsd-tests/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 18:11:43 -0000 Author: ngie Date: Thu Jun 9 18:11:42 2016 New Revision: 301749 URL: https://svnweb.freebsd.org/changeset/base/301749 Log: Add debug output to aid in determining why `goodResult` != `result` MFC after: 1 week PR: 210619 (for diagnosis) Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Thu Jun 9 17:26:54 2016 (r301748) +++ head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Thu Jun 9 18:11:42 2016 (r301749) @@ -108,7 +108,12 @@ ATF_TC_BODY(memcpy_basic, tc) if (i != j) runTest(start[i], start[j]); MD5End(mc, result); +#ifdef __NetBSD__ ATF_REQUIRE_EQ(strcmp(result, goodResult), 0); +#else + ATF_REQUIRE_EQ_MSG(strcmp(result, goodResult), 0, "%s != %s", + result, goodResult); +#endif } ATF_TC(memccpy_simple); From owner-svn-src-all@freebsd.org Thu Jun 9 18:24:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDEBFB70E64; Thu, 9 Jun 2016 18:24:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09AB1BA6; Thu, 9 Jun 2016 18:24:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59IOp0R090284; Thu, 9 Jun 2016 18:24:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59IOp0E090283; Thu, 9 Jun 2016 18:24:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606091824.u59IOp0E090283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 9 Jun 2016 18:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301750 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 18:24:53 -0000 Author: cem Date: Thu Jun 9 18:24:51 2016 New Revision: 301750 URL: https://svnweb.freebsd.org/changeset/base/301750 Log: kvprintf: Pad %*c to width, like %*s Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Jun 9 18:11:42 2016 (r301749) +++ head/sys/kern/subr_prf.c Thu Jun 9 18:24:51 2016 (r301750) @@ -730,7 +730,15 @@ reswitch: switch (ch = (u_char)*fmt++) { PCHAR('>'); break; case 'c': + width -= 1; + + if (!ladjust && width > 0) + while (width--) + PCHAR(padc); PCHAR(va_arg(ap, int)); + if (ladjust && width > 0) + while (width--) + PCHAR(padc); break; case 'D': up = va_arg(ap, u_char *); From owner-svn-src-all@freebsd.org Thu Jun 9 18:27:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB83B70ECC; Thu, 9 Jun 2016 18:27:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BBFA1D54; Thu, 9 Jun 2016 18:27:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59IRflO090423; Thu, 9 Jun 2016 18:27:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59IRfD1090422; Thu, 9 Jun 2016 18:27:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201606091827.u59IRfD1090422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 9 Jun 2016 18:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301751 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 18:27:42 -0000 Author: cem Date: Thu Jun 9 18:27:41 2016 New Revision: 301751 URL: https://svnweb.freebsd.org/changeset/base/301751 Log: Add DDB command "kldstat" It prints much the same information as kldstat(8) without any arguments. Suggested by: jhibbits Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Jun 9 18:24:51 2016 (r301750) +++ head/sys/kern/kern_linker.c Thu Jun 9 18:27:41 2016 (r301751) @@ -54,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB +#include +#endif + #include #include @@ -1256,6 +1260,23 @@ kern_kldstat(struct thread *td, int file return (0); } +#ifdef DDB +DB_COMMAND(kldstat, db_kldstat) +{ + linker_file_t lf; + +#define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2)) + db_printf("Id Refs Address%*c Size Name\n", POINTER_WIDTH - 7, ' '); +#undef POINTER_WIDTH + TAILQ_FOREACH(lf, &linker_files, link) { + if (db_pager_quit) + return; + db_printf("%2d %4d %p %-8zx %s\n", lf->id, lf->refs, + lf->address, lf->size, lf->filename); + } +} +#endif /* DDB */ + int sys_kldfirstmod(struct thread *td, struct kldfirstmod_args *uap) { From owner-svn-src-all@freebsd.org Thu Jun 9 18:28:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A6DAB70F2B; Thu, 9 Jun 2016 18:28:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 125671EDE; Thu, 9 Jun 2016 18:28:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id z189so161736110itg.0; Thu, 09 Jun 2016 11:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=SFdoni+baLNxJpJ5O0PbpHZh9E7jgL5tuTnFz0ilEjc=; b=WKKJK1h/6MzlXyxfarqnXlGafWmGWnoymZqfnst/XbPEtoQOCTcms4wG4MZNrCgg4o DqV3DuG1iJ889KH4LSpQNinbXaGNh3b/KjkYSdsnjV+hskpxVwpDPfWeQkujGVqjYA9b BjVJfnd2Ccjhz18rOQgYuEy60yEQSe3EcDfetm0TS4z58Apiws3cETc6SWtJfAjXYY4D uwsFxJJvshRnxhEoU3DK4AGo2Q07hBZYqcYiIeDrZzmqgV7evcugBcGJu17gf4EMmEeT i1DNToX5rPEeYbQs22AU31m/cJECxi7B4Kdqaqfh5b6UGi4ScxhV0FBtiXqFJUjvEb/B zcjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=SFdoni+baLNxJpJ5O0PbpHZh9E7jgL5tuTnFz0ilEjc=; b=fpbmkLPTa/34qdQowriCX2vBSlIig73DVe2ftGt2EFOI514lHmPSAfznfywZfj5O6Y 7ee/mp6bj9m2h0Br9P0G+fLovInDZg4OXHShSreKfAT49t3x015bgL4HMxxFaPJSA7Lj H05IJ4dnmY63qh38tOTIJaCKCzcHVvucUKubI9pUIxIqUcxFDq0tMLWk4HOJk+iH5z90 2K7z+uRp22/AF2JEQ5tFjT55aQEWEGUlMJ6xTJJPyBom9pAuQ+D7GEfl918OH/WX3Ld5 wTklVual/fxPed/h7MXoaZKX4RkzbLUASdzA2pMWU5EvS56FMvQBRzEWvGLFN+hstGQb BULg== X-Gm-Message-State: ALyK8tJdfEf349WlivGB6TCFGIfNw3z9iQ471BlWgDu+tzubxpvU79JtMW4KUlgkC1TdaQ== X-Received: by 10.36.1.144 with SMTP id 138mr19211169itk.35.1465496925110; Thu, 09 Jun 2016 11:28:45 -0700 (PDT) Received: from [10.65.210.107] ([137.122.64.8]) by smtp.gmail.com with ESMTPSA id d200sm3732343ioe.19.2016.06.09.11.28.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2016 11:28:44 -0700 (PDT) Subject: Re: svn commit: r301751 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F7727A45-4376-408D-A1CA-83B693280B14"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201606091827.u59IRfD1090422@repo.freebsd.org> Date: Thu, 9 Jun 2016 14:28:42 -0400 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201606091827.u59IRfD1090422@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 18:28:46 -0000 --Apple-Mail=_F7727A45-4376-408D-A1CA-83B693280B14 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jun 9, 2016, at 14:27, Conrad E. Meyer wrote: > > Author: cem > Date: Thu Jun 9 18:27:41 2016 > New Revision: 301751 > URL: https://svnweb.freebsd.org/changeset/base/301751 > > Log: > Add DDB command "kldstat" > > It prints much the same information as kldstat(8) without any arguments. > > Suggested by: jhibbits > Sponsored by: EMC / Isilon Storage Division Manpage? --Apple-Mail=_F7727A45-4376-408D-A1CA-83B693280B14 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXWbVbAAoJEPWDqSZpMIYVVj0QALEPcZwXzIPcS75Ka0sw5bcW wdTHJXIcwqUqgB/BXv7/mnzQSyXfOZrkI4aPozMkOXjdsp0I/d2WrQ6FNBwe0mTZ PC8BtSrH0QBdcODuYRZWWA6zpJfsbJPnkfDKFidXRq9In97B4ncAd7ysrIM19MLE 5OZAVU7TmkzaDSAXAfVuZ5d9tSpBgCBit/MVshGTfu7ZYalVfCas3feA73AbQnJV XYHoS8hoQod9H0uuqfVlLiANHUR0uG1uM0yFSv2iNnXwRvKJ5dBaTdV4Ij0MUCaR JXs8Hdoy3+6+6TcDHlarkO35ph3eyPC6mJMq4NOU4RccrphSaerlDL5lzau60Up1 ETaCOhCaJXjQBs4zu2pzYavnp5H8V77RMMcMZS35ZniLPMGd99ucmaq6g6YhcPqu XiquihOwol6EiTelyDfwFwjHBAvm6cjk4o9hIz8iUU3E5kdlikbA2zEKcKsAkKY/ hlRlk/VlbhL/7oUEgWttwGDNkoPVyM1rDOeWdJwIQHjmUGaX7RL7gCVx4eH1uHw4 6XeyJea+ezlIR5p7TrWaDi1SLUtkE2Ko5U2AW+5KMeONXg22DcsMf2l/S8mYnNNY OUmUtdpkZkSNmsqJ6B/TJjxny22xO1thhCNHrwWxbXsjcVYqXG7V3KwswY+DRnLG ZRIMiAx52bLKS5GhgQuj =D/fV -----END PGP SIGNATURE----- --Apple-Mail=_F7727A45-4376-408D-A1CA-83B693280B14-- From owner-svn-src-all@freebsd.org Thu Jun 9 18:35:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0486B70211; Thu, 9 Jun 2016 18:35:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD8BD1792; Thu, 9 Jun 2016 18:35:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59IZbWe094148; Thu, 9 Jun 2016 18:35:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59IZbtB094147; Thu, 9 Jun 2016 18:35:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606091835.u59IZbtB094147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 9 Jun 2016 18:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301752 - head/contrib/netbsd-tests/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 18:35:39 -0000 Author: ngie Date: Thu Jun 9 18:35:37 2016 New Revision: 301752 URL: https://svnweb.freebsd.org/changeset/base/301752 Log: Update `goodResult` after recent changes made to the PRNG in libc The PRNG was changed in r300953/r300956, and subsequently, the numbers generated have changed. This is expected ABI breakage per ache X-MFC with: r300953, r300956 Tested with: amd64, i386 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Thu Jun 9 18:27:41 2016 (r301751) +++ head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Thu Jun 9 18:35:37 2016 (r301752) @@ -54,7 +54,7 @@ char result[100]; #ifdef __NetBSD__ const char goodResult[] = "7b405d24bc03195474c70ddae9e1f8fb"; #else -const char goodResult[] = "217b4fbe456916bf62a2f85df752e4ab"; +const char goodResult[] = "5ab4443f0e3e058d94087d9f2a11ef5e"; #endif static void From owner-svn-src-all@freebsd.org Thu Jun 9 18:36:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B394B702B2; Thu, 9 Jun 2016 18:36:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 525A91AB4; Thu, 9 Jun 2016 18:36:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x233.google.com with SMTP id 5so45835664ioy.1; Thu, 09 Jun 2016 11:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Z06H3IML/KMjSJvFbM4q6gg4Yds1mzJyXfQ1JiOAGgk=; b=w/jLMa5c+CDL7wbA3wl7774KczuDUdgXEmAbuS7gePrAFsc8S8KXzp57Rt3O0FigQI UxKQTUj0afD03yW3UMKeJwwi7xIcQuW4w9ylS+2hIdCNOL2KoagTty3rZIlBVeaD8h9n 1om4xXWzxKK3V1xF3I5ddjr9Hdm/n3yyJk9MXMDUCUpIoUskOL+DSrH18AIJtSDwDa79 tfi1Gu3Lw4/r1BR6VDWpR24BSbCJ+iR2J6hQpkYPaFSjGNMwfKtKshUBnd3s+pWFomBx O/yAQw1K1uYkFwgNwZJn+YT7zbKT/KtDIzfDzjdJrLB5dBy15W9JmcUCfrZf5oJtwfh5 gBlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Z06H3IML/KMjSJvFbM4q6gg4Yds1mzJyXfQ1JiOAGgk=; b=EfiL9IKWAMHHYrizTipGMqCVqMALLg9TebFS0Z6Oht9oJC5lPjy6ISwChNhdlUT01g 2bPs0SCLAUTH33B1JAWt8dYrvyIZz/9XPzDbEXJKlx1zrbL/3yk2fLSOF0QA3FfuR9EE Ex2zF7LRhv3YYU226qOVLqszsfOKze1XxjGJQv+BWOX4wRREDXgE/bgXYVBKA9sswc1o vom79SWe5Dbj16dOc2HS0+uOlTZZLD9e+w4OKUjbPvraZQTkrrrYq6F342ACeDZxZ2AB aTPihP44M4By5I1JHDi5BYcilpmCEgmKcCPvI5+fbVm4BQGYpe/+ZpDMTn+XZQsk4A25 XbqQ== X-Gm-Message-State: ALyK8tIrQWpgMfZeXDoZLL/4cmv1wb33ymT0XnC4tGDLKqZz6hRht/sn1wwbhwduMnjInw== X-Received: by 10.107.132.144 with SMTP id o16mr19501247ioi.37.1465497391705; Thu, 09 Jun 2016 11:36:31 -0700 (PDT) Received: from [10.65.210.107] ([137.122.64.8]) by smtp.gmail.com with ESMTPSA id j37sm3768656iod.4.2016.06.09.11.36.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2016 11:36:30 -0700 (PDT) Subject: Re: svn commit: r301752 - head/contrib/netbsd-tests/lib/libc/string Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2FA0FB7B-DD3D-4C15-A364-FE2F2E44BEC0"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201606091835.u59IZbtB094147@repo.freebsd.org> Date: Thu, 9 Jun 2016 14:36:30 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <9A94E119-FB87-4550-A879-70E30254E8A8@gmail.com> References: <201606091835.u59IZbtB094147@repo.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 18:36:32 -0000 --Apple-Mail=_2FA0FB7B-DD3D-4C15-A364-FE2F2E44BEC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 9, 2016, at 14:35, Garrett Cooper wrote: >=20 > Author: ngie > Date: Thu Jun 9 18:35:37 2016 > New Revision: 301752 > URL: https://svnweb.freebsd.org/changeset/base/301752 >=20 > Log: > Update `goodResult` after recent changes made to the PRNG in libc >=20 > The PRNG was changed in r300953/r300956, and subsequently, the = numbers > generated have changed. This is expected ABI breakage per ache >=20 > X-MFC with: r300953, r300956 > Tested with: amd64, i386 > Sponsored by: EMC / Isilon Storage Division Forgot to add =E2=80=9CPR: 210169=E2=80=9D. Thanks, -Ngie --Apple-Mail=_2FA0FB7B-DD3D-4C15-A364-FE2F2E44BEC0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXWbcuAAoJEPWDqSZpMIYVdp8QALsMeuJXaf4fJBnPGFzVV2Z7 ZIbPnNhZlpbr9ttima2b491tV4lySkr6Dl3lwFZpO2RZumZVN6H6R4z0aMjpfCyI Y5cPNYu9AdKOLbts8wKQUWWegldEjcX22x2PQaTy2zICenRsg5XOEGqFclPoVenZ yUKudHaR8Wgn+RO897ci5hawUFpL1doN8Rpgrj7e4k+zAi7zHvdDV+fOx2P9oec/ wQoPNq82iY1NyvljEX+LZqmYd0e9ZDNZd33OFyljqTGpukFsmwNKTj8Ozs3iLH3e 9t9EKol31CgmTm2on+zCXHE5ql/qjGUqylyCAfKV8ni6E8miXjQxDzW6y0ymdfIW ERxgpGz3nzqYFyuwzLNU9DVQQddjv404U7LA7qdvHMjd2kYGoSMg2adoT4FRpfdQ aCj6/yxc/JnId7tkt6El2v6Reo65awUA5BFrX1jVMjAYg8JHFDSUGNp0Xjh7+DAW cZvqou3Ail7iegs77MSOcF0F8BUKeMAkaDGR1ol/IL0p53UMrmPLaHihxQH+cYDg b84sY99my9xP5sdcE2YNY2JM1hnYDilmUmhcPKjffGUSSkneHj/eZG7UMAgat6a0 JtLmjJ+1az0YF0O+s3Ad3JopsIi6a+pXpovHHwC8SNmC7rztPyNINwxwyvnialVc X6x0koWJt4QDB+Eb2+YS =v1CD -----END PGP SIGNATURE----- --Apple-Mail=_2FA0FB7B-DD3D-4C15-A364-FE2F2E44BEC0-- From owner-svn-src-all@freebsd.org Thu Jun 9 19:12:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8EE3B70E20; Thu, 9 Jun 2016 19:12:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2AA11775; Thu, 9 Jun 2016 19:12:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59JCpWA009265; Thu, 9 Jun 2016 19:12:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59JCpke009264; Thu, 9 Jun 2016 19:12:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606091912.u59JCpke009264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 9 Jun 2016 19:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301753 - head/contrib/netbsd-tests/lib/libc/db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 19:12:52 -0000 Author: ngie Date: Thu Jun 9 19:12:51 2016 New Revision: 301753 URL: https://svnweb.freebsd.org/changeset/base/301753 Log: Fix up r274061 Detect /usr/share/dict/words the "right way" by using require.files instead of the hacked up attempt in the dict(..) function, which didn't work properly on systems where MK_DICT == no. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/db/t_db.sh Modified: head/contrib/netbsd-tests/lib/libc/db/t_db.sh ============================================================================== --- head/contrib/netbsd-tests/lib/libc/db/t_db.sh Thu Jun 9 18:35:37 2016 (r301752) +++ head/contrib/netbsd-tests/lib/libc/db/t_db.sh Thu Jun 9 19:12:51 2016 (r301753) @@ -37,6 +37,7 @@ dict() elif [ -f /usr/dict/words ]; then echo /usr/dict/words else + echo "" atf_fail "no dictionary found" fi } @@ -44,12 +45,7 @@ dict() # Begin FreeBSD dict() { - if [ -f /usr/share/dict/words ]; then - echo /usr/share/dict/words - else - echo /nonexistent - atf_skip "Test requires dict/words" - fi + echo /usr/share/dict/words } # End FreeBSD @@ -62,6 +58,9 @@ small_btree_head() "Checks btree database using small keys and small data" \ "pairs: takes the first hundred entries in the dictionary," \ "and makes them be key/data pairs." + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } small_btree_body() { @@ -88,6 +87,9 @@ small_hash_head() "Checks hash database using small keys and small data" \ "pairs: takes the first hundred entries in the dictionary," \ "and makes them be key/data pairs." + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } small_hash_body() { @@ -114,6 +116,9 @@ small_recno_head() "Checks recno database using small keys and small data" \ "pairs: takes the first hundred entries in the dictionary," \ "and makes them be key/data pairs." + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } small_recno_body() { @@ -138,6 +143,9 @@ medium_btree_head() "Checks btree database using small keys and medium" \ "data pairs: takes the first 200 entries in the" \ "dictionary, and gives them each a medium size data entry." + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } medium_btree_body() { @@ -166,6 +174,9 @@ medium_hash_head() "Checks hash database using small keys and medium" \ "data pairs: takes the first 200 entries in the" \ "dictionary, and gives them each a medium size data entry." + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } medium_hash_body() { @@ -731,6 +742,9 @@ small_page_btree_head() "reverses them, and gives them each a small size data" \ "entry. Uses a small page size to make sure the btree" \ "split code gets hammered." + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } small_page_btree_body() { @@ -784,6 +798,9 @@ atf_test_case byte_orders_btree byte_orders_btree_head() { atf_set "descr" "Checks btree database using differing byte orders" + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } byte_orders_btree_body() { @@ -816,6 +833,9 @@ bsize_ffactor_head() atf_set "timeout" "480" atf_set "descr" "Checks hash database with various" \ "bucketsizes and fill factors" + # Begin FreeBSD + atf_set "require.files" /usr/share/dict/words + # End FreeBSD } bsize_ffactor_body() { From owner-svn-src-all@freebsd.org Thu Jun 9 19:44:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB89EB705B5; Thu, 9 Jun 2016 19:44:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6418416CA; Thu, 9 Jun 2016 19:44:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59Jilbk020236; Thu, 9 Jun 2016 19:44:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Jilxs020234; Thu, 9 Jun 2016 19:44:47 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606091944.u59Jilxs020234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 9 Jun 2016 19:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301754 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 19:44:48 -0000 Author: pfg Date: Thu Jun 9 19:44:47 2016 New Revision: 301754 URL: https://svnweb.freebsd.org/changeset/base/301754 Log: libc/rpc: Make use of some xdr_* macros. xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but were fixed in r296394. Give them some use hoping they help make the code somewhat more readable. Modified: head/lib/libc/rpc/rpc_prot.c head/lib/libc/rpc/rpcb_prot.c Modified: head/lib/libc/rpc/rpc_prot.c ============================================================================== --- head/lib/libc/rpc/rpc_prot.c Thu Jun 9 19:12:51 2016 (r301753) +++ head/lib/libc/rpc/rpc_prot.c Thu Jun 9 19:44:47 2016 (r301754) @@ -217,8 +217,8 @@ xdr_callhdr(XDR *xdrs, struct rpc_msg *c (xdrs->x_op == XDR_ENCODE) && xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && xdr_enum(xdrs, (enum_t *) prm_direction) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) ) + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_rpcprog(xdrs, &(cmsg->rm_call.cb_prog)) ) return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers))); return (FALSE); } Modified: head/lib/libc/rpc/rpcb_prot.c ============================================================================== --- head/lib/libc/rpc/rpcb_prot.c Thu Jun 9 19:12:51 2016 (r301753) +++ head/lib/libc/rpc/rpcb_prot.c Thu Jun 9 19:44:47 2016 (r301754) @@ -56,10 +56,10 @@ __FBSDID("$FreeBSD$"); bool_t xdr_rpcb(XDR *xdrs, RPCB *objp) { - if (!xdr_u_int32_t(xdrs, &objp->r_prog)) { + if (!xdr_rpcprog(xdrs, &objp->r_prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->r_vers)) { + if (!xdr_rpcvers(xdrs, &objp->r_vers)) { return (FALSE); } if (!xdr_string(xdrs, &objp->r_netid, (u_int)~0)) { @@ -243,13 +243,13 @@ xdr_rpcb_rmtcallargs(XDR *xdrs, struct r buf = XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } } else { From owner-svn-src-all@freebsd.org Thu Jun 9 20:02:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27ED4B70B68; Thu, 9 Jun 2016 20:02:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5431146A; Thu, 9 Jun 2016 20:02:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59K2WW7027792; Thu, 9 Jun 2016 20:02:32 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59K2WHO027789; Thu, 9 Jun 2016 20:02:32 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606092002.u59K2WHO027789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 9 Jun 2016 20:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301755 - vendor/ldns-host/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 20:02:33 -0000 Author: des Date: Thu Jun 9 20:02:31 2016 New Revision: 301755 URL: https://svnweb.freebsd.org/changeset/base/301755 Log: upstream hg 0289cde234a0 Modified: vendor/ldns-host/dist/Makefile vendor/ldns-host/dist/ldns-host.1 vendor/ldns-host/dist/ldns-host.c Modified: vendor/ldns-host/dist/Makefile ============================================================================== --- vendor/ldns-host/dist/Makefile Thu Jun 9 19:44:47 2016 (r301754) +++ vendor/ldns-host/dist/Makefile Thu Jun 9 20:02:31 2016 (r301755) @@ -6,11 +6,11 @@ LOCALBASE?=/usr/local PREFIX?=${LOCALBASE} MANDIR?=${PREFIX}/man -XCFLAGS=${CFLAGS} -I${LOCALBASE}/include +XCFLAGS=${CFLAGS} -I${LOCALBASE}/include -std=c99 -Wall -Wextra -pedantic XLDFLAGS=${LDFLAGS} -L${LOCALBASE}/lib -lldns ${PROG}: ${SRC} - ${CC} -o $@ ${XCFLAGS} ${XLDFLAGS} ${SRC} + ${CC} -o $@ ${XCFLAGS} ${SRC} ${XLDFLAGS} clean: rm -f ${PROG} Modified: vendor/ldns-host/dist/ldns-host.1 ============================================================================== --- vendor/ldns-host/dist/ldns-host.1 Thu Jun 9 19:44:47 2016 (r301754) +++ vendor/ldns-host/dist/ldns-host.1 Thu Jun 9 20:02:31 2016 (r301755) @@ -236,9 +236,6 @@ commands, while .Sq host from BIND9 uses whatever command was specified last. .It -Multi-packet zone transfers are not supported; only the first -response packet is printed. -.It .Sq Pseudosection TSIG is missing from verbose packet output. .El Modified: vendor/ldns-host/dist/ldns-host.c ============================================================================== --- vendor/ldns-host/dist/ldns-host.c Thu Jun 9 19:44:47 2016 (r301754) +++ vendor/ldns-host/dist/ldns-host.c Thu Jun 9 20:02:31 2016 (r301755) @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -156,11 +157,108 @@ memerr: } static ldns_status +ldns_tcp_start(ldns_resolver *res, ldns_pkt *qpkt, int nameserver) { + /* This routine is based on ldns_axfr_start, with the major + * difference in that it takes a query packet explicitly. + */ + struct sockaddr_storage *ns = NULL; + size_t ns_len = 0; + ldns_buffer *qbuf = NULL; + ldns_status status; + + ns = ldns_rdf2native_sockaddr_storage( + res->_nameservers[nameserver], ldns_resolver_port(res), &ns_len); + if (ns == NULL) { + status = LDNS_STATUS_MEM_ERR; + goto error; + } + + res->_socket = ldns_tcp_connect( + ns, (socklen_t)ns_len, ldns_resolver_timeout(res)); + if (res->_socket <= 0) { + status = LDNS_STATUS_ADDRESS_ERR; + goto error; + } + + qbuf = ldns_buffer_new(LDNS_MAX_PACKETLEN); + if (qbuf == NULL) { + status = LDNS_STATUS_MEM_ERR; + goto error; + } + + status = ldns_pkt2buffer_wire(qbuf, qpkt); + if (status != LDNS_STATUS_OK) + goto error; + + if (ldns_tcp_send_query(qbuf, res->_socket, ns, (socklen_t)ns_len) == 0) { + status = LDNS_STATUS_NETWORK_ERR; + goto error; + } + + ldns_buffer_free(qbuf); + free(ns); + return LDNS_STATUS_OK; + +error: + ldns_buffer_free(qbuf); + free(ns); + if (res->_socket > 0) { + close(res->_socket); + res->_socket = 0; + } + return status; +} + +static ldns_status +ldns_tcp_read(ldns_pkt **answer, ldns_resolver *res) { + ldns_status status; + struct timeval t1, t2; + uint8_t *data; + size_t size; + + if (res->_socket <= 0) + return LDNS_STATUS_ERR; + + gettimeofday(&t1, NULL); + data = ldns_tcp_read_wire_timeout( + res->_socket, &size, ldns_resolver_timeout(res)); + if (data == NULL) + goto error; + + status = ldns_wire2pkt(answer, data, size); + free(data); + if (status != LDNS_STATUS_OK) + goto error; + + gettimeofday(&t2, NULL); + ldns_pkt_set_querytime(*answer, + (uint32_t)((t2.tv_sec - t1.tv_sec)*1000) + + (t2.tv_usec - t1.tv_usec)/1000); + ldns_pkt_set_timestamp(*answer, t2); + return status; + +error: + close(res->_socket); + res->_socket = 0; + return LDNS_STATUS_ERR; +} + +static void +ldns_tcp_close(ldns_resolver *res) { + if (res->_socket > 0) { + close(res->_socket); + res->_socket = 0; + } +} + +static ldns_status ldns_resolver_send_to(ldns_pkt **answer, ldns_resolver *res, const ldns_rdf *name, ldns_rr_type t, ldns_rr_class c, - uint16_t flags, uint32_t ixfr_serial, int nameserver) { - ldns_status status; + uint16_t flags, uint32_t ixfr_serial, int nameserver, + bool close_tcp) { + ldns_status status = LDNS_STATUS_OK; ldns_pkt *qpkt; + struct timeval now; int nscnt = ldns_resolver_nameserver_count(res); ldns_rdf **ns = ldns_resolver_nameservers(res); @@ -170,12 +268,38 @@ ldns_resolver_send_to(ldns_pkt **answer, ldns_resolver_set_rtt(res, &rtt[nameserver]); ldns_resolver_set_nameserver_count(res, 1); - status = ldns_resolver_prepare_query_pkt(&qpkt, res, name, t, c, flags); - if (status == LDNS_STATUS_OK && t == LDNS_RR_TYPE_IXFR) + /* The next fragment should have been a call to + * ldns_resolver_prepare_query_pkt(), but starting with ldns + * version 1.6.17 that function tries to add it's own SOA + * records when rr_type is LDNS_RR_TYPE_IXFR, and we don't + * want that. + */ + qpkt = ldns_pkt_query_new(ldns_rdf_clone(name), t, c, flags); + if (qpkt == NULL) { + status = LDNS_STATUS_ERR; + goto done; + } + now.tv_sec = time(NULL); + now.tv_usec = 0; + ldns_pkt_set_timestamp(qpkt, now); + ldns_pkt_set_random_id(qpkt); + + if (t == LDNS_RR_TYPE_IXFR) { status = ldns_pkt_push_rr_soa(qpkt, LDNS_SECTION_AUTHORITY, name, c, ixfr_serial); - if (status == LDNS_STATUS_OK) + if (status != LDNS_STATUS_OK) goto done; + } + if (close_tcp) { status = ldns_resolver_send_pkt(answer, res, qpkt); + } else { + status = ldns_tcp_start(res, qpkt, 0); + if (status != LDNS_STATUS_OK) goto done; + status = ldns_tcp_read(answer, res); + if (status != LDNS_STATUS_OK) goto done; + ldns_pkt_set_answerfrom(*answer, ldns_rdf_clone(ns[0])); + } + +done: ldns_pkt_free(qpkt); ldns_resolver_set_nameservers(res, ns); @@ -198,11 +322,11 @@ ldns_pkt_filter_answer(ldns_pkt *pkt, ld rrtype = ldns_rr_get_type(rr); if (type == LDNS_RR_TYPE_ANY || type == rrtype || - type == LDNS_RR_TYPE_AXFR && + (type == LDNS_RR_TYPE_AXFR && (rrtype == LDNS_RR_TYPE_A || rrtype == LDNS_RR_TYPE_AAAA || rrtype == LDNS_RR_TYPE_NS || - rrtype == LDNS_RR_TYPE_PTR)) + rrtype == LDNS_RR_TYPE_PTR))) ldns_rr_list_set_rr(rrlist, rr, j++); } ldns_rr_list_set_rr_count(rrlist, j); @@ -435,7 +559,7 @@ print_received_line(ldns_resolver *res, #define DEFAULT_TCP_TIMEOUT 10 #define DEFAULT_UDP_TIMEOUT 5 -enum operation_mode { M_AXFR, M_DEFAULT_Q, M_SINGLE_Q, M_SOA }; +enum operation_mode { M_AXFR, M_IXFR, M_DEFAULT_Q, M_SINGLE_Q, M_SOA }; static enum operation_mode o_mode = M_DEFAULT_Q; static bool o_ignore_servfail = true; @@ -451,15 +575,15 @@ static int o_ipversion = LDNS_RESOLV_INE static int o_ndots = 1; static int o_retries = 1; static ldns_rr_class o_rrclass = LDNS_RR_CLASS_IN; -static ldns_rr_type o_rrtype = LDNS_RR_TYPE_A; +static ldns_rr_type o_rrtype = (ldns_rr_type)-1; static time_t o_timeout = 0; static uint32_t o_ixfr_serial = 0; static void usage(void) { - fputs( - "Usage: ldns-host [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n" - " [-t type] [-W wait] name [server]\n" + fprintf(stderr, + "Usage: %s [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n" + " %*c [-t type] [-W wait] name [server]\n" "\t-a same as -v -t ANY\n" "\t-C query SOA records from all authoritative name servers\n" "\t-c use this query class (IN, CH, HS, etc)\n" @@ -477,7 +601,7 @@ usage(void) { "\t-W wait this many seconds for a reply\n" "\t-4 use IPv4 only\n" "\t-6 use IPv6 only\n", - stderr); + progname, (int)strlen(progname), ' '); exit(1); } @@ -510,7 +634,8 @@ parse_args(int argc, char *argv[]) { case 'i': o_ip6_int = true; break; case 'l': o_mode = M_AXFR; - o_rrtype = LDNS_RR_TYPE_AXFR; + if (o_rrtype == (ldns_rr_type)-1) + o_rrtype = LDNS_RR_TYPE_AXFR; o_tcp = true; break; case 'N': @@ -539,13 +664,15 @@ parse_args(int argc, char *argv[]) { if (o_rrtype <= 0) die(2, "invalid type: %s\n", optarg); } - if (o_rrtype == LDNS_RR_TYPE_AXFR || o_rrtype == LDNS_RR_TYPE_IXFR) - o_tcp = true; if (o_rrtype == LDNS_RR_TYPE_AXFR) { o_mode = M_AXFR; o_rrtype = LDNS_RR_TYPE_ANY; o_verbose = true; } + if (o_rrtype == LDNS_RR_TYPE_IXFR) { + o_mode = M_IXFR; + o_rrtype = LDNS_RR_TYPE_ANY; + } break; case 'v': o_verbose = true; break; case 'w': @@ -571,6 +698,8 @@ parse_args(int argc, char *argv[]) { o_server = argv[1]; o_print_pkt_server = true; } + if (o_rrtype == (ldns_rr_type)-1) + o_rrtype = LDNS_RR_TYPE_A; } static ldns_rdf* @@ -599,7 +728,7 @@ safe_dname_cat_clone(const ldns_rdf *rd1 } static bool -query(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt) { +query(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, bool close_tcp) { ldns_status status; ldns_pkt_rcode rcode; int i, cnt; @@ -611,7 +740,8 @@ query(ldns_resolver *res, ldns_rdf *doma } for (cnt = ldns_resolver_nameserver_count(res), i = 0; i < cnt; i++) { status = ldns_resolver_send_to(pkt, res, domain, o_rrtype, - o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i); + o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i, + close_tcp); if (status != LDNS_STATUS_OK) { *pkt = NULL; continue; @@ -621,7 +751,8 @@ query(ldns_resolver *res, ldns_rdf *doma printf(";; Truncated, retrying in TCP mode.\n"); ldns_resolver_set_usevc(res, true); status = ldns_resolver_send_to(pkt, res, domain, o_rrtype, - o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i); + o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i, + close_tcp); ldns_resolver_set_usevc(res, false); if (status != LDNS_STATUS_OK) continue; @@ -639,16 +770,17 @@ query(ldns_resolver *res, ldns_rdf *doma } static ldns_rdf * -search(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, bool absolute) { +search(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, + bool absolute, bool close_tcp) { ldns_rdf *dname, **searchlist; int i, n; - if (absolute && query(res, domain, pkt)) + if (absolute && query(res, domain, pkt, close_tcp)) return domain; if ((dname = ldns_resolver_domain(res)) != NULL) { dname = safe_dname_cat_clone(domain, dname); - if (query(res, dname, pkt)) + if (query(res, dname, pkt, close_tcp)) return dname; } @@ -656,11 +788,11 @@ search(ldns_resolver *res, ldns_rdf *dom n = ldns_resolver_searchlist_count(res); for (i = 0; i < n; i++) { dname = safe_dname_cat_clone(domain, searchlist[i]); - if (query(res, dname, pkt)) + if (query(res, dname, pkt, close_tcp)) return dname; } - if (!absolute && query(res, domain, pkt)) + if (!absolute && query(res, domain, pkt, close_tcp)) return domain; return NULL; @@ -688,7 +820,7 @@ report(ldns_resolver *res, ldns_rdf *dom print_pkt_verbose(pkt); } else { print_pkt_short(pkt, o_print_rr_server); - if (o_mode != M_DEFAULT_Q && + if (o_mode == M_SINGLE_Q && ldns_rr_list_rr_count(ldns_pkt_answer(pkt)) == 0) { print_rdf_nodot(domain); printf(" has no "); @@ -706,7 +838,7 @@ doquery(ldns_resolver *res, ldns_rdf *do ldns_pkt *pkt; bool q; - q = query(res, domain, &pkt); + q = query(res, domain, &pkt, true); report(res, domain, pkt); return q; } @@ -716,7 +848,7 @@ doquery_filtered(ldns_resolver *res, ldn ldns_pkt *pkt; bool q; - q = query(res, domain, &pkt); + q = query(res, domain, &pkt, true); ldns_pkt_filter_answer(pkt, o_rrtype); report(res, domain, pkt); return q; @@ -727,7 +859,7 @@ dosearch(ldns_resolver *res, ldns_rdf *d ldns_pkt *pkt; ldns_rdf *dname; - dname = search(res, domain, &pkt, absolute); + dname = search(res, domain, &pkt, absolute, true); report(res, dname != NULL ? dname : domain, pkt); return o_mode != M_DEFAULT_Q ? (dname != NULL) : (dname != NULL) && @@ -736,17 +868,44 @@ dosearch(ldns_resolver *res, ldns_rdf *d } static bool -doaxfr(ldns_resolver *res, ldns_rdf *domain, bool absolute) { - ldns_pkt *pkt; +dozonetransfer(ldns_resolver *res, ldns_rdf *domain, bool absolute) { + ldns_pkt *pkt, *nextpkt; ldns_rdf *dname; ldns_rr_type rrtype; + ldns_rr_list *rrl; + int i, nsoa = 0; rrtype = o_rrtype; - o_rrtype = LDNS_RR_TYPE_AXFR; - dname = search(res, domain, &pkt, absolute); - ldns_pkt_filter_answer(pkt, rrtype); - report(res, dname != NULL ? dname : domain, pkt); - return dname != NULL; + o_rrtype = (o_mode == M_AXFR) ? LDNS_RR_TYPE_AXFR : LDNS_RR_TYPE_IXFR; + dname = search(res, domain, &pkt, absolute, false); + + for (;;) { + rrl = ldns_pkt_answer(pkt); + for (i = ldns_rr_list_rr_count(rrl) - 1; i >= 0; i--) { + if (ldns_rr_get_type(ldns_rr_list_rr(rrl, i)) == LDNS_RR_TYPE_SOA) + nsoa++; + } + ldns_pkt_filter_answer(pkt, rrtype); + report(res, dname != NULL ? dname : domain, pkt); + if ((dname == NULL) || + (ldns_pkt_get_rcode(pkt) != LDNS_RCODE_NOERROR)) { + printf("; Transfer failed.\n"); + ldns_tcp_close(res); + return false; + } + if (nsoa >= 2) { + ldns_tcp_close(res); + return true; + } + if (ldns_tcp_read(&nextpkt, res) != LDNS_STATUS_OK) { + printf("; Transfer failed.\n"); + return false; + } + ldns_pkt_set_answerfrom(nextpkt, + ldns_rdf_clone(ldns_pkt_answerfrom(pkt))); + ldns_pkt_free(pkt); + pkt = nextpkt; + } } static bool @@ -757,7 +916,7 @@ dosoa(ldns_resolver *res, ldns_rdf *doma ldns_rr *rr; size_t i, j, n, cnt; - if ((dname = search(res, domain, &pkt, absolute)) == NULL) + if ((dname = search(res, domain, &pkt, absolute, true)) == NULL) return false; answer = ldns_pkt_answer(pkt); @@ -776,10 +935,10 @@ dosoa(ldns_resolver *res, ldns_rdf *doma for (j = 0; j < cnt; j++) { ldns_resolver_remove_nameservers(res); rr = ldns_rr_list_rr(nsaddrs[i], j); - if (ldns_resolver_ip6(res) == LDNS_RESOLV_INET && - ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA || - ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 && - ldns_rr_get_type(rr) == LDNS_RR_TYPE_A) + if ((ldns_resolver_ip6(res) == LDNS_RESOLV_INET && + ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) || + (ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 && + ldns_rr_get_type(rr) == LDNS_RR_TYPE_A)) continue; if (ldns_resolver_push_nameserver_rr(res, rr) == LDNS_STATUS_OK) /* bind9-host queries for domain, not dname here */ @@ -876,6 +1035,9 @@ main(int argc, char *argv[]) { o_rrtype = LDNS_RR_TYPE_PTR; return !doquery(res, dname); } - return !(o_mode == M_SOA ? dosoa : o_mode == M_AXFR ? doaxfr : dosearch) + return !(o_mode == M_SOA ? dosoa : + o_mode == M_AXFR ? dozonetransfer : + o_mode == M_IXFR ? dozonetransfer : + dosearch) (res, safe_str2rdf_dname(o_name), ndots(o_name) >= o_ndots); } From owner-svn-src-all@freebsd.org Thu Jun 9 20:05:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6533B70BFB; Thu, 9 Jun 2016 20:05:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DAF01757; Thu, 9 Jun 2016 20:05:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59K5J5h027936; Thu, 9 Jun 2016 20:05:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59K5Jwo027935; Thu, 9 Jun 2016 20:05:19 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606092005.u59K5Jwo027935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 9 Jun 2016 20:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301756 - vendor/ldns-host/hg-20160501-0289cde234a0 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 20:05:20 -0000 Author: des Date: Thu Jun 9 20:05:19 2016 New Revision: 301756 URL: https://svnweb.freebsd.org/changeset/base/301756 Log: Tag 20160501-0289cde234a0 Added: vendor/ldns-host/hg-20160501-0289cde234a0/ - copied from r301755, vendor/ldns-host/dist/ From owner-svn-src-all@freebsd.org Thu Jun 9 20:23:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67792B70FE7; Thu, 9 Jun 2016 20:23:31 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39A6312F2; Thu, 9 Jun 2016 20:23:31 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59KNUZf035086; Thu, 9 Jun 2016 20:23:30 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59KNUCi035085; Thu, 9 Jun 2016 20:23:30 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606092023.u59KNUCi035085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Thu, 9 Jun 2016 20:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301757 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 20:23:31 -0000 Author: oshogbo Date: Thu Jun 9 20:23:30 2016 New Revision: 301757 URL: https://svnweb.freebsd.org/changeset/base/301757 Log: Define tunable instead of using CTLFLAG_RWTUN flag with kern.corefile. The allproc_lock lock used in the sysctl_kern_corefile function is initialized in the procinit function which is called after setting sysctl values at boot. That means if we set kern.corefile at boot we will be trying to use lock with is uninitialized and machine will crash. If we define kern.corefile as tunable instead of using CTFLAG_RWTUN we will not call the sysctl_kern_corefile function and we will not use an uninitialized lock. When machine will boot then we will start using function depending on the lock. Reviewed by: pjd Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Jun 9 20:05:19 2016 (r301756) +++ head/sys/kern/kern_sig.c Thu Jun 9 20:23:30 2016 (r301757) @@ -3123,6 +3123,7 @@ static int compress_user_cores = 0; #define corefilename_lock allproc_lock static char corefilename[MAXPATHLEN] = {"%N.core"}; +TUNABLE_STR("kern.corefile", corefilename, sizeof(corefilename)); static int sysctl_kern_corefile(SYSCTL_HANDLER_ARGS) @@ -3136,7 +3137,7 @@ sysctl_kern_corefile(SYSCTL_HANDLER_ARGS return (error); } -SYSCTL_PROC(_kern, OID_AUTO, corefile, CTLTYPE_STRING | CTLFLAG_RWTUN | +SYSCTL_PROC(_kern, OID_AUTO, corefile, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_corefile, "A", "Process corefile name format string"); From owner-svn-src-all@freebsd.org Thu Jun 9 20:39:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AA1EB704C9; Thu, 9 Jun 2016 20:39:58 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF211F95; Thu, 9 Jun 2016 20:39:58 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59KdvbJ039348; Thu, 9 Jun 2016 20:39:57 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Kdv8Y039347; Thu, 9 Jun 2016 20:39:57 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606092039.u59Kdv8Y039347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 9 Jun 2016 20:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301758 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 20:39:58 -0000 Author: jamie Date: Thu Jun 9 20:39:57 2016 New Revision: 301758 URL: https://svnweb.freebsd.org/changeset/base/301758 Log: Clean up some logic in jail error messages, replacing a missing test and a redundant test with a single correct test. Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Jun 9 20:23:30 2016 (r301757) +++ head/sys/kern/kern_jail.c Thu Jun 9 20:39:57 2016 (r301758) @@ -1929,19 +1929,17 @@ kern_jail_set(struct thread *td, struct vrele(root); done_errmsg: if (error) { - vfs_getopt(opts, "errmsg", (void **)&errmsg, &errmsg_len); - if (errmsg_len > 0) { + if (vfs_getopt(opts, "errmsg", (void **)&errmsg, + &errmsg_len) == 0 && errmsg_len > 0) { errmsg_pos = 2 * vfs_getopt_pos(opts, "errmsg") + 1; - if (errmsg_pos > 0) { - if (optuio->uio_segflg == UIO_SYSSPACE) - bcopy(errmsg, - optuio->uio_iov[errmsg_pos].iov_base, - errmsg_len); - else - copyout(errmsg, - optuio->uio_iov[errmsg_pos].iov_base, - errmsg_len); - } + if (optuio->uio_segflg == UIO_SYSSPACE) + bcopy(errmsg, + optuio->uio_iov[errmsg_pos].iov_base, + errmsg_len); + else + copyout(errmsg, + optuio->uio_iov[errmsg_pos].iov_base, + errmsg_len); } } done_free: From owner-svn-src-all@freebsd.org Thu Jun 9 20:40:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3097B7050E; Thu, 9 Jun 2016 20:40:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BEEC1112; Thu, 9 Jun 2016 20:40:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59KeC4a039436; Thu, 9 Jun 2016 20:40:12 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59KeCwO039433; Thu, 9 Jun 2016 20:40:12 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606092040.u59KeCwO039433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 9 Jun 2016 20:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301759 - head/contrib/ldns-host X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 20:40:13 -0000 Author: des Date: Thu Jun 9 20:40:12 2016 New Revision: 301759 URL: https://svnweb.freebsd.org/changeset/base/301759 Log: Update to latest upstream version PR: 209177 Reported by: Vitaly Magerya MFC after: 1 week Modified: head/contrib/ldns-host/Makefile head/contrib/ldns-host/ldns-host.1 head/contrib/ldns-host/ldns-host.c Directory Properties: head/contrib/ldns-host/ (props changed) Modified: head/contrib/ldns-host/Makefile ============================================================================== --- head/contrib/ldns-host/Makefile Thu Jun 9 20:39:57 2016 (r301758) +++ head/contrib/ldns-host/Makefile Thu Jun 9 20:40:12 2016 (r301759) @@ -6,11 +6,11 @@ LOCALBASE?=/usr/local PREFIX?=${LOCALBASE} MANDIR?=${PREFIX}/man -XCFLAGS=${CFLAGS} -I${LOCALBASE}/include +XCFLAGS=${CFLAGS} -I${LOCALBASE}/include -std=c99 -Wall -Wextra -pedantic XLDFLAGS=${LDFLAGS} -L${LOCALBASE}/lib -lldns ${PROG}: ${SRC} - ${CC} -o $@ ${XCFLAGS} ${XLDFLAGS} ${SRC} + ${CC} -o $@ ${XCFLAGS} ${SRC} ${XLDFLAGS} clean: rm -f ${PROG} Modified: head/contrib/ldns-host/ldns-host.1 ============================================================================== --- head/contrib/ldns-host/ldns-host.1 Thu Jun 9 20:39:57 2016 (r301758) +++ head/contrib/ldns-host/ldns-host.1 Thu Jun 9 20:40:12 2016 (r301759) @@ -236,9 +236,6 @@ commands, while .Sq host from BIND9 uses whatever command was specified last. .It -Multi-packet zone transfers are not supported; only the first -response packet is printed. -.It .Sq Pseudosection TSIG is missing from verbose packet output. .El Modified: head/contrib/ldns-host/ldns-host.c ============================================================================== --- head/contrib/ldns-host/ldns-host.c Thu Jun 9 20:39:57 2016 (r301758) +++ head/contrib/ldns-host/ldns-host.c Thu Jun 9 20:40:12 2016 (r301759) @@ -7,16 +7,14 @@ * without any warranty. */ -#include - +#include #include #include +#include #include #include #include -#include - /* General utilities. */ @@ -159,11 +157,108 @@ memerr: } static ldns_status +ldns_tcp_start(ldns_resolver *res, ldns_pkt *qpkt, int nameserver) { + /* This routine is based on ldns_axfr_start, with the major + * difference in that it takes a query packet explicitly. + */ + struct sockaddr_storage *ns = NULL; + size_t ns_len = 0; + ldns_buffer *qbuf = NULL; + ldns_status status; + + ns = ldns_rdf2native_sockaddr_storage( + res->_nameservers[nameserver], ldns_resolver_port(res), &ns_len); + if (ns == NULL) { + status = LDNS_STATUS_MEM_ERR; + goto error; + } + + res->_socket = ldns_tcp_connect( + ns, (socklen_t)ns_len, ldns_resolver_timeout(res)); + if (res->_socket <= 0) { + status = LDNS_STATUS_ADDRESS_ERR; + goto error; + } + + qbuf = ldns_buffer_new(LDNS_MAX_PACKETLEN); + if (qbuf == NULL) { + status = LDNS_STATUS_MEM_ERR; + goto error; + } + + status = ldns_pkt2buffer_wire(qbuf, qpkt); + if (status != LDNS_STATUS_OK) + goto error; + + if (ldns_tcp_send_query(qbuf, res->_socket, ns, (socklen_t)ns_len) == 0) { + status = LDNS_STATUS_NETWORK_ERR; + goto error; + } + + ldns_buffer_free(qbuf); + free(ns); + return LDNS_STATUS_OK; + +error: + ldns_buffer_free(qbuf); + free(ns); + if (res->_socket > 0) { + close(res->_socket); + res->_socket = 0; + } + return status; +} + +static ldns_status +ldns_tcp_read(ldns_pkt **answer, ldns_resolver *res) { + ldns_status status; + struct timeval t1, t2; + uint8_t *data; + size_t size; + + if (res->_socket <= 0) + return LDNS_STATUS_ERR; + + gettimeofday(&t1, NULL); + data = ldns_tcp_read_wire_timeout( + res->_socket, &size, ldns_resolver_timeout(res)); + if (data == NULL) + goto error; + + status = ldns_wire2pkt(answer, data, size); + free(data); + if (status != LDNS_STATUS_OK) + goto error; + + gettimeofday(&t2, NULL); + ldns_pkt_set_querytime(*answer, + (uint32_t)((t2.tv_sec - t1.tv_sec)*1000) + + (t2.tv_usec - t1.tv_usec)/1000); + ldns_pkt_set_timestamp(*answer, t2); + return status; + +error: + close(res->_socket); + res->_socket = 0; + return LDNS_STATUS_ERR; +} + +static void +ldns_tcp_close(ldns_resolver *res) { + if (res->_socket > 0) { + close(res->_socket); + res->_socket = 0; + } +} + +static ldns_status ldns_resolver_send_to(ldns_pkt **answer, ldns_resolver *res, const ldns_rdf *name, ldns_rr_type t, ldns_rr_class c, - uint16_t flags, uint32_t ixfr_serial, int nameserver) { - ldns_status status; + uint16_t flags, uint32_t ixfr_serial, int nameserver, + bool close_tcp) { + ldns_status status = LDNS_STATUS_OK; ldns_pkt *qpkt; + struct timeval now; int nscnt = ldns_resolver_nameserver_count(res); ldns_rdf **ns = ldns_resolver_nameservers(res); @@ -173,12 +268,38 @@ ldns_resolver_send_to(ldns_pkt **answer, ldns_resolver_set_rtt(res, &rtt[nameserver]); ldns_resolver_set_nameserver_count(res, 1); - status = ldns_resolver_prepare_query_pkt(&qpkt, res, name, t, c, flags); - if (status == LDNS_STATUS_OK && t == LDNS_RR_TYPE_IXFR) + /* The next fragment should have been a call to + * ldns_resolver_prepare_query_pkt(), but starting with ldns + * version 1.6.17 that function tries to add it's own SOA + * records when rr_type is LDNS_RR_TYPE_IXFR, and we don't + * want that. + */ + qpkt = ldns_pkt_query_new(ldns_rdf_clone(name), t, c, flags); + if (qpkt == NULL) { + status = LDNS_STATUS_ERR; + goto done; + } + now.tv_sec = time(NULL); + now.tv_usec = 0; + ldns_pkt_set_timestamp(qpkt, now); + ldns_pkt_set_random_id(qpkt); + + if (t == LDNS_RR_TYPE_IXFR) { status = ldns_pkt_push_rr_soa(qpkt, LDNS_SECTION_AUTHORITY, name, c, ixfr_serial); - if (status == LDNS_STATUS_OK) + if (status != LDNS_STATUS_OK) goto done; + } + if (close_tcp) { status = ldns_resolver_send_pkt(answer, res, qpkt); + } else { + status = ldns_tcp_start(res, qpkt, 0); + if (status != LDNS_STATUS_OK) goto done; + status = ldns_tcp_read(answer, res); + if (status != LDNS_STATUS_OK) goto done; + ldns_pkt_set_answerfrom(*answer, ldns_rdf_clone(ns[0])); + } + +done: ldns_pkt_free(qpkt); ldns_resolver_set_nameservers(res, ns); @@ -203,9 +324,9 @@ ldns_pkt_filter_answer(ldns_pkt *pkt, ld type == rrtype || (type == LDNS_RR_TYPE_AXFR && (rrtype == LDNS_RR_TYPE_A || - rrtype == LDNS_RR_TYPE_AAAA || - rrtype == LDNS_RR_TYPE_NS || - rrtype == LDNS_RR_TYPE_PTR))) + rrtype == LDNS_RR_TYPE_AAAA || + rrtype == LDNS_RR_TYPE_NS || + rrtype == LDNS_RR_TYPE_PTR))) ldns_rr_list_set_rr(rrlist, rr, j++); } ldns_rr_list_set_rr_count(rrlist, j); @@ -438,7 +559,7 @@ print_received_line(ldns_resolver *res, #define DEFAULT_TCP_TIMEOUT 10 #define DEFAULT_UDP_TIMEOUT 5 -enum operation_mode { M_AXFR, M_DEFAULT_Q, M_SINGLE_Q, M_SOA }; +enum operation_mode { M_AXFR, M_IXFR, M_DEFAULT_Q, M_SINGLE_Q, M_SOA }; static enum operation_mode o_mode = M_DEFAULT_Q; static bool o_ignore_servfail = true; @@ -454,15 +575,15 @@ static int o_ipversion = LDNS_RESOLV_INE static int o_ndots = 1; static int o_retries = 1; static ldns_rr_class o_rrclass = LDNS_RR_CLASS_IN; -static ldns_rr_type o_rrtype = LDNS_RR_TYPE_A; +static ldns_rr_type o_rrtype = (ldns_rr_type)-1; static time_t o_timeout = 0; static uint32_t o_ixfr_serial = 0; static void usage(void) { - fputs( - "Usage: host [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n" - " [-t type] [-W wait] name [server]\n" + fprintf(stderr, + "Usage: %s [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n" + " %*c [-t type] [-W wait] name [server]\n" "\t-a same as -v -t ANY\n" "\t-C query SOA records from all authoritative name servers\n" "\t-c use this query class (IN, CH, HS, etc)\n" @@ -480,7 +601,7 @@ usage(void) { "\t-W wait this many seconds for a reply\n" "\t-4 use IPv4 only\n" "\t-6 use IPv6 only\n", - stderr); + progname, (int)strlen(progname), ' '); exit(1); } @@ -513,7 +634,8 @@ parse_args(int argc, char *argv[]) { case 'i': o_ip6_int = true; break; case 'l': o_mode = M_AXFR; - o_rrtype = LDNS_RR_TYPE_AXFR; + if (o_rrtype == (ldns_rr_type)-1) + o_rrtype = LDNS_RR_TYPE_AXFR; o_tcp = true; break; case 'N': @@ -542,13 +664,15 @@ parse_args(int argc, char *argv[]) { if (o_rrtype <= 0) die(2, "invalid type: %s\n", optarg); } - if (o_rrtype == LDNS_RR_TYPE_AXFR || o_rrtype == LDNS_RR_TYPE_IXFR) - o_tcp = true; if (o_rrtype == LDNS_RR_TYPE_AXFR) { o_mode = M_AXFR; o_rrtype = LDNS_RR_TYPE_ANY; o_verbose = true; } + if (o_rrtype == LDNS_RR_TYPE_IXFR) { + o_mode = M_IXFR; + o_rrtype = LDNS_RR_TYPE_ANY; + } break; case 'v': o_verbose = true; break; case 'w': @@ -574,6 +698,8 @@ parse_args(int argc, char *argv[]) { o_server = argv[1]; o_print_pkt_server = true; } + if (o_rrtype == (ldns_rr_type)-1) + o_rrtype = LDNS_RR_TYPE_A; } static ldns_rdf* @@ -602,7 +728,7 @@ safe_dname_cat_clone(const ldns_rdf *rd1 } static bool -query(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt) { +query(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, bool close_tcp) { ldns_status status; ldns_pkt_rcode rcode; int i, cnt; @@ -614,7 +740,8 @@ query(ldns_resolver *res, ldns_rdf *doma } for (cnt = ldns_resolver_nameserver_count(res), i = 0; i < cnt; i++) { status = ldns_resolver_send_to(pkt, res, domain, o_rrtype, - o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i); + o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i, + close_tcp); if (status != LDNS_STATUS_OK) { *pkt = NULL; continue; @@ -624,7 +751,8 @@ query(ldns_resolver *res, ldns_rdf *doma printf(";; Truncated, retrying in TCP mode.\n"); ldns_resolver_set_usevc(res, true); status = ldns_resolver_send_to(pkt, res, domain, o_rrtype, - o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i); + o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i, + close_tcp); ldns_resolver_set_usevc(res, false); if (status != LDNS_STATUS_OK) continue; @@ -642,16 +770,17 @@ query(ldns_resolver *res, ldns_rdf *doma } static ldns_rdf * -search(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, bool absolute) { +search(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, + bool absolute, bool close_tcp) { ldns_rdf *dname, **searchlist; int i, n; - if (absolute && query(res, domain, pkt)) + if (absolute && query(res, domain, pkt, close_tcp)) return domain; if ((dname = ldns_resolver_domain(res)) != NULL) { dname = safe_dname_cat_clone(domain, dname); - if (query(res, dname, pkt)) + if (query(res, dname, pkt, close_tcp)) return dname; } @@ -659,11 +788,11 @@ search(ldns_resolver *res, ldns_rdf *dom n = ldns_resolver_searchlist_count(res); for (i = 0; i < n; i++) { dname = safe_dname_cat_clone(domain, searchlist[i]); - if (query(res, dname, pkt)) + if (query(res, dname, pkt, close_tcp)) return dname; } - if (!absolute && query(res, domain, pkt)) + if (!absolute && query(res, domain, pkt, close_tcp)) return domain; return NULL; @@ -691,7 +820,7 @@ report(ldns_resolver *res, ldns_rdf *dom print_pkt_verbose(pkt); } else { print_pkt_short(pkt, o_print_rr_server); - if (o_mode != M_DEFAULT_Q && + if (o_mode == M_SINGLE_Q && ldns_rr_list_rr_count(ldns_pkt_answer(pkt)) == 0) { print_rdf_nodot(domain); printf(" has no "); @@ -709,7 +838,7 @@ doquery(ldns_resolver *res, ldns_rdf *do ldns_pkt *pkt; bool q; - q = query(res, domain, &pkt); + q = query(res, domain, &pkt, true); report(res, domain, pkt); return q; } @@ -719,7 +848,7 @@ doquery_filtered(ldns_resolver *res, ldn ldns_pkt *pkt; bool q; - q = query(res, domain, &pkt); + q = query(res, domain, &pkt, true); ldns_pkt_filter_answer(pkt, o_rrtype); report(res, domain, pkt); return q; @@ -730,7 +859,7 @@ dosearch(ldns_resolver *res, ldns_rdf *d ldns_pkt *pkt; ldns_rdf *dname; - dname = search(res, domain, &pkt, absolute); + dname = search(res, domain, &pkt, absolute, true); report(res, dname != NULL ? dname : domain, pkt); return o_mode != M_DEFAULT_Q ? (dname != NULL) : (dname != NULL) && @@ -739,17 +868,44 @@ dosearch(ldns_resolver *res, ldns_rdf *d } static bool -doaxfr(ldns_resolver *res, ldns_rdf *domain, bool absolute) { - ldns_pkt *pkt; +dozonetransfer(ldns_resolver *res, ldns_rdf *domain, bool absolute) { + ldns_pkt *pkt, *nextpkt; ldns_rdf *dname; ldns_rr_type rrtype; + ldns_rr_list *rrl; + int i, nsoa = 0; rrtype = o_rrtype; - o_rrtype = LDNS_RR_TYPE_AXFR; - dname = search(res, domain, &pkt, absolute); - ldns_pkt_filter_answer(pkt, rrtype); - report(res, dname != NULL ? dname : domain, pkt); - return dname != NULL; + o_rrtype = (o_mode == M_AXFR) ? LDNS_RR_TYPE_AXFR : LDNS_RR_TYPE_IXFR; + dname = search(res, domain, &pkt, absolute, false); + + for (;;) { + rrl = ldns_pkt_answer(pkt); + for (i = ldns_rr_list_rr_count(rrl) - 1; i >= 0; i--) { + if (ldns_rr_get_type(ldns_rr_list_rr(rrl, i)) == LDNS_RR_TYPE_SOA) + nsoa++; + } + ldns_pkt_filter_answer(pkt, rrtype); + report(res, dname != NULL ? dname : domain, pkt); + if ((dname == NULL) || + (ldns_pkt_get_rcode(pkt) != LDNS_RCODE_NOERROR)) { + printf("; Transfer failed.\n"); + ldns_tcp_close(res); + return false; + } + if (nsoa >= 2) { + ldns_tcp_close(res); + return true; + } + if (ldns_tcp_read(&nextpkt, res) != LDNS_STATUS_OK) { + printf("; Transfer failed.\n"); + return false; + } + ldns_pkt_set_answerfrom(nextpkt, + ldns_rdf_clone(ldns_pkt_answerfrom(pkt))); + ldns_pkt_free(pkt); + pkt = nextpkt; + } } static bool @@ -760,7 +916,7 @@ dosoa(ldns_resolver *res, ldns_rdf *doma ldns_rr *rr; size_t i, j, n, cnt; - if ((dname = search(res, domain, &pkt, absolute)) == NULL) + if ((dname = search(res, domain, &pkt, absolute, true)) == NULL) return false; answer = ldns_pkt_answer(pkt); @@ -780,9 +936,9 @@ dosoa(ldns_resolver *res, ldns_rdf *doma ldns_resolver_remove_nameservers(res); rr = ldns_rr_list_rr(nsaddrs[i], j); if ((ldns_resolver_ip6(res) == LDNS_RESOLV_INET && - ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) || + ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) || (ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 && - ldns_rr_get_type(rr) == LDNS_RR_TYPE_A)) + ldns_rr_get_type(rr) == LDNS_RR_TYPE_A)) continue; if (ldns_resolver_push_nameserver_rr(res, rr) == LDNS_STATUS_OK) /* bind9-host queries for domain, not dname here */ @@ -879,6 +1035,9 @@ main(int argc, char *argv[]) { o_rrtype = LDNS_RR_TYPE_PTR; return !doquery(res, dname); } - return !(o_mode == M_SOA ? dosoa : o_mode == M_AXFR ? doaxfr : dosearch) + return !(o_mode == M_SOA ? dosoa : + o_mode == M_AXFR ? dozonetransfer : + o_mode == M_IXFR ? dozonetransfer : + dosearch) (res, safe_str2rdf_dname(o_name), ndots(o_name) >= o_ndots); } From owner-svn-src-all@freebsd.org Thu Jun 9 20:43:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB041B70706; Thu, 9 Jun 2016 20:43:15 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82416152D; Thu, 9 Jun 2016 20:43:15 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59KhE9l042783; Thu, 9 Jun 2016 20:43:14 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59KhEwX042782; Thu, 9 Jun 2016 20:43:14 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606092043.u59KhEwX042782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 9 Jun 2016 20:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301760 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 20:43:15 -0000 Author: jamie Date: Thu Jun 9 20:43:14 2016 New Revision: 301760 URL: https://svnweb.freebsd.org/changeset/base/301760 Log: Re-order some jail parameter reading to prevent a vnode leak. Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Jun 9 20:40:12 2016 (r301759) +++ head/sys/kern/kern_jail.c Thu Jun 9 20:43:14 2016 (r301760) @@ -920,6 +920,46 @@ kern_jail_set(struct thread *td, struct } #endif + error = vfs_getopt(opts, "osrelease", (void **)&osrelstr, &len); + if (error == ENOENT) + osrelstr = NULL; + else if (error != 0) + goto done_free; + else { + if (flags & JAIL_UPDATE) { + error = EINVAL; + vfs_opterror(opts, + "osrelease cannot be changed after creation"); + goto done_errmsg; + } + if (len == 0 || len >= OSRELEASELEN) { + error = EINVAL; + vfs_opterror(opts, + "osrelease string must be 1-%d bytes long", + OSRELEASELEN - 1); + goto done_errmsg; + } + } + + error = vfs_copyopt(opts, "osreldate", &osreldt, sizeof(osreldt)); + if (error == ENOENT) + osreldt = 0; + else if (error != 0) + goto done_free; + else { + if (flags & JAIL_UPDATE) { + error = EINVAL; + vfs_opterror(opts, + "osreldate cannot be changed after creation"); + goto done_errmsg; + } + if (osreldt == 0) { + error = EINVAL; + vfs_opterror(opts, "osreldate cannot be 0"); + goto done_errmsg; + } + } + fullpath_disabled = 0; root = NULL; error = vfs_getopt(opts, "path", (void **)&path, &len); @@ -975,46 +1015,6 @@ kern_jail_set(struct thread *td, struct } } - error = vfs_getopt(opts, "osrelease", (void **)&osrelstr, &len); - if (error == ENOENT) - osrelstr = NULL; - else if (error != 0) - goto done_free; - else { - if (flags & JAIL_UPDATE) { - error = EINVAL; - vfs_opterror(opts, - "osrelease cannot be changed after creation"); - goto done_errmsg; - } - if (len == 0 || len >= OSRELEASELEN) { - error = EINVAL; - vfs_opterror(opts, - "osrelease string must be 1-%d bytes long", - OSRELEASELEN - 1); - goto done_errmsg; - } - } - - error = vfs_copyopt(opts, "osreldate", &osreldt, sizeof(osreldt)); - if (error == ENOENT) - osreldt = 0; - else if (error != 0) - goto done_free; - else { - if (flags & JAIL_UPDATE) { - error = EINVAL; - vfs_opterror(opts, - "osreldate cannot be changed after creation"); - goto done_errmsg; - } - if (osreldt == 0) { - error = EINVAL; - vfs_opterror(opts, "osreldate cannot be 0"); - goto done_errmsg; - } - } - /* * Find the specified jail, or at least its parent. * This abuses the file error codes ENOENT and EEXIST. From owner-svn-src-all@freebsd.org Thu Jun 9 20:49:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB98BB7081E; Thu, 9 Jun 2016 20:49:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADDD919B1; Thu, 9 Jun 2016 20:49:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59KnQAl043184; Thu, 9 Jun 2016 20:49:26 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59KnQ7V043183; Thu, 9 Jun 2016 20:49:26 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606092049.u59KnQ7V043183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Jun 2016 20:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301761 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 20:49:28 -0000 Author: trasz Date: Thu Jun 9 20:49:26 2016 New Revision: 301761 URL: https://svnweb.freebsd.org/changeset/base/301761 Log: Fix frexpl() declaration to not include the field name. MFC after: 1 month Modified: head/lib/msun/src/math.h Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Thu Jun 9 20:43:14 2016 (r301760) +++ head/lib/msun/src/math.h Thu Jun 9 20:49:26 2016 (r301761) @@ -461,7 +461,7 @@ long double fmal(long double, long doubl long double fmaxl(long double, long double) __pure2; long double fminl(long double, long double) __pure2; long double fmodl(long double, long double); -long double frexpl(long double value, int *); /* fundamentally !__pure2 */ +long double frexpl(long double, int *); /* fundamentally !__pure2 */ long double hypotl(long double, long double); int ilogbl(long double) __pure2; long double ldexpl(long double, int); From owner-svn-src-all@freebsd.org Thu Jun 9 21:19:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43C27B70FA1; Thu, 9 Jun 2016 21:19:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F4BF1D67; Thu, 9 Jun 2016 21:19:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59LJkAN054638; Thu, 9 Jun 2016 21:19:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59LJkxt054636; Thu, 9 Jun 2016 21:19:46 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606092119.u59LJkxt054636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 9 Jun 2016 21:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301762 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 21:19:47 -0000 Author: avos Date: Thu Jun 9 21:19:46 2016 New Revision: 301762 URL: https://svnweb.freebsd.org/changeset/base/301762 Log: urtwn: reinstall group keys on every device startup. Since key table is cleared on every device shutdown, static WEP keys (which are set only once) need to be reinstalled manually every time when device starts running. Tested with RTL8188EU, STA (all ciphers) / IBSS (WPA-none) modes. Modified: head/sys/dev/urtwn/if_urtwn.c head/sys/dev/urtwn/if_urtwnvar.h Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Thu Jun 9 20:49:26 2016 (r301761) +++ head/sys/dev/urtwn/if_urtwn.c Thu Jun 9 21:19:46 2016 (r301762) @@ -373,6 +373,8 @@ static void urtwn_set_chan(struct urtwn static void urtwn_iq_calib(struct urtwn_softc *); static void urtwn_lc_calib(struct urtwn_softc *); static void urtwn_temp_calib(struct urtwn_softc *); +static void urtwn_setup_static_keys(struct urtwn_softc *, + struct urtwn_vap *); static int urtwn_init(struct urtwn_softc *); static void urtwn_stop(struct urtwn_softc *); static void urtwn_abort_xfers(struct urtwn_softc *); @@ -2340,12 +2342,28 @@ static int urtwn_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { struct urtwn_softc *sc = vap->iv_ic->ic_softc; + struct urtwn_vap *uvp = URTWN_VAP(vap); if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { /* Not for us. */ return (1); } + if (&vap->iv_nw_keys[0] <= k && + k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) { + URTWN_LOCK(sc); + uvp->keys[k->wk_keyix] = k; + if ((sc->sc_flags & URTWN_RUNNING) == 0) { + /* + * The device was not started; + * the key will be installed later. + */ + URTWN_UNLOCK(sc); + return (1); + } + URTWN_UNLOCK(sc); + } + return (!urtwn_cmd_sleepable(sc, k, sizeof(*k), urtwn_key_set_cb)); } @@ -2353,12 +2371,25 @@ static int urtwn_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) { struct urtwn_softc *sc = vap->iv_ic->ic_softc; + struct urtwn_vap *uvp = URTWN_VAP(vap); if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { /* Not for us. */ return (1); } + if (&vap->iv_nw_keys[0] <= k && + k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) { + URTWN_LOCK(sc); + uvp->keys[k->wk_keyix] = NULL; + if ((sc->sc_flags & URTWN_RUNNING) == 0) { + /* All keys are removed on device reset. */ + URTWN_UNLOCK(sc); + return (1); + } + URTWN_UNLOCK(sc); + } + return (!urtwn_cmd_sleepable(sc, k, sizeof(*k), urtwn_key_del_cb)); } @@ -5230,6 +5261,20 @@ urtwn_temp_calib(struct urtwn_softc *sc) } } +static void +urtwn_setup_static_keys(struct urtwn_softc *sc, struct urtwn_vap *uvp) +{ + int i; + + for (i = 0; i < IEEE80211_WEP_NKID; i++) { + const struct ieee80211_key *k = uvp->keys[i]; + if (k != NULL) { + urtwn_cmd_sleepable(sc, k, sizeof(*k), + urtwn_key_set_cb); + } + } +} + static int urtwn_init(struct urtwn_softc *sc) { @@ -5418,12 +5463,6 @@ urtwn_init(struct urtwn_softc *sc) R92C_SECCFG_TXENC_ENA | R92C_SECCFG_RXDEC_ENA | R92C_SECCFG_TXBCKEY_DEF | R92C_SECCFG_RXBCKEY_DEF); - /* - * Install static keys (if any). - * Must be called after urtwn_cam_init(). - */ - ieee80211_runtask(ic, &sc->cmdq_task); - /* Enable hardware sequence numbering. */ urtwn_write_1(sc, R92C_HWSEQ_CTRL, R92C_TX_QUEUE_ALL); @@ -5459,6 +5498,13 @@ urtwn_init(struct urtwn_softc *sc) sc->sc_flags |= URTWN_RUNNING; + /* + * Install static keys (if any). + * Must be called after urtwn_cam_init(). + */ + if (vap != NULL) + urtwn_setup_static_keys(sc, URTWN_VAP(vap)); + callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); fail: if (usb_err != USB_ERR_NORMAL_COMPLETION) Modified: head/sys/dev/urtwn/if_urtwnvar.h ============================================================================== --- head/sys/dev/urtwn/if_urtwnvar.h Thu Jun 9 20:49:26 2016 (r301761) +++ head/sys/dev/urtwn/if_urtwnvar.h Thu Jun 9 21:19:46 2016 (r301762) @@ -107,6 +107,8 @@ struct urtwn_vap { struct mbuf *bcn_mbuf; struct task tsf_task_adhoc; + const struct ieee80211_key *keys[IEEE80211_WEP_NKID]; + int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); void (*recv_mgmt)(struct ieee80211_node *, From owner-svn-src-all@freebsd.org Thu Jun 9 21:57:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C042CB7096C; Thu, 9 Jun 2016 21:57:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD421656; Thu, 9 Jun 2016 21:57:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59LvYrO069158; Thu, 9 Jun 2016 21:57:34 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59LvYsf069153; Thu, 9 Jun 2016 21:57:34 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606092157.u59LvYsf069153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 9 Jun 2016 21:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301763 - in head: . tools/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 21:57:35 -0000 Author: jilles Date: Thu Jun 9 21:57:34 2016 New Revision: 301763 URL: https://svnweb.freebsd.org/changeset/base/301763 Log: build: Add legacy support for futimens() and utimensat(). In order to allow using utimensat() in install(1), add futimens() and utimensat() to -legacy. The files futimens.c and utimensat.c are modified copies of the files under lib/libc/sys/ since the libc versions use symbols that do not exist in the libc on the build system (sys_futimens and sys_utimensat) . I expect the next non-sweeping change to both sets of files to be to delete them, anyway. This will allow reverting r299942 (which is a revert of r299850) enabling nanosecond timestamps in install(1). Reviewed by: bdrewery Added: head/tools/build/futimens.c - copied, changed from r301311, head/lib/libc/sys/futimens.c head/tools/build/stat.h (contents, props changed) head/tools/build/utimensat.c - copied, changed from r301311, head/lib/libc/sys/utimensat.c Modified: head/Makefile.inc1 head/tools/build/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 9 21:19:46 2016 (r301762) +++ head/Makefile.inc1 Thu Jun 9 21:57:34 2016 (r301763) @@ -646,6 +646,8 @@ _worldtmp: .PHONY mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \ -p ${WORLDTMP}/legacy/usr >/dev/null .endif + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ + -p ${WORLDTMP}/legacy/usr/include >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ -p ${WORLDTMP}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Thu Jun 9 21:19:46 2016 (r301762) +++ head/tools/build/Makefile Thu Jun 9 21:57:34 2016 (r301763) @@ -4,9 +4,11 @@ LIB= egacy SRC= -INCSGROUPS= INCS +INCSGROUPS= INCS SYSINCS INCS= +SYSINCSDIR= ${INCLUDEDIR}/sys + BOOTSTRAPPING?= 0 _WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/grp.h || true @@ -33,6 +35,12 @@ SRCS+= reallocarray.c CFLAGS+= -I${.CURDIR}/../../lib/libc/include .endif +_WITH_UTIMENS!= grep -c utimensat /usr/include/sys/stat.h || true +.if ${_WITH_UTIMENS} == 0 +SYSINCS+= stat.h +SRCS+= futimens.c utimensat.c +.endif + .if empty(SRCS) SRCS= dummy.c .endif Copied and modified: head/tools/build/futimens.c (from r301311, head/lib/libc/sys/futimens.c) ============================================================================== --- head/lib/libc/sys/futimens.c Sat Jun 4 10:19:07 2016 (r301311, copy source) +++ head/tools/build/futimens.c Thu Jun 9 21:57:34 2016 (r301763) @@ -27,15 +27,16 @@ #include __FBSDID("$FreeBSD$"); -#include "namespace.h" #include #include #include #include -#include "un-namespace.h" -#include "libc_private.h" +#ifndef UTIME_NOW +#define UTIME_NOW -1 +#define UTIME_OMIT -2 +#endif int futimens(int fd, const struct timespec times[2]) @@ -44,11 +45,6 @@ futimens(int fd, const struct timespec t struct stat sb; int osreldate; - osreldate = __getosreldate(); - if (osreldate >= 1100056 || - (osreldate >= 1002506 && osreldate < 1100000)) - return (__sys_futimens(fd, times)); - if (times == NULL || (times[0].tv_nsec == UTIME_NOW && times[1].tv_nsec == UTIME_NOW)) tvp = NULL; @@ -75,7 +71,7 @@ futimens(int fd, const struct timespec t tvp = tv; if (times[0].tv_nsec == UTIME_OMIT || times[1].tv_nsec == UTIME_OMIT) { - if (_fstat(fd, &sb) == -1) + if (fstat(fd, &sb) == -1) return (-1); if (times[0].tv_nsec == UTIME_OMIT) { tv[0].tv_sec = sb.st_atim.tv_sec; Added: head/tools/build/stat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/stat.h Thu Jun 9 21:57:34 2016 (r301763) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2016 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LEGACY_SYS_STAT_H_ +#define _LEGACY_SYS_STAT_H_ + +#include_next + +#ifndef UTIME_NOW +#define UTIME_NOW -1 +#define UTIME_OMIT -2 +#endif + +__BEGIN_DECLS + +int futimens(int, const struct timespec *); +int utimensat(int, const char *, const struct timespec *, int); + +__END_DECLS + +#endif /* !_LEGACY_SYS_STAT_H_ */ Copied and modified: head/tools/build/utimensat.c (from r301311, head/lib/libc/sys/utimensat.c) ============================================================================== --- head/lib/libc/sys/utimensat.c Sat Jun 4 10:19:07 2016 (r301311, copy source) +++ head/tools/build/utimensat.c Thu Jun 9 21:57:34 2016 (r301763) @@ -27,15 +27,16 @@ #include __FBSDID("$FreeBSD$"); -#include "namespace.h" #include #include #include #include -#include "un-namespace.h" -#include "libc_private.h" +#ifndef UTIME_NOW +#define UTIME_NOW -1 +#define UTIME_OMIT -2 +#endif int utimensat(int fd, const char *path, const struct timespec times[2], int flag) @@ -44,11 +45,6 @@ utimensat(int fd, const char *path, cons struct stat sb; int osreldate; - osreldate = __getosreldate(); - if (osreldate >= 1100056 || - (osreldate >= 1002506 && osreldate < 1100000)) - return (__sys_utimensat(fd, path, times, flag)); - if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) { errno = EINVAL; return (-1); From owner-svn-src-all@freebsd.org Thu Jun 9 21:59:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0ACF3B70A09; Thu, 9 Jun 2016 21:59:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D041D1815; Thu, 9 Jun 2016 21:59:12 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59LxCEm069250; Thu, 9 Jun 2016 21:59:12 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59LxC7j069249; Thu, 9 Jun 2016 21:59:12 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606092159.u59LxC7j069249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 9 Jun 2016 21:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301764 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 21:59:13 -0000 Author: jamie Date: Thu Jun 9 21:59:11 2016 New Revision: 301764 URL: https://svnweb.freebsd.org/changeset/base/301764 Log: Fix a vnode leak when giving a child jail a too-long path when debug.disablefullpath=1. Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Jun 9 21:57:34 2016 (r301763) +++ head/sys/kern/kern_jail.c Thu Jun 9 21:59:11 2016 (r301764) @@ -1010,6 +1010,7 @@ kern_jail_set(struct thread *td, struct if (len + (path[0] == '/' && strcmp(mypr->pr_path, "/") ? strlen(mypr->pr_path) : 0) > MAXPATHLEN) { error = ENAMETOOLONG; + vrele(root); goto done_free; } } From owner-svn-src-all@freebsd.org Thu Jun 9 21:59:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A0CAB70A5A; Thu, 9 Jun 2016 21:59:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B94A1A04; Thu, 9 Jun 2016 21:59:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59LxajR069362; Thu, 9 Jun 2016 21:59:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59LxaZo069361; Thu, 9 Jun 2016 21:59:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606092159.u59LxaZo069361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 9 Jun 2016 21:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301766 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 21:59:37 -0000 Author: adrian Date: Thu Jun 9 21:59:36 2016 New Revision: 301766 URL: https://svnweb.freebsd.org/changeset/base/301766 Log: [ath] report node queue overflows. I need to also update athstats to report this too. Modified: head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Jun 9 21:59:35 2016 (r301765) +++ head/sys/dev/ath/if_ath_sysctl.c Thu Jun 9 21:59:36 2016 (r301766) @@ -1282,6 +1282,9 @@ ath_sysctl_stats_attach(struct ath_softc &sc->sc_stats.ast_rx_keymiss, 0, ""); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_swfiltered", CTLFLAG_RD, &sc->sc_stats.ast_tx_swfiltered, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_nodeq_overflow", + CTLFLAG_RD, &sc->sc_stats.ast_tx_nodeq_overflow, 0, + "tx dropped 'cuz nodeq overflow"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_stbc", CTLFLAG_RD, &sc->sc_stats.ast_rx_stbc, 0, "Number of STBC frames received"); From owner-svn-src-all@freebsd.org Thu Jun 9 21:59:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 399C2B70A55; Thu, 9 Jun 2016 21:59:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE2BB1A02; Thu, 9 Jun 2016 21:59:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59LxadZ069330; Thu, 9 Jun 2016 21:59:36 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59LxaSx069316; Thu, 9 Jun 2016 21:59:36 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606092159.u59LxaSx069316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 9 Jun 2016 21:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301765 - in head/usr.bin/xinstall: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 21:59:37 -0000 Author: jilles Date: Thu Jun 9 21:59:35 2016 New Revision: 301765 URL: https://svnweb.freebsd.org/changeset/base/301765 Log: install: When preserving timestamps, also copy the nanoseconds part. Now that we have utimensat in -legacy, install(1) can use it. This is a revert of r299942 which is itself a revert of r299850. Modified: head/usr.bin/xinstall/tests/install_test.sh head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/tests/install_test.sh ============================================================================== --- head/usr.bin/xinstall/tests/install_test.sh Thu Jun 9 21:59:11 2016 (r301764) +++ head/usr.bin/xinstall/tests/install_test.sh Thu Jun 9 21:59:35 2016 (r301765) @@ -64,6 +64,12 @@ copy_to_nonexistent_backup_safe_body() { copy_to_nonexistent_with_opts -b -B.bak -S } +atf_test_case copy_to_nonexistent_preserving +copy_to_nonexistent_preserving_body() { + copy_to_nonexistent_with_opts -p + [ ! testf -ot copyf ] || atf_fail "bad timestamp 2" +} + copy_self_with_opts() { printf 'test\n123\r456\r\n789\0z' >testf printf 'test\n123\r456\r\n789\0z' >testf2 @@ -307,6 +313,7 @@ atf_init_test_cases() { atf_add_test_case copy_to_nonexistent_safe_comparing atf_add_test_case copy_to_nonexistent_backup atf_add_test_case copy_to_nonexistent_backup_safe + atf_add_test_case copy_to_nonexistent_preserving atf_add_test_case copy_self atf_add_test_case copy_self_safe atf_add_test_case copy_self_comparing Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Thu Jun 9 21:59:11 2016 (r301764) +++ head/usr.bin/xinstall/xinstall.c Thu Jun 9 21:59:35 2016 (r301765) @@ -131,7 +131,7 @@ static void do_symlink(const char *, con static void makelink(const char *, const char *, const struct stat *); static void install(const char *, const char *, u_long, u_int); static void install_dir(char *); -static void metadata_log(const char *, const char *, struct timeval *, +static void metadata_log(const char *, const char *, struct timespec *, const char *, const char *, off_t); static int parseid(const char *, id_t *); static void strip(const char *); @@ -722,7 +722,7 @@ static void install(const char *from_name, const char *to_name, u_long fset, u_int flags) { struct stat from_sb, temp_sb, to_sb; - struct timeval tvb[2]; + struct timespec tsb[2]; int devnull, files_match, from_fd, serrno, target; int tempcopy, temp_fd, to_fd; char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN]; @@ -857,11 +857,9 @@ install(const char *from_name, const cha * Need to preserve target file times, though. */ if (to_sb.st_nlink != 1) { - tvb[0].tv_sec = to_sb.st_atime; - tvb[0].tv_usec = 0; - tvb[1].tv_sec = to_sb.st_mtime; - tvb[1].tv_usec = 0; - (void)utimes(tempfile, tvb); + tsb[0] = to_sb.st_atim; + tsb[1] = to_sb.st_mtim; + (void)utimensat(AT_FDCWD, tempfile, tsb, 0); } else { files_match = 1; (void)unlink(tempfile); @@ -916,11 +914,9 @@ install(const char *from_name, const cha * Preserve the timestamp of the source file if necessary. */ if (dopreserve && !files_match && !devnull) { - tvb[0].tv_sec = from_sb.st_atime; - tvb[0].tv_usec = 0; - tvb[1].tv_sec = from_sb.st_mtime; - tvb[1].tv_usec = 0; - (void)utimes(to_name, tvb); + tsb[0] = from_sb.st_atim; + tsb[1] = from_sb.st_mtim; + (void)utimensat(AT_FDCWD, to_name, tsb, 0); } if (fstat(to_fd, &to_sb) == -1) { @@ -989,7 +985,7 @@ install(const char *from_name, const cha if (!devnull) (void)close(from_fd); - metadata_log(to_name, "file", tvb, NULL, digestresult, to_sb.st_size); + metadata_log(to_name, "file", tsb, NULL, digestresult, to_sb.st_size); free(digestresult); } @@ -1301,7 +1297,7 @@ again: * or to allow integrity checks to be performed. */ static void -metadata_log(const char *path, const char *type, struct timeval *tv, +metadata_log(const char *path, const char *type, struct timespec *ts, const char *slink, const char *digestresult, off_t size) { static const char extra[] = { ' ', '\t', '\n', '\\', '#', '\0' }; @@ -1355,9 +1351,9 @@ metadata_log(const char *path, const cha } if (*type == 'f') /* type=file */ fprintf(metafp, " size=%lld", (long long)size); - if (tv != NULL && dopreserve) - fprintf(metafp, " time=%lld.%ld", - (long long)tv[1].tv_sec, (long)tv[1].tv_usec); + if (ts != NULL && dopreserve) + fprintf(metafp, " time=%lld.%09ld", + (long long)ts[1].tv_sec, ts[1].tv_nsec); if (digestresult && digest) fprintf(metafp, " %s=%s", digest, digestresult); if (fflags) From owner-svn-src-all@freebsd.org Thu Jun 9 22:01:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A71FB70B3B; Thu, 9 Jun 2016 22:01:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CCF41D79; Thu, 9 Jun 2016 22:01:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59M15aL069502; Thu, 9 Jun 2016 22:01:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59M15i0069501; Thu, 9 Jun 2016 22:01:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606092201.u59M15i0069501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 9 Jun 2016 22:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301767 - 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 22:01:06 -0000 Author: adrian Date: Thu Jun 9 22:01:05 2016 New Revision: 301767 URL: https://svnweb.freebsd.org/changeset/base/301767 Log: [ath] add a placeholder event for debuggin EDMA TX FIFO push events. Some later code I'll commit pushes lists of frames into the EDMA TX FIFO, rather than a single frame at a time. The CABQ code already pushes frame lists, but it turns out we should actually be doing it in general or performance tanks. :( Modified: head/sys/dev/ath/if_ath_alq.h Modified: head/sys/dev/ath/if_ath_alq.h ============================================================================== --- head/sys/dev/ath/if_ath_alq.h Thu Jun 9 21:59:36 2016 (r301766) +++ head/sys/dev/ath/if_ath_alq.h Thu Jun 9 22:01:05 2016 (r301767) @@ -113,6 +113,14 @@ struct if_ath_alq_mib_counters { #define ATH_ALQ_STUCK_BEACON 13 #define ATH_ALQ_RESUME_BEACON 14 +#define ATH_ALQ_TX_FIFO_PUSH 15 +struct if_ath_alq_tx_fifo_push { + uint32_t txq; + uint32_t nframes; + uint32_t fifo_depth; + uint32_t frame_cnt; +}; + /* * These will always be logged, regardless. */ From owner-svn-src-all@freebsd.org Thu Jun 9 22:15:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FAD6B70F1A; Thu, 9 Jun 2016 22:15:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 043EA1767; Thu, 9 Jun 2016 22:14:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59MExi5076716; Thu, 9 Jun 2016 22:14:59 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59MExl7076714; Thu, 9 Jun 2016 22:14:59 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606092214.u59MExl7076714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 9 Jun 2016 22:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301768 - in head/lib/libc: gen sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 22:15:00 -0000 Author: jilles Date: Thu Jun 9 22:14:58 2016 New Revision: 301768 URL: https://svnweb.freebsd.org/changeset/base/301768 Log: utimes(2),utime(3): Add deprecation in favour of utimensat(2) and futimens(2). Setting time by seconds or microseconds may cause unexpected effects especially if sysctl vfs.timestamp_precision=3 (not default). Calling the obsolete functions with NULL timestamps is acceptable. Modified: head/lib/libc/gen/utime.3 head/lib/libc/sys/utimes.2 Modified: head/lib/libc/gen/utime.3 ============================================================================== --- head/lib/libc/gen/utime.3 Thu Jun 9 22:01:05 2016 (r301767) +++ head/lib/libc/gen/utime.3 Thu Jun 9 22:14:58 2016 (r301768) @@ -28,7 +28,7 @@ .\" @(#)utime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd June 9, 2016 .Dt UTIME 3 .Os .Sh NAME @@ -43,7 +43,8 @@ .Sh DESCRIPTION .Bf -symbolic This interface is obsoleted by -.Xr utimes 2 . +.Xr utimensat 2 +because it is not accurate to fractions of a second. .Ef .Pp The @@ -79,6 +80,7 @@ for any of the errors specified for the .Xr utimes 2 . .Sh SEE ALSO .Xr stat 2 , +.Xr utimensat 2 , .Xr utimes 2 .Sh STANDARDS The Modified: head/lib/libc/sys/utimes.2 ============================================================================== --- head/lib/libc/sys/utimes.2 Thu Jun 9 22:01:05 2016 (r301767) +++ head/lib/libc/sys/utimes.2 Thu Jun 9 22:14:58 2016 (r301768) @@ -30,7 +30,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 3, 2014 +.Dd June 9, 2016 .Dt UTIMES 2 .Os .Sh NAME @@ -52,6 +52,14 @@ .Ft int .Fn futimesat "int fd" "const char *path" "const struct timeval times[2]" .Sh DESCRIPTION +.Bf -symbolic +These interfaces are obsoleted by +.Xr futimens 2 +and +.Xr utimensat 2 +because they are not accurate to nanoseconds. +.Ef +.Pp The access and modification times of the file named by .Fa path or referenced by @@ -223,6 +231,7 @@ nor a file descriptor associated with a .Sh SEE ALSO .Xr chflags 2 , .Xr stat 2 , +.Xr utimensat 2 , .Xr utime 3 .Sh STANDARDS The @@ -231,7 +240,11 @@ function is expected to conform to .St -xpg4.2 . The .Fn futimesat -system call follows The Open Group Extended API Set 2 specification. +system call follows The Open Group Extended API Set 2 specification +but was replaced by +.Fn utimensat +in +.St -p1003.1-2008 . .Sh HISTORY The .Fn utimes From owner-svn-src-all@freebsd.org Thu Jun 9 22:18:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF076B70058; Thu, 9 Jun 2016 22:18:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE27B1A92; Thu, 9 Jun 2016 22:18:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59MIP0d076872; Thu, 9 Jun 2016 22:18:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59MIP78076869; Thu, 9 Jun 2016 22:18:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606092218.u59MIP78076869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 9 Jun 2016 22:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301769 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 22:18:27 -0000 Author: pfg Date: Thu Jun 9 22:18:25 2016 New Revision: 301769 URL: https://svnweb.freebsd.org/changeset/base/301769 Log: libc/rpc: Make use of some xdr_* macros. (part 2) xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but fixed in r296394. Give them some use hoping they help make the code somewhat more readable. Modified: head/lib/libc/rpc/rpc_callmsg.c head/lib/libc/rpc/rpc_prot.c head/lib/libc/rpc/rpcb_st_xdr.c Modified: head/lib/libc/rpc/rpc_callmsg.c ============================================================================== --- head/lib/libc/rpc/rpc_callmsg.c Thu Jun 9 22:14:58 2016 (r301768) +++ head/lib/libc/rpc/rpc_callmsg.c Thu Jun 9 22:18:25 2016 (r301769) @@ -193,11 +193,11 @@ xdr_callmsg(XDR *xdrs, struct rpc_msg *c xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && xdr_enum(xdrs, (enum_t *) prm_direction) && (cmsg->rm_direction == CALL) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_rpcvers)) && (cmsg->rm_call.cb_rpcvers == RPC_MSG_VERSION) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_proc)) && + xdr_rpcprog(xdrs, &(cmsg->rm_call.cb_prog)) && + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_vers)) && + xdr_rpcproc(xdrs, &(cmsg->rm_call.cb_proc)) && xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_cred)) ) return (xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_verf))); return (FALSE); Modified: head/lib/libc/rpc/rpc_prot.c ============================================================================== --- head/lib/libc/rpc/rpc_prot.c Thu Jun 9 22:14:58 2016 (r301768) +++ head/lib/libc/rpc/rpc_prot.c Thu Jun 9 22:18:25 2016 (r301769) @@ -119,9 +119,9 @@ xdr_accepted_reply(XDR *xdrs, struct acc return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where)); case PROG_MISMATCH: - if (! xdr_u_int32_t(xdrs, &(ar->ar_vers.low))) + if (!xdr_rpcvers(xdrs, &(ar->ar_vers.low))) return (FALSE); - return (xdr_u_int32_t(xdrs, &(ar->ar_vers.high))); + return (xdr_rpcvers(xdrs, &(ar->ar_vers.high))); case GARBAGE_ARGS: case SYSTEM_ERR: @@ -152,9 +152,9 @@ xdr_rejected_reply(XDR *xdrs, struct rej switch (rr->rj_stat) { case RPC_MISMATCH: - if (! xdr_u_int32_t(xdrs, &(rr->rj_vers.low))) + if (! xdr_rpcvers(xdrs, &(rr->rj_vers.low))) return (FALSE); - return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high))); + return (xdr_rpcvers(xdrs, &(rr->rj_vers.high))); case AUTH_ERROR: prj_why = &rr->rj_why; Modified: head/lib/libc/rpc/rpcb_st_xdr.c ============================================================================== --- head/lib/libc/rpc/rpcb_st_xdr.c Thu Jun 9 22:14:58 2016 (r301768) +++ head/lib/libc/rpc/rpcb_st_xdr.c Thu Jun 9 22:18:25 2016 (r301769) @@ -51,10 +51,10 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addr { struct rpcbs_addrlist **pnext; - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { @@ -89,13 +89,13 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_r if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { @@ -128,13 +128,13 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_r } else if (xdrs->x_op == XDR_DECODE) { buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { @@ -164,13 +164,13 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_r } return (TRUE); } - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { From owner-svn-src-all@freebsd.org Thu Jun 9 22:25:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CE2CB7023D; Thu, 9 Jun 2016 22:25:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE811F91; Thu, 9 Jun 2016 22:25:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59MP0uI080628; Thu, 9 Jun 2016 22:25:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59MP0Ge080627; Thu, 9 Jun 2016 22:25:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606092225.u59MP0Ge080627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 9 Jun 2016 22:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301770 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 22:25:01 -0000 Author: pfg Date: Thu Jun 9 22:25:00 2016 New Revision: 301770 URL: https://svnweb.freebsd.org/changeset/base/301770 Log: rpcbind(8): Make use of some xdr_* macros. xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but fixed in r296394. Give them some use hoping they help make the code somewhat more readable. Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_svc_com.c Thu Jun 9 22:18:25 2016 (r301769) +++ head/usr.sbin/rpcbind/rpcb_svc_com.c Thu Jun 9 22:25:00 2016 (r301770) @@ -429,9 +429,9 @@ static bool_t xdr_rmtcall_args(XDR *xdrs, struct r_rmtcall_args *cap) { /* does not get the address or the arguments */ - if (xdr_u_int32_t(xdrs, &(cap->rmt_prog)) && - xdr_u_int32_t(xdrs, &(cap->rmt_vers)) && - xdr_u_int32_t(xdrs, &(cap->rmt_proc))) { + if (xdr_rpcprog(xdrs, &(cap->rmt_prog)) && + xdr_rpcvers(xdrs, &(cap->rmt_vers)) && + xdr_rpcproc(xdrs, &(cap->rmt_proc))) { return (xdr_encap_parms(xdrs, &(cap->rmt_args))); } return (FALSE); From owner-svn-src-all@freebsd.org Thu Jun 9 22:39:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 307A7B705E5; Thu, 9 Jun 2016 22:39:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBF05195D; Thu, 9 Jun 2016 22:39:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u59Md3tV084716; Thu, 9 Jun 2016 22:39:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u59Md2bS084710; Thu, 9 Jun 2016 22:39:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201606092239.u59Md2bS084710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 9 Jun 2016 22:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301771 - in head/sys: cam cam/nvme conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 22:39:04 -0000 Author: imp Date: Thu Jun 9 22:39:02 2016 New Revision: 301771 URL: https://svnweb.freebsd.org/changeset/base/301771 Log: New NVMe front end (nda). Added: head/sys/cam/nvme/ head/sys/cam/nvme/nvme_all.c (contents, props changed) head/sys/cam/nvme/nvme_all.h (contents, props changed) head/sys/cam/nvme/nvme_da.c (contents, props changed) head/sys/cam/nvme/nvme_xpt.c (contents, props changed) Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt_internal.h head/sys/conf/files head/sys/conf/files.amd64 Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Jun 9 22:25:00 2016 (r301770) +++ head/sys/cam/cam_ccb.h Thu Jun 9 22:39:02 2016 (r301771) @@ -41,6 +41,7 @@ #include #include #include +#include /* General allocation length definitions for CCB structures */ #define IOCDBLEN CAM_MAX_CDBLEN /* Space for CDB bytes/pointer */ @@ -265,6 +266,7 @@ typedef enum { PROTO_ATAPI, /* AT Attachment Packetized Interface */ PROTO_SATAPM, /* SATA Port Multiplier */ PROTO_SEMB, /* SATA Enclosure Management Bridge */ + PROTO_NVME, /* NVME */ } cam_proto; typedef enum { @@ -280,6 +282,7 @@ typedef enum { XPORT_SATA, /* Serial AT Attachment */ XPORT_ISCSI, /* iSCSI */ XPORT_SRP, /* SCSI RDMA Protocol */ + XPORT_NVME, /* NVMe over PCIe */ } cam_xport; #define XPORT_IS_ATA(t) ((t) == XPORT_ATA || (t) == XPORT_SATA) @@ -783,6 +786,19 @@ struct ccb_relsim { }; /* + * NVMe I/O Request CCB used for the XPT_NVME_IO function code. + */ +struct ccb_nvmeio { + struct ccb_hdr ccb_h; + union ccb *next_ccb; /* Ptr for next CCB for action */ + struct nvme_command cmd; /* NVME command, per NVME standard */ + struct nvme_completion cpl; /* NVME completion, per NVME standard */ + uint8_t *data_ptr; /* Ptr to the data buf/SG list */ + uint32_t dxfer_len; /* Data transfer length */ + uint32_t resid; /* Transfer residual length: 2's comp unused ?*/ +}; + +/* * Definitions for the asynchronous callback CCB fields. */ typedef enum { @@ -1234,6 +1250,7 @@ union ccb { struct ccb_ataio ataio; struct ccb_dev_advinfo cdai; struct ccb_async casync; + struct ccb_nvmeio nvmeio; }; #define CCB_CLEAR_ALL_EXCEPT_HDR(ccbp) \ @@ -1250,6 +1267,12 @@ cam_fill_csio(struct ccb_scsiio *csio, u u_int32_t timeout); static __inline void +cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, + u_int32_t timeout); + +static __inline void cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int32_t flags, u_int tag_action, u_int tag_id, @@ -1370,6 +1393,20 @@ cam_ccb_status(union ccb *ccb) void cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended); +static __inline void +cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, + u_int32_t timeout) +{ + nvmeio->ccb_h.func_code = XPT_NVME_IO; + nvmeio->ccb_h.flags = flags; + nvmeio->ccb_h.retry_count = retries; + nvmeio->ccb_h.cbfcnp = cbfcnp; + nvmeio->ccb_h.timeout = timeout; + nvmeio->data_ptr = data_ptr; + nvmeio->dxfer_len = dxfer_len; +} __END_DECLS #endif /* _CAM_CAM_CCB_H */ Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Thu Jun 9 22:25:00 2016 (r301770) +++ head/sys/cam/cam_xpt_internal.h Thu Jun 9 22:39:02 2016 (r301771) @@ -117,6 +117,8 @@ struct cam_ed { STAILQ_ENTRY(cam_ed) highpowerq_entry; struct mtx device_mtx; struct task device_destroy_task; + const struct nvme_controller_data *nvme_cdata; + const struct nvme_namespace_data *nvme_data; }; /* @@ -167,6 +169,7 @@ struct cam_path { struct xpt_xport * scsi_get_xport(void); struct xpt_xport * ata_get_xport(void); +struct xpt_xport * nvme_get_xport(void); struct cam_ed * xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, Added: head/sys/cam/nvme/nvme_all.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/nvme/nvme_all.c Thu Jun 9 22:39:02 2016 (r301771) @@ -0,0 +1,124 @@ +/*- + * Copyright (c) 2015 Netflix, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#ifdef _KERNEL +#include "opt_scsi.h" + +#include +#include +#include +#include +#else +#include +#include +#include +#include +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#endif +#endif + +#include +#include +#include +#include +#include +#include +#include + +void +nvme_ns_cmd(struct ccb_nvmeio *nvmeio, uint8_t cmd, uint32_t nsid, + uint32_t cdw10, uint32_t cdw11, uint32_t cdw12, uint32_t cdw13, + uint32_t cdw14, uint32_t cdw15) +{ + bzero(&nvmeio->cmd, sizeof(struct nvme_command)); + nvmeio->cmd.opc = cmd; + nvmeio->cmd.nsid = nsid; + nvmeio->cmd.cdw10 = cdw10; + nvmeio->cmd.cdw11 = cdw11; + nvmeio->cmd.cdw12 = cdw12; + nvmeio->cmd.cdw13 = cdw13; + nvmeio->cmd.cdw14 = cdw14; + nvmeio->cmd.cdw15 = cdw15; +} + +int +nvme_identify_match(caddr_t identbuffer, caddr_t table_entry) +{ + return 0; +} + + +void +nvme_print_ident(const struct nvme_controller_data *cdata, + const struct nvme_namespace_data *data) +{ + printf("I'm a pretty NVME drive\n"); +} + +/* XXX need to do nvme admin opcodes too, but those aren't used yet by nda */ +static const char * +nvme_opc2str[] = { + "FLUSH", + "WRITE", + "READ", + "RSVD-3", + "WRITE_UNCORRECTABLE", + "COMPARE", + "RSVD-6", + "RSVD-7", + "DATASET_MANAGEMENT" +}; + +const char * +nvme_op_string(const struct nvme_command *cmd) +{ + if (cmd->opc > nitems(nvme_opc2str)) + return "UNKNOWN"; + + return nvme_opc2str[cmd->opc]; +} + +const char * +nvme_cmd_string(const struct nvme_command *cmd, char *cmd_string, size_t len) +{ + /* + * cid, rsvd areas and mptr not printed, since they are used + * only internally by the SIM. + */ + snprintf(cmd_string, len, + "opc=%x fuse=%x nsid=%x prp1=%llx prp2=%llx cdw=%x %x %x %x %x %x", + cmd->opc, cmd->fuse, cmd->nsid, + (unsigned long long)cmd->prp1, (unsigned long long)cmd->prp2, + cmd->cdw10, cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14, cmd->cdw15); + + return cmd_string; +} Added: head/sys/cam/nvme/nvme_all.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/nvme/nvme_all.h Thu Jun 9 22:39:02 2016 (r301771) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2015 Netflix, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef CAM_NVME_NVME_ALL_H +#define CAM_NVME_NVME_ALL_H 1 + +#include + +struct ccb_nvmeio; + +#define NVME_REV_1 1 /* Supports NVMe 1.2 or earlier */ + +void nvme_ns_cmd(struct ccb_nvmeio *nvmeio, uint8_t cmd, uint32_t nsid, + uint32_t cdw10, uint32_t cdw11, uint32_t cdw12, uint32_t cdw13, + uint32_t cdw14, uint32_t cdw15); + +int nvme_identify_match(caddr_t identbuffer, caddr_t table_entry); + +void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *); +const char *nvme_op_string(const struct nvme_command *); +const char *nvme_cmd_string(const struct nvme_command *, char *, size_t); + +#endif /* CAM_NVME_NVME_ALL_H */ Added: head/sys/cam/nvme/nvme_da.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/nvme/nvme_da.c Thu Jun 9 22:39:02 2016 (r301771) @@ -0,0 +1,1152 @@ +/*- + * Copyright (c) 2015 Netflix, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Derived from ata_da.c: + * Copyright (c) 2009 Alexander Motin + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#ifdef _KERNEL +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif /* _KERNEL */ + +#ifndef _KERNEL +#include +#include +#endif /* _KERNEL */ + +#include +#include +#include +#include +#include +#include + +#include + +typedef enum { + NDA_STATE_NORMAL +} nda_state; + +typedef enum { + NDA_FLAG_OPEN = 0x0001, + NDA_FLAG_DIRTY = 0x0002, + NDA_FLAG_SCTX_INIT = 0x0004, +} nda_flags; + +typedef enum { + NDA_Q_4K = 0x01, + NDA_Q_NONE = 0x00, +} nda_quirks; + +#define NDA_Q_BIT_STRING \ + "\020" \ + "\001Bit 0" + +typedef enum { + NDA_CCB_BUFFER_IO = 0x01, + NDA_CCB_DUMP = 0x02, + NDA_CCB_TRIM = 0x03, + NDA_CCB_TYPE_MASK = 0x0F, +} nda_ccb_state; + +/* Offsets into our private area for storing information */ +#define ccb_state ppriv_field0 +#define ccb_bp ppriv_ptr1 + +struct trim_request { + TAILQ_HEAD(, bio) bps; +}; +struct nda_softc { + struct cam_iosched_softc *cam_iosched; + int outstanding_cmds; /* Number of active commands */ + int refcount; /* Active xpt_action() calls */ + nda_state state; + nda_flags flags; + nda_quirks quirks; + int unmappedio; + uint32_t nsid; /* Namespace ID for this nda device */ + struct disk *disk; + struct task sysctl_task; + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; + struct trim_request trim_req; +#ifdef CAM_IO_STATS + struct sysctl_ctx_list sysctl_stats_ctx; + struct sysctl_oid *sysctl_stats_tree; + u_int timeouts; + u_int errors; + u_int invalidations; +#endif +}; + +/* Need quirk table */ + +static disk_strategy_t ndastrategy; +static dumper_t ndadump; +static periph_init_t ndainit; +static void ndaasync(void *callback_arg, u_int32_t code, + struct cam_path *path, void *arg); +static void ndasysctlinit(void *context, int pending); +static periph_ctor_t ndaregister; +static periph_dtor_t ndacleanup; +static periph_start_t ndastart; +static periph_oninv_t ndaoninvalidate; +static void ndadone(struct cam_periph *periph, + union ccb *done_ccb); +static int ndaerror(union ccb *ccb, u_int32_t cam_flags, + u_int32_t sense_flags); +static void ndashutdown(void *arg, int howto); +static void ndasuspend(void *arg); + +#ifndef NDA_DEFAULT_SEND_ORDERED +#define NDA_DEFAULT_SEND_ORDERED 1 +#endif +#ifndef NDA_DEFAULT_TIMEOUT +#define NDA_DEFAULT_TIMEOUT 30 /* Timeout in seconds */ +#endif +#ifndef NDA_DEFAULT_RETRY +#define NDA_DEFAULT_RETRY 4 +#endif + + +//static int nda_retry_count = NDA_DEFAULT_RETRY; +static int nda_send_ordered = NDA_DEFAULT_SEND_ORDERED; +static int nda_default_timeout = NDA_DEFAULT_TIMEOUT; + +/* + * All NVMe media is non-rotational, so all nvme device instances + * share this to implement the sysctl. + */ +static int nda_rotating_media = 0; + +static SYSCTL_NODE(_kern_cam, OID_AUTO, nda, CTLFLAG_RD, 0, + "CAM Direct Access Disk driver"); + +static struct periph_driver ndadriver = +{ + ndainit, "nda", + TAILQ_HEAD_INITIALIZER(ndadriver.units), /* generation */ 0 +}; + +PERIPHDRIVER_DECLARE(nda, ndadriver); + +static MALLOC_DEFINE(M_NVMEDA, "nvme_da", "nvme_da buffers"); + +/* + * nice wrappers. Maybe these belong in nvme_all.c instead of + * here, but this is the only place that uses these. Should + * we ever grow another NVME periph, we should move them + * all there wholesale. + */ + +static void +nda_nvme_flush(struct nda_softc *softc, struct ccb_nvmeio *nvmeio) +{ + cam_fill_nvmeio(nvmeio, + 0, /* retries */ + ndadone, /* cbfcnp */ + CAM_DIR_NONE, /* flags */ + NULL, /* data_ptr */ + 0, /* dxfer_len */ + nda_default_timeout * 1000); /* timeout 5s */ + nvme_ns_flush_cmd(&nvmeio->cmd, softc->nsid); +} + +static void +nda_nvme_trim(struct nda_softc *softc, struct ccb_nvmeio *nvmeio, + void *payload, uint32_t num_ranges) +{ + cam_fill_nvmeio(nvmeio, + 0, /* retries */ + ndadone, /* cbfcnp */ + CAM_DIR_OUT, /* flags */ + payload, /* data_ptr */ + num_ranges * sizeof(struct nvme_dsm_range), /* dxfer_len */ + nda_default_timeout * 1000); /* timeout 5s */ + nvme_ns_trim_cmd(&nvmeio->cmd, softc->nsid, num_ranges); +} + +static void +nda_nvme_write(struct nda_softc *softc, struct ccb_nvmeio *nvmeio, + void *payload, uint64_t lba, uint32_t len, uint32_t count) +{ + cam_fill_nvmeio(nvmeio, + 0, /* retries */ + ndadone, /* cbfcnp */ + CAM_DIR_OUT, /* flags */ + payload, /* data_ptr */ + len, /* dxfer_len */ + nda_default_timeout * 1000); /* timeout 5s */ + nvme_ns_write_cmd(&nvmeio->cmd, softc->nsid, lba, count); +} + +static void +nda_nvme_rw_bio(struct nda_softc *softc, struct ccb_nvmeio *nvmeio, + struct bio *bp, uint32_t rwcmd) +{ + int flags = rwcmd == NVME_OPC_READ ? CAM_DIR_IN : CAM_DIR_OUT; + void *payload; + uint64_t lba; + uint32_t count; + + if (bp->bio_flags & BIO_UNMAPPED) { + flags |= CAM_DATA_BIO; + payload = bp; + } else { + payload = bp->bio_data; + } + + lba = bp->bio_pblkno; + count = bp->bio_bcount / softc->disk->d_sectorsize; + + cam_fill_nvmeio(nvmeio, + 0, /* retries */ + ndadone, /* cbfcnp */ + flags, /* flags */ + payload, /* data_ptr */ + bp->bio_bcount, /* dxfer_len */ + nda_default_timeout * 1000); /* timeout 5s */ + nvme_ns_rw_cmd(&nvmeio->cmd, rwcmd, softc->nsid, lba, count); +} + +static int +ndaopen(struct disk *dp) +{ + struct cam_periph *periph; + struct nda_softc *softc; + int error; + + periph = (struct cam_periph *)dp->d_drv1; + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + return(ENXIO); + } + + cam_periph_lock(periph); + if ((error = cam_periph_hold(periph, PRIBIO|PCATCH)) != 0) { + cam_periph_unlock(periph); + cam_periph_release(periph); + return (error); + } + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("ndaopen\n")); + + softc = (struct nda_softc *)periph->softc; + softc->flags |= NDA_FLAG_OPEN; + + cam_periph_unhold(periph); + cam_periph_unlock(periph); + return (0); +} + +static int +ndaclose(struct disk *dp) +{ + struct cam_periph *periph; + struct nda_softc *softc; + union ccb *ccb; + int error; + + periph = (struct cam_periph *)dp->d_drv1; + softc = (struct nda_softc *)periph->softc; + cam_periph_lock(periph); + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("ndaclose\n")); + + if ((softc->flags & NDA_FLAG_DIRTY) != 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0 && + cam_periph_hold(periph, PRIBIO) == 0) { + + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + nda_nvme_flush(softc, &ccb->nvmeio); + error = cam_periph_runccb(ccb, ndaerror, /*cam_flags*/0, + /*sense_flags*/0, softc->disk->d_devstat); + + if (error != 0) + xpt_print(periph->path, "Synchronize cache failed\n"); + else + softc->flags &= ~NDA_FLAG_DIRTY; + xpt_release_ccb(ccb); + cam_periph_unhold(periph); + } + + softc->flags &= ~NDA_FLAG_OPEN; + + while (softc->refcount != 0) + cam_periph_sleep(periph, &softc->refcount, PRIBIO, "ndaclose", 1); + cam_periph_unlock(periph); + cam_periph_release(periph); + return (0); +} + +static void +ndaschedule(struct cam_periph *periph) +{ + struct nda_softc *softc = (struct nda_softc *)periph->softc; + + if (softc->state != NDA_STATE_NORMAL) + return; + + cam_iosched_schedule(softc->cam_iosched, periph); +} + +/* + * Actually translate the requested transfer into one the physical driver + * can understand. The transfer is described by a buf and will include + * only one physical transfer. + */ +static void +ndastrategy(struct bio *bp) +{ + struct cam_periph *periph; + struct nda_softc *softc; + + periph = (struct cam_periph *)bp->bio_disk->d_drv1; + softc = (struct nda_softc *)periph->softc; + + cam_periph_lock(periph); + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ndastrategy(%p)\n", bp)); + + /* + * If the device has been made invalid, error out + */ + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { + cam_periph_unlock(periph); + biofinish(bp, NULL, ENXIO); + return; + } + + /* + * Place it in the queue of disk activities for this disk + */ + cam_iosched_queue_work(softc->cam_iosched, bp); + + /* + * Schedule ourselves for performing the work. + */ + ndaschedule(periph); + cam_periph_unlock(periph); + + return; +} + +static int +ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length) +{ + struct cam_periph *periph; + struct nda_softc *softc; + u_int secsize; + union ccb ccb; + struct disk *dp; + uint64_t lba; + uint32_t count; + int error = 0; + + dp = arg; + periph = dp->d_drv1; + softc = (struct nda_softc *)periph->softc; + cam_periph_lock(periph); + secsize = softc->disk->d_sectorsize; + lba = offset / secsize; + count = length / secsize; + + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { + cam_periph_unlock(periph); + return (ENXIO); + } + + if (length > 0) { + xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + ccb.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_write(softc, &ccb.nvmeio, virtual, lba, length, count); + xpt_polled_action(&ccb); + + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); + if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + printf("Aborting dump due to I/O error.\n"); + + cam_periph_unlock(periph); + return (error); + } + + /* Flush */ + xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + + ccb.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_flush(softc, &ccb.nvmeio); + xpt_polled_action(&ccb); + + error = cam_periph_error(&ccb, + 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); + if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + if (error != 0) + xpt_print(periph->path, "flush cmd failed\n"); + cam_periph_unlock(periph); + return (error); +} + +static void +ndainit(void) +{ + cam_status status; + + /* + * Install a global async callback. This callback will + * receive async callbacks like "new device found". + */ + status = xpt_register_async(AC_FOUND_DEVICE, ndaasync, NULL, NULL); + + if (status != CAM_REQ_CMP) { + printf("nda: Failed to attach master async callback " + "due to status 0x%x!\n", status); + } else if (nda_send_ordered) { + + /* Register our event handlers */ + if ((EVENTHANDLER_REGISTER(power_suspend, ndasuspend, + NULL, EVENTHANDLER_PRI_LAST)) == NULL) + printf("ndainit: power event registration failed!\n"); + if ((EVENTHANDLER_REGISTER(shutdown_post_sync, ndashutdown, + NULL, SHUTDOWN_PRI_DEFAULT)) == NULL) + printf("ndainit: shutdown event registration failed!\n"); + } +} + +/* + * Callback from GEOM, called when it has finished cleaning up its + * resources. + */ +static void +ndadiskgonecb(struct disk *dp) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)dp->d_drv1; + + cam_periph_release(periph); +} + +static void +ndaoninvalidate(struct cam_periph *periph) +{ + struct nda_softc *softc; + + softc = (struct nda_softc *)periph->softc; + + /* + * De-register any async callbacks. + */ + xpt_register_async(0, ndaasync, periph, periph->path); +#ifdef CAM_IO_STATS + softc->invalidations++; +#endif + + /* + * Return all queued I/O with ENXIO. + * XXX Handle any transactions queued to the card + * with XPT_ABORT_CCB. + */ + cam_iosched_flush(softc->cam_iosched, NULL, ENXIO); + + disk_gone(softc->disk); +} + +static void +ndacleanup(struct cam_periph *periph) +{ + struct nda_softc *softc; + + softc = (struct nda_softc *)periph->softc; + + cam_periph_unlock(periph); + + cam_iosched_fini(softc->cam_iosched); + + /* + * If we can't free the sysctl tree, oh well... + */ + if ((softc->flags & NDA_FLAG_SCTX_INIT) != 0) { +#ifdef CAM_IO_STATS + if (sysctl_ctx_free(&softc->sysctl_stats_ctx) != 0) + xpt_print(periph->path, + "can't remove sysctl stats context\n"); +#endif + if (sysctl_ctx_free(&softc->sysctl_ctx) != 0) + xpt_print(periph->path, + "can't remove sysctl context\n"); + } + + disk_destroy(softc->disk); + free(softc, M_DEVBUF); + cam_periph_lock(periph); +} + +static void +ndaasync(void *callback_arg, u_int32_t code, + struct cam_path *path, void *arg) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)callback_arg; + switch (code) { + case AC_FOUND_DEVICE: + { + struct ccb_getdev *cgd; + cam_status status; + + cgd = (struct ccb_getdev *)arg; + if (cgd == NULL) + break; + + if (cgd->protocol != PROTO_NVME) + break; + + /* + * Allocate a peripheral instance for + * this device and start the probe + * process. + */ + status = cam_periph_alloc(ndaregister, ndaoninvalidate, + ndacleanup, ndastart, + "nda", CAM_PERIPH_BIO, + path, ndaasync, + AC_FOUND_DEVICE, cgd); + + if (status != CAM_REQ_CMP + && status != CAM_REQ_INPROG) + printf("ndaasync: Unable to attach to new device " + "due to status 0x%x\n", status); + break; + } + case AC_ADVINFO_CHANGED: + { + uintptr_t buftype; + + buftype = (uintptr_t)arg; + if (buftype == CDAI_TYPE_PHYS_PATH) { + struct nda_softc *softc; + + softc = periph->softc; + disk_attr_changed(softc->disk, "GEOM::physpath", + M_NOWAIT); + } + break; + } + case AC_LOST_DEVICE: + default: + cam_periph_async(periph, code, path, arg); + break; + } +} + +static void +ndasysctlinit(void *context, int pending) +{ + struct cam_periph *periph; + struct nda_softc *softc; + char tmpstr[80], tmpstr2[80]; + + periph = (struct cam_periph *)context; + + /* periph was held for us when this task was enqueued */ + if ((periph->flags & CAM_PERIPH_INVALID) != 0) { + cam_periph_release(periph); + return; + } + + softc = (struct nda_softc *)periph->softc; + snprintf(tmpstr, sizeof(tmpstr), "CAM NDA unit %d", periph->unit_number); + snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); + + sysctl_ctx_init(&softc->sysctl_ctx); + softc->flags |= NDA_FLAG_SCTX_INIT; + softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_kern_cam_nda), OID_AUTO, tmpstr2, + CTLFLAG_RD, 0, tmpstr); + if (softc->sysctl_tree == NULL) { + printf("ndasysctlinit: unable to allocate sysctl tree\n"); + cam_periph_release(periph); + return; + } + + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "unmapped_io", CTLFLAG_RD | CTLFLAG_MPSAFE, + &softc->unmappedio, 0, "Unmapped I/O leaf"); + + SYSCTL_ADD_INT(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, + "rotating", + CTLFLAG_RD | CTLFLAG_MPSAFE, + &nda_rotating_media, + 0, + "Rotating media"); + +#ifdef CAM_IO_STATS + softc->sysctl_stats_tree = SYSCTL_ADD_NODE(&softc->sysctl_stats_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "stats", + CTLFLAG_RD, 0, "Statistics"); + if (softc->sysctl_stats_tree == NULL) { + printf("ndasysctlinit: unable to allocate sysctl tree for stats\n"); + cam_periph_release(periph); + return; + } + SYSCTL_ADD_INT(&softc->sysctl_stats_ctx, + SYSCTL_CHILDREN(softc->sysctl_stats_tree), + OID_AUTO, "timeouts", CTLFLAG_RD | CTLFLAG_MPSAFE, + &softc->timeouts, 0, + "Device timeouts reported by the SIM"); + SYSCTL_ADD_INT(&softc->sysctl_stats_ctx, + SYSCTL_CHILDREN(softc->sysctl_stats_tree), + OID_AUTO, "errors", CTLFLAG_RD | CTLFLAG_MPSAFE, + &softc->errors, 0, + "Transport errors reported by the SIM."); + SYSCTL_ADD_INT(&softc->sysctl_stats_ctx, + SYSCTL_CHILDREN(softc->sysctl_stats_tree), + OID_AUTO, "pack_invalidations", CTLFLAG_RD | CTLFLAG_MPSAFE, + &softc->invalidations, 0, + "Device pack invalidations."); +#endif + + cam_iosched_sysctl_init(softc->cam_iosched, &softc->sysctl_ctx, + softc->sysctl_tree); + + cam_periph_release(periph); +} + +static int +ndagetattr(struct bio *bp) +{ + int ret; + struct cam_periph *periph; + + periph = (struct cam_periph *)bp->bio_disk->d_drv1; + cam_periph_lock(periph); + ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, + periph->path); + cam_periph_unlock(periph); + if (ret == 0) + bp->bio_completed = bp->bio_length; + return ret; +} + +static cam_status +ndaregister(struct cam_periph *periph, void *arg) +{ + struct nda_softc *softc; + struct disk *disk; + struct ccb_pathinq cpi; + struct ccb_getdev *cgd; + const struct nvme_namespace_data *nsd; + const struct nvme_controller_data *cd; + char announce_buf[80]; +// caddr_t match; + u_int maxio; + int quirks; + + cgd = (struct ccb_getdev *)arg; + if (cgd == NULL) { + printf("ndaregister: no getdev CCB, can't register device\n"); + return(CAM_REQ_CMP_ERR); + } + nsd = cgd->nvme_data; + cd = cgd->nvme_cdata; + + softc = (struct nda_softc *)malloc(sizeof(*softc), M_DEVBUF, + M_NOWAIT | M_ZERO); + + if (softc == NULL) { + printf("ndaregister: Unable to probe new device. " + "Unable to allocate softc\n"); + return(CAM_REQ_CMP_ERR); + } + + if (cam_iosched_init(&softc->cam_iosched, periph) != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 10 00:00:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA70B70943; Fri, 10 Jun 2016 00:00:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A79F11A0; Fri, 10 Jun 2016 00:00:27 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A00QZa015073; Fri, 10 Jun 2016 00:00:26 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A00QiO015063; Fri, 10 Jun 2016 00:00:26 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606100000.u5A00QiO015063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 10 Jun 2016 00:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301772 - in stable/10: sbin/ipfw sys/conf sys/modules/dummynet sys/netinet sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 00:00:27 -0000 Author: truckman Date: Fri Jun 10 00:00:25 2016 New Revision: 301772 URL: https://svnweb.freebsd.org/changeset/base/301772 Log: MFC r300779, r300781, r300783, r300784, r300949, r301162, r301180 r300779 | truckman | 2016-05-26 14:40:13 -0700 (Thu, 26 May 2016) | 64 lines Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). Centre for Advanced Internet Architectures Implementing AQM in FreeBSD * Overview * Articles, Papers and Presentations * Patches and Tools Overview Recent years have seen a resurgence of interest in better managing the depth of bottleneck queues in routers, switches and other places that get congested. Solutions include transport protocol enhancements at the end-hosts (such as delay-based or hybrid congestion control schemes) and active queue management (AQM) schemes applied within bottleneck queues. The notion of AQM has been around since at least the late 1990s (e.g. RFC 2309). In recent years the proliferation of oversized buffers in all sorts of network devices (aka bufferbloat) has stimulated keen community interest in four new AQM schemes -- CoDel, FQ-CoDel, PIE and FQ-PIE. The IETF AQM working group is looking to document these schemes, and independent implementations are a corner-stone of the IETF's process for confirming the clarity of publicly available protocol descriptions. While significant development work on all three schemes has occured in the Linux kernel, there is very little in FreeBSD. Project Goals This project began in late 2015, and aims to design and implement functionally-correct versions of CoDel, FQ-CoDel, PIE and FQ_PIE in FreeBSD (with code BSD-licensed as much as practical). We have chosen to do this as extensions to FreeBSD's ipfw/dummynet firewall and traffic shaper. Implementation of these AQM schemes in FreeBSD will: * Demonstrate whether the publicly available documentation is sufficient to enable independent, functionally equivalent implementations * Provide a broader suite of AQM options for sections the networking community that rely on FreeBSD platforms Program Members: * Rasool Al Saadi (developer) * Grenville Armitage (project lead) Acknowledgements: This project has been made possible in part by a gift from the Comcast Innovation Fund. Submitted by: Rasool Al-Saadi X-No objection: core MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6388 [Remove some code that was added to the mq_append() inline function in HEAD by r258457, which was not merged to stable/10. The AQM patch moved mq_append() from ip_dn_io.c to the new file ip_dn_private.h, so we need to remove that copy of the r258457 changes.] ------------------------------------------------------------------------ r300781 | truckman | 2016-05-26 14:44:52 -0700 (Thu, 26 May 2016) | 7 lines Modify BOUND_VAR() macro to wrap all of its arguments in () and tweak its expression to work on powerpc and sparc64 (gcc compatibility). Correct a typo in a nearby comment. MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r300783 | truckman | 2016-05-26 15:03:28 -0700 (Thu, 26 May 2016) | 4 lines Correct a typo in a comment. MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r300784 | truckman | 2016-05-26 15:07:09 -0700 (Thu, 26 May 2016) | 5 lines Include the new AQM files when compiling a kernel with options DUMMYNET. Reported by: Nikolay Denev MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r300949 | truckman | 2016-05-29 00:23:56 -0700 (Sun, 29 May 2016) | 10 lines Cast some expressions that multiply a long long constant by a floating point constant to int64_t. This avoids the runtime conversion of the the other operand in a set of comparisons from int64_t to floating point and doing the comparisions in floating point. Suggested by: lidl Submitted by: Rasool Al-Saadi MFC after: 2 weeks (with r300779) ------------------------------------------------------------------------ r301162 | truckman | 2016-06-01 13:04:24 -0700 (Wed, 01 Jun 2016) | 9 lines Replace constant expressions that contain multiplications by fractional floating point values with integer divides. This will eliminate any chance that the compiler will generate code to evaluate the expression using floating point at runtime. Suggested by: bde Submitted by: Rasool Al-Saadi MFC after: 8 days (with r300779 and r300949) ------------------------------------------------------------------------ r301180 | truckman | 2016-06-01 17:42:15 -0700 (Wed, 01 Jun 2016) | 2 lines Belatedly bump .Dd date for Dummynet AQM import in r300779. Relnotes: yes Added: stable/10/sys/netpfil/ipfw/dn_aqm.h - copied, changed from r300779, head/sys/netpfil/ipfw/dn_aqm.h stable/10/sys/netpfil/ipfw/dn_aqm_codel.c - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_aqm_codel.c stable/10/sys/netpfil/ipfw/dn_aqm_codel.h - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_aqm_codel.h stable/10/sys/netpfil/ipfw/dn_aqm_pie.c - copied, changed from r300779, head/sys/netpfil/ipfw/dn_aqm_pie.c stable/10/sys/netpfil/ipfw/dn_aqm_pie.h - copied, changed from r300779, head/sys/netpfil/ipfw/dn_aqm_pie.h stable/10/sys/netpfil/ipfw/dn_sched_fq_codel.c - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_sched_fq_codel.c stable/10/sys/netpfil/ipfw/dn_sched_fq_codel.h - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_sched_fq_codel.h stable/10/sys/netpfil/ipfw/dn_sched_fq_codel_helper.h - copied unchanged from r300779, head/sys/netpfil/ipfw/dn_sched_fq_codel_helper.h stable/10/sys/netpfil/ipfw/dn_sched_fq_pie.c - copied, changed from r300779, head/sys/netpfil/ipfw/dn_sched_fq_pie.c Modified: stable/10/sbin/ipfw/dummynet.c stable/10/sbin/ipfw/ipfw.8 stable/10/sbin/ipfw/ipfw2.h stable/10/sys/conf/files stable/10/sys/modules/dummynet/Makefile stable/10/sys/netinet/ip_dummynet.h stable/10/sys/netpfil/ipfw/dn_sched.h stable/10/sys/netpfil/ipfw/dn_sched_fifo.c stable/10/sys/netpfil/ipfw/dn_sched_prio.c stable/10/sys/netpfil/ipfw/dn_sched_qfq.c stable/10/sys/netpfil/ipfw/dn_sched_rr.c stable/10/sys/netpfil/ipfw/dn_sched_wf2q.c stable/10/sys/netpfil/ipfw/ip_dn_glue.c stable/10/sys/netpfil/ipfw/ip_dn_io.c stable/10/sys/netpfil/ipfw/ip_dn_private.h stable/10/sys/netpfil/ipfw/ip_dummynet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ipfw/dummynet.c ============================================================================== --- stable/10/sbin/ipfw/dummynet.c Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sbin/ipfw/dummynet.c Fri Jun 10 00:00:25 2016 (r301772) @@ -1,4 +1,11 @@ /* + * Codel/FQ_Codel and PIE/FQ_PIE Code: + * Copyright (C) 2016 Centre for Advanced Internet Architectures, + * Swinburne University of Technology, Melbourne, Australia. + * Portions of this code were made possible in part by a gift from + * The Comcast Innovation Fund. + * Implemented by Rasool Al-Saadi + * * Copyright (c) 2002-2003,2010 Luigi Rizzo * * Redistribution and use in source forms, with and without modification, @@ -15,6 +22,7 @@ * dummynet support */ +#define NEW_AQM #include #include /* XXX there are several sysctl leftover here */ @@ -22,6 +30,10 @@ #include "ipfw2.h" +#ifdef NEW_AQM +#include +#endif + #include #include #include @@ -59,6 +71,12 @@ static struct _s_x dummynet_params[] = { { "ecn", TOK_ECN }, { "red", TOK_RED }, { "gred", TOK_GRED }, +#ifdef NEW_AQM + { "codel", TOK_CODEL}, /* Codel AQM */ + { "fq_codel", TOK_FQ_CODEL}, /* FQ-Codel */ + { "pie", TOK_PIE}, /* PIE AQM */ + { "fq_pie", TOK_FQ_PIE}, /* FQ-PIE */ +#endif { "bw", TOK_BW }, { "bandwidth", TOK_BW }, { "delay", TOK_DELAY }, @@ -81,6 +99,32 @@ static struct _s_x dummynet_params[] = { { NULL, 0 } /* terminator */ }; +#ifdef NEW_AQM +/* AQM/extra sched parameters tokens*/ +static struct _s_x aqm_params[] = { + { "target", TOK_TARGET}, + { "interval", TOK_INTERVAL}, + { "limit", TOK_LIMIT}, + { "flows", TOK_FLOWS}, + { "quantum", TOK_QUANTUM}, + { "ecn", TOK_ECN}, + { "noecn", TOK_NO_ECN}, + { "tupdate", TOK_TUPDATE}, + { "max_burst", TOK_MAX_BURST}, + { "max_ecnth", TOK_MAX_ECNTH}, + { "alpha", TOK_ALPHA}, + { "beta", TOK_BETA}, + { "capdrop", TOK_CAPDROP}, + { "nocapdrop", TOK_NO_CAPDROP}, + { "onoff", TOK_ONOFF}, + { "dre", TOK_DRE}, + { "ts", TOK_TS}, + { "derand", TOK_DERAND}, + { "noderand", TOK_NO_DERAND}, + { NULL, 0 } /* terminator */ +}; +#endif + #define O_NEXT(p, len) ((void *)((char *)p + len)) static void @@ -102,6 +146,214 @@ o_next(struct dn_id **o, int len, int ty return ret; } +#ifdef NEW_AQM + +/* Codel flags */ +enum { + CODEL_ECN_ENABLED = 1 +}; + +/* PIE flags, from PIE kernel module */ +enum { + PIE_ECN_ENABLED = 1, + PIE_CAPDROP_ENABLED = 2, + PIE_ON_OFF_MODE_ENABLED = 4, + PIE_DEPRATEEST_ENABLED = 8, + PIE_DERAND_ENABLED = 16 +}; + +#define PIE_FIX_POINT_BITS 13 +#define PIE_SCALE (1L<15) + return -1; + for (i = 0; ioid, l, DN_CMD_GET, DN_API_VERSION); + ep->oid.len = l; + ep->oid.subtype = subtype; + ep->nr = nr; + + ret = do_cmd(-IP_DUMMYNET3, ep, (uintptr_t)&l); + if (ret) { + free(ep); + errx(EX_DATAERR, "Error getting extra parameters\n"); + } + + switch (subtype) { + case DN_AQM_PARAMS: + if( !strcasecmp(ep->name, "codel")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + l = sprintf(out, " AQM CoDel target %s interval %s", + strt1, strt2); + if (ep->par[2] & CODEL_ECN_ENABLED) + l = sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + } else if( !strcasecmp(ep->name, "pie")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + us_to_time(ep->par[2], strt3); + l = sprintf(out, " AQM type PIE target %s tupdate %s alpha " + "%g beta %g max_burst %s max_ecnth %.3g", + strt1, + strt2, + ep->par[4] / (float) PIE_SCALE, + ep->par[5] / (float) PIE_SCALE, + strt3, + ep->par[3] / (float) PIE_SCALE + ); + + if (ep->par[6] & PIE_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + if (ep->par[6] & PIE_CAPDROP_ENABLED) + l += sprintf(out + l, " CapDrop"); + else + l += sprintf(out + l, " NoCapDrop"); + if (ep->par[6] & PIE_ON_OFF_MODE_ENABLED) + l += sprintf(out + l, " OnOff"); + if (ep->par[6] & PIE_DEPRATEEST_ENABLED) + l += sprintf(out + l, " DRE"); + else + l += sprintf(out + l, " TS"); + if (ep->par[6] & PIE_DERAND_ENABLED) + l += sprintf(out + l, " Derand"); + else + l += sprintf(out + l, " NoDerand"); + } + break; + + case DN_SCH_PARAMS: + if (!strcasecmp(ep->name,"FQ_CODEL")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + l = sprintf(out," FQ_CODEL target %s interval %s" + " quantum %jd limit %jd flows %jd", + strt1, strt2, + (intmax_t) ep->par[3], + (intmax_t) ep->par[4], + (intmax_t) ep->par[5] + ); + if (ep->par[2] & CODEL_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + l += sprintf(out + l, "\n"); + } else if (!strcasecmp(ep->name,"FQ_PIE")) { + us_to_time(ep->par[0], strt1); + us_to_time(ep->par[1], strt2); + us_to_time(ep->par[2], strt3); + l = sprintf(out, " FQ_PIE target %s tupdate %s alpha " + "%g beta %g max_burst %s max_ecnth %.3g" + " quantum %jd limit %jd flows %jd", + strt1, + strt2, + ep->par[4] / (float) PIE_SCALE, + ep->par[5] / (float) PIE_SCALE, + strt3, + ep->par[3] / (float) PIE_SCALE, + (intmax_t) ep->par[7], + (intmax_t) ep->par[8], + (intmax_t) ep->par[9] + ); + + if (ep->par[6] & PIE_ECN_ENABLED) + l += sprintf(out + l, " ECN"); + else + l += sprintf(out + l, " NoECN"); + if (ep->par[6] & PIE_CAPDROP_ENABLED) + l += sprintf(out + l, " CapDrop"); + else + l += sprintf(out + l, " NoCapDrop"); + if (ep->par[6] & PIE_ON_OFF_MODE_ENABLED) + l += sprintf(out + l, " OnOff"); + if (ep->par[6] & PIE_DEPRATEEST_ENABLED) + l += sprintf(out + l, " DRE"); + else + l += sprintf(out + l, " TS"); + if (ep->par[6] & PIE_DERAND_ENABLED) + l += sprintf(out + l, " Derand"); + else + l += sprintf(out + l, " NoDerand"); + l += sprintf(out + l, "\n"); + } + break; + } + + free(ep); +} +#endif + + #if 0 static int sort_q(void *arg, const void *pa, const void *pb) @@ -225,7 +477,7 @@ print_flowset_parms(struct dn_fs *fs, ch int l; char qs[30]; char plr[30]; - char red[90]; /* Display RED parameters */ + char red[200]; /* Display RED parameters */ l = fs->qsize; if (fs->flags & DN_QSIZE_BYTES) { @@ -250,6 +502,11 @@ print_flowset_parms(struct dn_fs *fs, ch 1.0 * fs->max_p / (double)(1 << SCALE_RED)); if (fs->flags & DN_IS_ECN) strncat(red, " (ecn)", 6); +#ifdef NEW_AQM + /* get AQM parameters */ + } else if (fs->flags & DN_IS_AQM) { + get_extra_parms(fs->fs_nr, red, DN_AQM_PARAMS); +#endif } else sprintf(red, "droptail"); @@ -340,6 +597,11 @@ list_pipes(struct dn_id *oid, struct dn_ printf(" sched %d type %s flags 0x%x %d buckets %d active\n", s->sched_nr, s->name, s->flags, s->buckets, s->oid.id); +#ifdef NEW_AQM + char parms[200]; + get_extra_parms(s->sched_nr, parms, DN_SCH_PARAMS); + printf("%s",parms); +#endif if (s->flags & DN_HAVE_MASK) print_mask(&s->sched_mask); } @@ -740,6 +1002,242 @@ load_extra_delays(const char *filename, strncpy(p->name, profile_name, sizeof(p->name)); } +#ifdef NEW_AQM + +/* Parse AQM/extra scheduler parameters */ +static int +process_extra_parms(int *ac, char **av, struct dn_extra_parms *ep, + uint16_t type) +{ + int i; + + /* use kernel defaults */ + for (i=0; ipar[i] = -1; + + switch(type) { + case TOK_CODEL: + case TOK_FQ_CODEL: + /* Codel + * 0- target, 1- interval, 2- flags, + * FQ_CODEL + * 3- quantum, 4- limit, 5- flows + */ + if (type==TOK_CODEL) + ep->par[2] = 0; + else + ep->par[2] = CODEL_ECN_ENABLED; + + while (*ac > 0) { + int tok = match_token(aqm_params, *av); + (*ac)--; av++; + switch(tok) { + case TOK_TARGET: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "target needs time\n"); + + ep->par[0] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_INTERVAL: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "interval needs time\n"); + + ep->par[1] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_ECN: + ep->par[2] = CODEL_ECN_ENABLED; + break; + case TOK_NO_ECN: + ep->par[2] &= ~CODEL_ECN_ENABLED; + break; + /* Config fq_codel parameters */ + case TOK_QUANTUM: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "quantum is not for codel\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "quantum needs number\n"); + + ep->par[3]= atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_LIMIT: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "limit is not for codel, use queue instead\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "limit needs number\n"); + + ep->par[4] = atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_FLOWS: + if (type != TOK_FQ_CODEL) + errx(EX_DATAERR, "flows is not for codel\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "flows needs number\n"); + + ep->par[5] = atoi(av[0]); + (*ac)--; av++; + break; + + default: + printf("%s is Invalid parameter\n", av[-1]); + } + } + break; + case TOK_PIE: + case TOK_FQ_PIE: + /* PIE + * 0- target , 1- tupdate, 2- max_burst, + * 3- max_ecnth, 4- alpha, + * 5- beta, 6- flags + * FQ_CODEL + * 7- quantum, 8- limit, 9- flows + */ + + if ( type == TOK_PIE) + ep->par[6] = PIE_CAPDROP_ENABLED | PIE_DEPRATEEST_ENABLED + | PIE_DERAND_ENABLED; + else + /* for FQ-PIE, use TS mode */ + ep->par[6] = PIE_CAPDROP_ENABLED | PIE_DERAND_ENABLED + | PIE_ECN_ENABLED; + + while (*ac > 0) { + int tok = match_token(aqm_params, *av); + (*ac)--; av++; + switch(tok) { + case TOK_TARGET: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "target needs time\n"); + + ep->par[0] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_TUPDATE: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "tupdate needs time\n"); + + ep->par[1] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_MAX_BURST: + if (*ac <= 0 || time_to_us(av[0]) < 0) + errx(EX_DATAERR, "max_burst needs time\n"); + + ep->par[2] = time_to_us(av[0]); + (*ac)--; av++; + break; + + case TOK_MAX_ECNTH: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "max_ecnth needs number\n"); + + ep->par[3] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_ALPHA: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "alpha needs number\n"); + + ep->par[4] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_BETA: + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "beta needs number\n"); + + ep->par[5] = atof(av[0]) * PIE_SCALE; + (*ac)--; av++; + break; + + case TOK_ECN: + ep->par[6] |= PIE_ECN_ENABLED; + break; + case TOK_NO_ECN: + ep->par[6] &= ~PIE_ECN_ENABLED; + break; + + case TOK_CAPDROP: + ep->par[6] |= PIE_CAPDROP_ENABLED; + break; + case TOK_NO_CAPDROP: + ep->par[6] &= ~PIE_CAPDROP_ENABLED; + break; + + case TOK_ONOFF: + ep->par[6] |= PIE_ON_OFF_MODE_ENABLED; + break; + + case TOK_DRE: + ep->par[6] |= PIE_DEPRATEEST_ENABLED; + break; + + case TOK_TS: + ep->par[6] &= ~PIE_DEPRATEEST_ENABLED; + break; + + case TOK_DERAND: + ep->par[6] |= PIE_DERAND_ENABLED; + break; + case TOK_NO_DERAND: + ep->par[6] &= ~PIE_DERAND_ENABLED; + break; + + /* Config fq_pie parameters */ + case TOK_QUANTUM: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "quantum is not for pie\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "quantum needs number\n"); + + ep->par[7]= atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_LIMIT: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "limit is not for pie, use queue instead\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "limit needs number\n"); + + ep->par[8] = atoi(av[0]); + (*ac)--; av++; + break; + + case TOK_FLOWS: + if (type != TOK_FQ_PIE) + errx(EX_DATAERR, "flows is not for pie\n"); + if (*ac <= 0 || !is_valid_number(av[0])) + errx(EX_DATAERR, "flows needs number\n"); + + ep->par[9] = atoi(av[0]); + (*ac)--; av++; + break; + + + default: + printf("%s is invalid parameter\n", av[-1]); + } + } + break; + } + + return 0; +} + +#endif + + /* * configuration of pipes, schedulers, flowsets. * When we configure a new scheduler, an empty pipe is created, so: @@ -771,6 +1269,12 @@ ipfw_config_pipe(int ac, char **av) struct dn_fs *fs = NULL; struct dn_profile *pf = NULL; struct ipfw_flow_id *mask = NULL; +#ifdef NEW_AQM + struct dn_extra_parms *aqm_extra; + struct dn_extra_parms *sch_extra; + int lmax_extra; +#endif + int lmax; uint32_t _foo = 0, *flags = &_foo , *buckets = &_foo; @@ -782,6 +1286,15 @@ ipfw_config_pipe(int ac, char **av) lmax += sizeof(struct dn_sch) + sizeof(struct dn_link) + sizeof(struct dn_fs) + sizeof(struct dn_profile); +#ifdef NEW_AQM + /* Extra Params */ + lmax_extra = sizeof(struct dn_extra_parms); + /* two lmax_extra because one for AQM params and another + * sch params + */ + lmax += lmax_extra*2; +#endif + av++; ac--; /* Pipe number */ if (ac && isdigit(**av)) { @@ -807,8 +1320,16 @@ ipfw_config_pipe(int ac, char **av) * The FIFO scheduler and link are derived from the * WF2Q+ one in the kernel. */ +#ifdef NEW_AQM + sch_extra = o_next(&buf, lmax_extra, DN_TEXT); + sch_extra ->oid.subtype = 0; /* don't configure scheduler */ +#endif sch = o_next(&buf, sizeof(*sch), DN_SCH); p = o_next(&buf, sizeof(*p), DN_LINK); +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; /* don't configure AQM */ +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); sch->sched_nr = i; @@ -826,6 +1347,10 @@ ipfw_config_pipe(int ac, char **av) break; case 2: /* "queue N config ... " */ +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); fs->fs_nr = i; mask = &fs->flow_mask; @@ -834,7 +1359,15 @@ ipfw_config_pipe(int ac, char **av) break; case 3: /* "sched N config ..." */ +#ifdef NEW_AQM + sch_extra = o_next(&buf, lmax_extra, DN_TEXT); + sch_extra ->oid.subtype = 0; +#endif sch = o_next(&buf, sizeof(*sch), DN_SCH); +#ifdef NEW_AQM + aqm_extra = o_next(&buf, lmax_extra, DN_TEXT); + aqm_extra ->oid.subtype = 0; +#endif fs = o_next(&buf, sizeof(*fs), DN_FS); sch->sched_nr = i; mask = &sch->sched_mask; @@ -1021,7 +1554,31 @@ ipfw_config_pipe(int ac, char **av) } /* end while, config masks */ end_mask: break; +#ifdef NEW_AQM + case TOK_CODEL: + case TOK_PIE: + NEED(fs, "codel/pie is only for flowsets"); + + fs->flags &= ~(DN_IS_RED|DN_IS_GENTLE_RED); + fs->flags |= DN_IS_AQM; + + strcpy(aqm_extra->name,av[-1]); + aqm_extra->oid.subtype = DN_AQM_PARAMS; + + process_extra_parms(&ac, av, aqm_extra, tok); + break; + case TOK_FQ_CODEL: + case TOK_FQ_PIE: + if (!strcmp(av[-1],"type")) + errx(EX_DATAERR, "use type before fq_codel/fq_pie"); + + NEED(sch, "fq_codel/fq_pie is only for schd"); + strcpy(sch_extra->name,av[-1]); + sch_extra->oid.subtype = DN_SCH_PARAMS; + process_extra_parms(&ac, av, sch_extra, tok); + break; +#endif case TOK_RED: case TOK_GRED: NEED1("red/gred needs w_q/min_th/max_th/max_p\n"); @@ -1088,7 +1645,20 @@ end_mask: errx(1, "type %s too long\n", av[0]); strcpy(sch->name, av[0]); sch->oid.subtype = 0; /* use string */ - ac--; av++; +#ifdef NEW_AQM + /* if fq_codel is selected, consider all tokens after it + * as parameters + */ + if (!strcasecmp(av[0],"fq_codel") || !strcasecmp(av[0],"fq_pie")){ + strcpy(sch_extra->name,av[0]); + sch_extra->oid.subtype = DN_SCH_PARAMS; + process_extra_parms(&ac, av, sch_extra, tok); + } else { + ac--;av++; + } +#else + ac--;av++; +#endif break; } @@ -1182,9 +1752,17 @@ end_mask: errx(EX_DATAERR, "2 <= queue size <= %ld", limit); } +#ifdef NEW_AQM + if ((fs->flags & DN_IS_ECN) && !((fs->flags & DN_IS_RED)|| + (fs->flags & DN_IS_AQM))) + errx(EX_USAGE, "ECN can be used with red/gred/" + "codel/fq_codel only!"); +#else if ((fs->flags & DN_IS_ECN) && !(fs->flags & DN_IS_RED)) errx(EX_USAGE, "enable red/gred for ECN"); +#endif + if (fs->flags & DN_IS_RED) { size_t len; int lookup_depth, avg_pkt_size; Modified: stable/10/sbin/ipfw/ipfw.8 ============================================================================== --- stable/10/sbin/ipfw/ipfw.8 Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sbin/ipfw/ipfw.8 Fri Jun 10 00:00:25 2016 (r301772) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2014 +.Dd May 26, 2016 .Dt IPFW 8 .Os .Sh NAME Modified: stable/10/sbin/ipfw/ipfw2.h ============================================================================== --- stable/10/sbin/ipfw/ipfw2.h Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sbin/ipfw/ipfw2.h Fri Jun 10 00:00:25 2016 (r301772) @@ -168,6 +168,31 @@ enum tokens { TOK_ECN, TOK_DROPTAIL, TOK_PROTO, +#ifdef NEW_AQM + /* AQM tokens*/ + TOK_NO_ECN, + TOK_CODEL, + TOK_FQ_CODEL, + TOK_TARGET, + TOK_INTERVAL, + TOK_FLOWS, + TOK_QUANTUM, + + TOK_PIE, + TOK_FQ_PIE, + TOK_TUPDATE, + TOK_MAX_BURST, + TOK_MAX_ECNTH, + TOK_ALPHA, + TOK_BETA, + TOK_CAPDROP, + TOK_NO_CAPDROP, + TOK_ONOFF, + TOK_DRE, + TOK_TS, + TOK_DERAND, + TOK_NO_DERAND, +#endif /* dummynet tokens */ TOK_WEIGHT, TOK_LMAX, Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sys/conf/files Fri Jun 10 00:00:25 2016 (r301772) @@ -3592,8 +3592,12 @@ netipx/spx_usrreq.c optional ipx netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm +netpfil/ipfw/dn_aqm_codel.c optional inet dummynet +netpfil/ipfw/dn_aqm_pie.c optional inet dummynet netpfil/ipfw/dn_heap.c optional inet dummynet netpfil/ipfw/dn_sched_fifo.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_codel.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_pie.c optional inet dummynet netpfil/ipfw/dn_sched_prio.c optional inet dummynet netpfil/ipfw/dn_sched_qfq.c optional inet dummynet netpfil/ipfw/dn_sched_rr.c optional inet dummynet Modified: stable/10/sys/modules/dummynet/Makefile ============================================================================== --- stable/10/sys/modules/dummynet/Makefile Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sys/modules/dummynet/Makefile Fri Jun 10 00:00:25 2016 (r301772) @@ -6,8 +6,9 @@ KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c +SRCS+= dn_aqm_codel.c dn_aqm_pie.c SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c -SRCS+= dn_sched_prio.c +SRCS+= dn_sched_prio.c dn_sched_fq_codel.c dn_sched_fq_pie.c SRCS+= opt_inet6.h .if !defined(KERNBUILDDIR) Modified: stable/10/sys/netinet/ip_dummynet.h ============================================================================== --- stable/10/sys/netinet/ip_dummynet.h Thu Jun 9 22:39:02 2016 (r301771) +++ stable/10/sys/netinet/ip_dummynet.h Fri Jun 10 00:00:25 2016 (r301772) @@ -29,7 +29,7 @@ #ifndef _IP_DUMMYNET_H #define _IP_DUMMYNET_H - +#define NEW_AQM /* * Definition of the kernel-userland API for dummynet. * @@ -85,7 +85,13 @@ enum { /* special commands for emulation of sysctl variables */ DN_SYSCTL_GET, DN_SYSCTL_SET, - +#ifdef NEW_AQM + /* subtypes used for setting/getting extra parameters. + * these subtypes used with IP_DUMMYNET3 command (get) + * and DN_TEXT (set). */ + DN_AQM_PARAMS, /* AQM extra params */ + DN_SCH_PARAMS, /* scheduler extra params */ +#endif DN_LAST, }; @@ -105,6 +111,9 @@ enum { /* user flags */ DN_IS_RED = 0x0020, DN_IS_GENTLE_RED= 0x0040, DN_IS_ECN = 0x0080, + #ifdef NEW_AQM + DN_IS_AQM = 0x0100, /* AQMs: e.g Codel & PIE */ + #endif DN_PIPE_CMD = 0x1000, /* pipe config... */ }; @@ -210,7 +219,19 @@ struct dn_profile { int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ }; - +#ifdef NEW_AQM +/* Extra parameters for AQM and scheduler. + * This struct is used to pass and retrieve parameters (configurations) + * to/from AQM and Scheduler. + */ +struct dn_extra_parms { + struct dn_id oid; + char name[16]; + uint32_t nr; +#define DN_MAX_EXTRA_PARM 10 + int64_t par[DN_MAX_EXTRA_PARM]; +}; +#endif /* * Overall structure of dummynet Copied and modified: stable/10/sys/netpfil/ipfw/dn_aqm.h (from r300779, head/sys/netpfil/ipfw/dn_aqm.h) ============================================================================== --- head/sys/netpfil/ipfw/dn_aqm.h Thu May 26 21:40:13 2016 (r300779, copy source) +++ stable/10/sys/netpfil/ipfw/dn_aqm.h Fri Jun 10 00:00:25 2016 (r301772) @@ -28,7 +28,7 @@ */ /* - * API for writting an Active Queue Management algorithm for Dummynet + * API for writing an Active Queue Management algorithm for Dummynet * * $FreeBSD$ */ @@ -52,9 +52,9 @@ typedef int32_t aqm_stime_t; #define DN_AQM_MTAG_TS 55345 /* Macro for variable bounding */ -#define BOUND_VAR(x,l,h) (x < l? l : x > h? h : x) +#define BOUND_VAR(x,l,h) ((x) > (h)? (h) : ((x) > (l)? (x) : (l))) -/* sysctl variable to count number of droped packets */ +/* sysctl variable to count number of dropped packets */ extern unsigned long io_pkt_drop; /* Copied: stable/10/sys/netpfil/ipfw/dn_aqm_codel.c (from r300779, head/sys/netpfil/ipfw/dn_aqm_codel.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netpfil/ipfw/dn_aqm_codel.c Fri Jun 10 00:00:25 2016 (r301772, copy of r300779, head/sys/netpfil/ipfw/dn_aqm_codel.c) @@ -0,0 +1,444 @@ +/* + * Codel - The Controlled-Delay Active Queue Management algorithm. + * + * $FreeBSD$ + * + * Copyright (C) 2016 Centre for Advanced Internet Architectures, + * Swinburne University of Technology, Melbourne, Australia. + * Portions of this code were made possible in part by a gift from + * The Comcast Innovation Fund. + * Implemented by Rasool Al-Saadi + * + * 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 +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ +#include +#include + +#include +#include /* ip_len, ip_off */ +#include /* ip_output(), IP_FORWARDING */ +#include +#include +#include /* various ether_* routines */ +#include /* for ip6_input, ip6_output prototypes */ +#include +#include + +#ifdef NEW_AQM +#include +#include +#include +#include +#include + +#define DN_AQM_CODEL 1 + +static struct dn_aqm codel_desc; + +/* default codel parameters */ +struct dn_aqm_codel_parms codel_sysctl = {5000 * AQM_TIME_1US, + 100000 * AQM_TIME_1US, 0}; + +static int +codel_sysctl_interval_handler(SYSCTL_HANDLER_ARGS) +{ + int error; + long value; + + value = codel_sysctl.interval; + value /= AQM_TIME_1US; + error = sysctl_handle_long(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (value < 1 || value > 100 * AQM_TIME_1S) + return (EINVAL); + codel_sysctl.interval = value * AQM_TIME_1US ; + return (0); +} + +static int +codel_sysctl_target_handler(SYSCTL_HANDLER_ARGS) +{ + int error; + long value; + + value = codel_sysctl.target; + value /= AQM_TIME_1US; + error = sysctl_handle_long(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + D("%ld", value); + if (value < 1 || value > 5 * AQM_TIME_1S) + return (EINVAL); + codel_sysctl.target = value * AQM_TIME_1US ; + return (0); +} + +/* defining Codel sysctl variables */ +SYSBEGIN(f4) + +SYSCTL_DECL(_net_inet); +SYSCTL_DECL(_net_inet_ip); +SYSCTL_DECL(_net_inet_ip_dummynet); +static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, + codel, CTLFLAG_RW, 0, "CODEL"); + +#ifdef SYSCTL_NODE +SYSCTL_PROC(_net_inet_ip_dummynet_codel, OID_AUTO, target, + CTLTYPE_LONG | CTLFLAG_RW, NULL, 0,codel_sysctl_target_handler, "L", + "CoDel target in microsecond"); + +SYSCTL_PROC(_net_inet_ip_dummynet_codel, OID_AUTO, interval, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 10 00:00:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06BBEB709B3; Fri, 10 Jun 2016 00:00:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id ECDC81332; Fri, 10 Jun 2016 00:00:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 908911854; Fri, 10 Jun 2016 00:00:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 10 Jun 2016 00:00:55 +0000 From: Glen Barber To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301741 - head/sys/cam Message-ID: <20160610000055.GT2323@FreeBSD.org> References: <201606091605.u59G5u1O037551@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="A+KtNVtgI4x4SWvL" Content-Disposition: inline In-Reply-To: <201606091605.u59G5u1O037551@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 00:00:59 -0000 --A+KtNVtgI4x4SWvL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 09, 2016 at 04:05:56PM +0000, Warner Losh wrote: > Author: imp > Date: Thu Jun 9 16:05:56 2016 > New Revision: 301741 > URL: https://svnweb.freebsd.org/changeset/base/301741 >=20 > Log: > Add place holder for SDIO CAM stuff for CCB XPT type. > =20 One of these commits breaks sparc64. In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:44:31: error: cam/nvme/nvme_all.h: No such file or directory In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:794: error: field 'cmd' has incomplete type /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:795: error: field 'cpl' has incomplete type Glen --A+KtNVtgI4x4SWvL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXWgMzAAoJEAMUWKVHj+KT0JIP/0M82h9H9tJKjiL6026BP037 6G+Hdbyn8Rco0HQLNl29WwUVOXac476b6ZsMpM+D+fLwwAlTjDp+bo+QCtjnPTS5 snkf0IfhJmZysSi0KBNXe0G2YYNlCociaYD0LTKbsKVlivop9OSMLJg4ooA1NplM fUYFzXPmz1/KXqNKaIZ/IGJxxihAGK5j4kpcf8ZBBryMY2FoyGvDO8C7TRBpsR/U PiAqJ2BbEtjYnCJmBpMHItIDif2Taeb7m3tEb0OaiyN6cXPnKqRAPVAWr0ZCVz43 lkkfwowUVYfhSSwU0NbFTW1FrUzyirFfB4ZmZDiE1JHz1WuVJM9kuT3hbwjMDPnW ypdVRUzsLuEmOPFuRiB6ne5yeJ8SOmqzI1lNZ5DMv4iSVW7AvpIG5MphLj5Y9lAu q69Me4jNjzZdUaXHMbov5a1n+0FeCaIW6YO9pgOPL4CZ66lxtrPfeUiu/uG0iYZ2 i7s9ABwthdpqL5XtP9jKf+ocS84PemJf+1gUQOjvf9wRy9P4RZsvf++2LVHPnlfr 1jJMYOJl8r4TLspK7uSNcKBwSiJBdDHHbXU1i6mz+6hw3OR/lVAC1c86bt2eH/Sc kK/RhkphbQFASL97vOKqRt8Vmdbq2TH/dKRyHvmO0UGAhA7n77+Ta1xqyZkuiNCb jJrTlgflJ/LHcpMxIbCh =Lh2m -----END PGP SIGNATURE----- --A+KtNVtgI4x4SWvL-- From owner-svn-src-all@freebsd.org Fri Jun 10 00:07:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F4DAB70D13; Fri, 10 Jun 2016 00:07:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41D51A99; Fri, 10 Jun 2016 00:06:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A06xIg018516; Fri, 10 Jun 2016 00:06:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A06xhC018515; Fri, 10 Jun 2016 00:06:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606100006.u5A06xhC018515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Jun 2016 00:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301773 - head/contrib/ipfilter/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 00:07:00 -0000 Author: cy Date: Fri Jun 10 00:06:58 2016 New Revision: 301773 URL: https://svnweb.freebsd.org/changeset/base/301773 Log: Update the man ipf.8 man page to accurately reflect that the -6 option is a noop and only here for backward compatibility. MFC after: 1 week Modified: head/contrib/ipfilter/man/ipf.8 Modified: head/contrib/ipfilter/man/ipf.8 ============================================================================== --- head/contrib/ipfilter/man/ipf.8 Fri Jun 10 00:00:25 2016 (r301772) +++ head/contrib/ipfilter/man/ipf.8 Fri Jun 10 00:06:58 2016 (r301773) @@ -35,7 +35,11 @@ which they appear when given to \fBipf\f .SH OPTIONS .TP .B \-6 -This option is required to parse IPv6 rules and to have them loaded. +This option was required in previous releases of IP FIlter to parse IPv6 +rules and to have them loaded. As of IP FIlter 5.0.0 all rules are stored +in a single table loaded from a single file. This option is a noop. It +will produce the message "IPv6 rules are no longer seperate." It is +included for backward compatibility. .TP .B \-A Set the list to make changes to the active list (default). From owner-svn-src-all@freebsd.org Fri Jun 10 00:08:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E787B70DB5; Fri, 10 Jun 2016 00:08:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3DB1C54; Fri, 10 Jun 2016 00:08:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A08PuU018618; Fri, 10 Jun 2016 00:08:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A08PVM018617; Fri, 10 Jun 2016 00:08:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606100008.u5A08PVM018617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 10 Jun 2016 00:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r301774 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 00:08:26 -0000 Author: gjb Date: Fri Jun 10 00:08:25 2016 New Revision: 301774 URL: https://svnweb.freebsd.org/changeset/base/301774 Log: Require explicit re@ approval for commits to -CURRENT, marking the official code freeze for 11.0-RELEASE. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Fri Jun 10 00:06:58 2016 (r301773) +++ svnadmin/conf/approvers Fri Jun 10 00:08:25 2016 (r301774) @@ -16,7 +16,7 @@ # # $FreeBSD$ # -#^head/ re +^head/ re #^stable/10/ re ^release/ re ^releng/10.[0-3]/ (security-officer|so) From owner-svn-src-all@freebsd.org Fri Jun 10 01:01:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD9FDADC6AA; Fri, 10 Jun 2016 01:01:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8188C128B; Fri, 10 Jun 2016 01:01:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id z123so49315543itg.0; Thu, 09 Jun 2016 18:01:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Hnen7uX2UqLX2+RRjSYxY+HMtp7EY9Kjyw6glSI8Q2g=; b=a3WWpdP+nv6dDsRn1U6Q0qGYLk8IoRSmWYJhVfDmHuqWLPRqRSk5g5Hl5y+nv4OhVQ kWHbZlQcF853eO2qJQYajUIQpNPKFSD/WRyIXf51fB8zI7NXJfkuZeg8DAfzN26vko2z NiXca1m9NbFVsVejdYZ8C1f84Xg06w4sUu3xe1/Yb06fG6EFgUDAiX2xeSsMHD42mzI2 Pok8miP6joORqsjwA1tdrZkwKIl6wUZZYzJg8YgWV9jtdL/01nTZjQ8IMmRLaojQn30D nsiirebk5w/gjL+484nP/uLriCGQvK5zLK0DDdZQaKY85jEUJyziCCUxmSI+uwb6KgBE l9Iw== X-Gm-Message-State: ALyK8tLL/1CtVr0HAXmRqRWBJdRm06Xc8JTzngC1hcYmQVVCLOSIaqonzyZW7QWgCIBRiA== X-Received: by 10.36.62.133 with SMTP id s127mr22313686its.98.1465518934701; Thu, 09 Jun 2016 17:35:34 -0700 (PDT) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id s1sm4384985ioe.31.2016.06.09.17.35.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jun 2016 17:35:34 -0700 (PDT) Received: by mail-it0-f42.google.com with SMTP id a5so51960803ita.1; Thu, 09 Jun 2016 17:35:34 -0700 (PDT) X-Received: by 10.36.2.2 with SMTP id 2mr22640574itu.34.1465518934309; Thu, 09 Jun 2016 17:35:34 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.205.70 with HTTP; Thu, 9 Jun 2016 17:35:33 -0700 (PDT) In-Reply-To: <20160610000055.GT2323@FreeBSD.org> References: <201606091605.u59G5u1O037551@repo.freebsd.org> <20160610000055.GT2323@FreeBSD.org> From: Conrad Meyer Date: Thu, 9 Jun 2016 17:35:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r301741 - head/sys/cam To: Glen Barber Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 01:01:51 -0000 i386 as well (although we are replying to the wrong commit, I think r301771 is what broke it): In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: /usr/obj/usr/src/tmp/usr/include/cam/cam_ccb.h:44:10: fatal error: 'cam/nvme/nvme_all.h' file not found #include ^ Best, Conrad On Thu, Jun 9, 2016 at 5:00 PM, Glen Barber wrote: > On Thu, Jun 09, 2016 at 04:05:56PM +0000, Warner Losh wrote: >> Author: imp >> Date: Thu Jun 9 16:05:56 2016 >> New Revision: 301741 >> URL: https://svnweb.freebsd.org/changeset/base/301741 >> >> Log: >> Add place holder for SDIO CAM stuff for CCB XPT type. >> > > One of these commits breaks sparc64. > > In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: > /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:44:31: > error: cam/nvme/nvme_all.h: No such file or directory > In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: > /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:794: > error: field 'cmd' has incomplete type > /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:795: > error: field 'cpl' has incomplete type > > Glen > From owner-svn-src-all@freebsd.org Fri Jun 10 01:10:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A36C5ADCA04; Fri, 10 Jun 2016 01:10:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74F9716BA; Fri, 10 Jun 2016 01:10:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A1AmX5041307; Fri, 10 Jun 2016 01:10:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A1AmYr041306; Fri, 10 Jun 2016 01:10:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606100110.u5A1AmYr041306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Jun 2016 01:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301775 - head/contrib/ipfilter/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 01:10:49 -0000 Author: cy Date: Fri Jun 10 01:10:48 2016 New Revision: 301775 URL: https://svnweb.freebsd.org/changeset/base/301775 Log: Clarify the wording to be more accurate. Approved by: re@ (gjb) MFC after: 1 week X-MFC with: r301773 Modified: head/contrib/ipfilter/man/ipf.8 Modified: head/contrib/ipfilter/man/ipf.8 ============================================================================== --- head/contrib/ipfilter/man/ipf.8 Fri Jun 10 00:08:25 2016 (r301774) +++ head/contrib/ipfilter/man/ipf.8 Fri Jun 10 01:10:48 2016 (r301775) @@ -35,11 +35,10 @@ which they appear when given to \fBipf\f .SH OPTIONS .TP .B \-6 -This option was required in previous releases of IP FIlter to parse IPv6 -rules and to have them loaded. As of IP FIlter 5.0.0 all rules are stored -in a single table loaded from a single file. This option is a noop. It -will produce the message "IPv6 rules are no longer seperate." It is -included for backward compatibility. +IPv4 and IPv6 rules are stored in a single table and can be read from a +single file. This option is no longer required to load IPv6 rules. This +option is ignored when specified with the -F option and the -F option +will flush IPv4 rules even if this option is specified. .TP .B \-A Set the list to make changes to the active list (default). From owner-svn-src-all@freebsd.org Fri Jun 10 03:08:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABBF3B71051; Fri, 10 Jun 2016 03:08:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B60631070; Fri, 10 Jun 2016 03:08:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5A38Xuv034353 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 10 Jun 2016 06:08:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5A38Xuv034353 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5A38WUM034352; Fri, 10 Jun 2016 06:08:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 10 Jun 2016 06:08:32 +0300 From: Konstantin Belousov To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301751 - head/sys/kern Message-ID: <20160610030832.GC38613@kib.kiev.ua> References: <201606091827.u59IRfD1090422@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606091827.u59IRfD1090422@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 03:08:44 -0000 On Thu, Jun 09, 2016 at 06:27:41PM +0000, Conrad E. Meyer wrote: > Author: cem > Date: Thu Jun 9 18:27:41 2016 > New Revision: 301751 > URL: https://svnweb.freebsd.org/changeset/base/301751 > > Log: > Add DDB command "kldstat" > > It prints much the same information as kldstat(8) without any arguments. > > Suggested by: jhibbits > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/kern/kern_linker.c > > Modified: head/sys/kern/kern_linker.c > ============================================================================== > --- head/sys/kern/kern_linker.c Thu Jun 9 18:24:51 2016 (r301750) > +++ head/sys/kern/kern_linker.c Thu Jun 9 18:27:41 2016 (r301751) > @@ -54,6 +54,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifdef DDB > +#include > +#endif > + > #include > > #include > @@ -1256,6 +1260,23 @@ kern_kldstat(struct thread *td, int file > return (0); > } > > +#ifdef DDB > +DB_COMMAND(kldstat, db_kldstat) This would arguably more visible if done as the 'show klds' or similar subcommand. The first place where people accustomed to ddb look when want to see some kernel structures dumped, is 'show'. BTW, a useful tradition is to have 'show kld ' and 'show klds' commands. If not clear from the structure, the first command would print the information about single linker file at the given address (whatever it is), and second does what your current 'kldstat' offer. > +{ > + linker_file_t lf; > + > +#define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2)) > + db_printf("Id Refs Address%*c Size Name\n", POINTER_WIDTH - 7, ' '); > +#undef POINTER_WIDTH > + TAILQ_FOREACH(lf, &linker_files, link) { > + if (db_pager_quit) > + return; > + db_printf("%2d %4d %p %-8zx %s\n", lf->id, lf->refs, > + lf->address, lf->size, lf->filename); > + } > +} > +#endif /* DDB */ > + > int > sys_kldfirstmod(struct thread *td, struct kldfirstmod_args *uap) > { From owner-svn-src-all@freebsd.org Fri Jun 10 04:04:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54CA5B71943; Fri, 10 Jun 2016 04:04:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 261C717DE; Fri, 10 Jun 2016 04:04:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A44tmw007434; Fri, 10 Jun 2016 04:04:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A44tuv007433; Fri, 10 Jun 2016 04:04:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606100404.u5A44tuv007433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Jun 2016 04:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301776 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 04:04:56 -0000 Author: kib Date: Fri Jun 10 04:04:55 2016 New Revision: 301776 URL: https://svnweb.freebsd.org/changeset/base/301776 Log: MFC r301278 Reduce number of iterations used for calibrating ICR read loop. MFC r301279: Record correct commit message for r301278. Modified: stable/10/sys/x86/x86/local_apic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/x86/local_apic.c ============================================================================== --- stable/10/sys/x86/x86/local_apic.c Fri Jun 10 01:10:48 2016 (r301775) +++ stable/10/sys/x86/x86/local_apic.c Fri Jun 10 04:04:55 2016 (r301776) @@ -284,7 +284,7 @@ lapic_init(vm_paddr_t addr) } #ifdef SMP -#define LOOPS 1000000 +#define LOOPS 100000 /* * Calibrate the busy loop waiting for IPI ack in xAPIC mode. * lapic_ipi_wait_mult contains the number of iterations which @@ -440,7 +440,7 @@ lapic_setup(int boot) /* Program the CMCI LVT entry if present. */ if (maxlvt >= APIC_LVT_CMCI) lapic->lvt_cmci = lvt_mode(la, APIC_LVT_CMCI, lapic->lvt_cmci); - + intr_restore(saveintr); } @@ -1363,7 +1363,7 @@ static void apic_setup_local(void *dummy __unused) { int retval; - + if (best_enum == NULL) return; From owner-svn-src-all@freebsd.org Fri Jun 10 04:39:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 847D6B71F28; Fri, 10 Jun 2016 04:39:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DD488147E; Fri, 10 Jun 2016 04:39:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r301741 - head/sys/cam To: cem@freebsd.org, Glen Barber References: <201606091605.u59G5u1O037551@repo.freebsd.org> <20160610000055.GT2323@FreeBSD.org> Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: <09e5d94f-e3ec-723b-cb5a-0d582bf1d804@FreeBSD.org> Date: Fri, 10 Jun 2016 00:39:56 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7OxVlDKhwvcFtQvMwowGgT09nX90nQ9mq" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 04:39:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7OxVlDKhwvcFtQvMwowGgT09nX90nQ9mq Content-Type: multipart/mixed; boundary="pchDtS7Hw5FkwG4dSOVNCxeG5cufVVxqw" From: Jung-uk Kim To: cem@freebsd.org, Glen Barber Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <09e5d94f-e3ec-723b-cb5a-0d582bf1d804@FreeBSD.org> Subject: Re: svn commit: r301741 - head/sys/cam References: <201606091605.u59G5u1O037551@repo.freebsd.org> <20160610000055.GT2323@FreeBSD.org> In-Reply-To: --pchDtS7Hw5FkwG4dSOVNCxeG5cufVVxqw Content-Type: multipart/mixed; boundary="------------4776D4012D68AC65D9B3F71F" This is a multi-part message in MIME format. --------------4776D4012D68AC65D9B3F71F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/ 9/16 08:35 PM, Conrad Meyer wrote: > i386 as well (although we are replying to the wrong commit, I think > r301771 is what broke it): >=20 > In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: > /usr/obj/usr/src/tmp/usr/include/cam/cam_ccb.h:44:10: fatal error: > 'cam/nvme/nvme_all.h' file not found > #include The attached patch fixed the build problem for me. FYI... Jung-uk Kim > Best, > Conrad >=20 > On Thu, Jun 9, 2016 at 5:00 PM, Glen Barber wrote: >> On Thu, Jun 09, 2016 at 04:05:56PM +0000, Warner Losh wrote: >>> Author: imp >>> Date: Thu Jun 9 16:05:56 2016 >>> New Revision: 301741 >>> URL: https://svnweb.freebsd.org/changeset/base/301741 >>> >>> Log: >>> Add place holder for SDIO CAM stuff for CCB XPT type. >>> >> >> One of these commits breaks sparc64. >> >> In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: >> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:44:31: >> error: cam/nvme/nvme_all.h: No such file or directory >> In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: >> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:794: >> error: field 'cmd' has incomplete type >> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:795: >> error: field 'cpl' has incomplete type >> >> Glen --------------4776D4012D68AC65D9B3F71F Content-Type: text/x-patch; name="nvme.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="nvme.diff" Index: etc/mtree/BSD.include.dist =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- etc/mtree/BSD.include.dist (revision 301775) +++ etc/mtree/BSD.include.dist (working copy) @@ -90,6 +90,8 @@ cam ata .. + nvme + .. scsi .. .. Index: include/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- include/Makefile (revision 301775) +++ include/Makefile (working copy) @@ -42,7 +42,7 @@ LHDRS=3D aio.h errno.h fcntl.h linker_set.h poll.h s LDIRS=3D bsm cam geom net net80211 netgraph netinet netinet6 \ netipsec netnatm netsmb nfs nfsclient nfsserver sys vm =20 -LSUBDIRS=3D cam/ata cam/scsi \ +LSUBDIRS=3D cam/ata cam/nvme cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ dev/hwpmc \ dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/nvme \ --------------4776D4012D68AC65D9B3F71F-- --pchDtS7Hw5FkwG4dSOVNCxeG5cufVVxqw-- --7OxVlDKhwvcFtQvMwowGgT09nX90nQ9mq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXWkScAAoJEHyflib82/FGAncH/3u1i2FGutI1fbQY9Fs/3LF4 bblzhYuQIpY1vJ99Hp4ld8kqcqWuRUdwhriSYR1rrXBPtC5WXlKJ7E9BHB7A6HCV IAAJQ1fSNhEeetH5+OocYrbLecQerSGKVh395QHiguSksioyZ8WSiZC8mYdZsxIe v3hanoTscOFov8JUjW1e93rG5T6kIJ5teeRIHFZgq0Lk+FAgGNfPt1qwBcycVgGw hZ2KnRZGH3An0fou2TpY78s3FZ2CKN9LSPADJhyD2MYdd4hS/QX7QXAg7+5rTKp2 etJaBGsY/gc0Y37pHbIpKtLBXBjWoMhLc+Ap04YbxZVwhZWnLiYlnuw4IjzjHmI= =8Pkb -----END PGP SIGNATURE----- --7OxVlDKhwvcFtQvMwowGgT09nX90nQ9mq-- From owner-svn-src-all@freebsd.org Fri Jun 10 04:55:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49826B701DF; Fri, 10 Jun 2016 04:55:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1FD971C7E; Fri, 10 Jun 2016 04:55:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 345081AC1; Fri, 10 Jun 2016 04:55:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 10 Jun 2016 04:55:32 +0000 From: Glen Barber To: Jung-uk Kim Cc: cem@freebsd.org, Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301741 - head/sys/cam Message-ID: <20160610045532.GZ2323@FreeBSD.org> References: <201606091605.u59G5u1O037551@repo.freebsd.org> <20160610000055.GT2323@FreeBSD.org> <09e5d94f-e3ec-723b-cb5a-0d582bf1d804@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LCbsoPZWBRMqE7TI" Content-Disposition: inline In-Reply-To: <09e5d94f-e3ec-723b-cb5a-0d582bf1d804@FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 04:55:50 -0000 --LCbsoPZWBRMqE7TI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 10, 2016 at 12:39:56AM -0400, Jung-uk Kim wrote: > On 06/ 9/16 08:35 PM, Conrad Meyer wrote: > > i386 as well (although we are replying to the wrong commit, I think > > r301771 is what broke it): > >=20 > > In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: > > /usr/obj/usr/src/tmp/usr/include/cam/cam_ccb.h:44:10: fatal error: > > 'cam/nvme/nvme_all.h' file not found > > #include >=20 > The attached patch fixed the build problem for me. >=20 > FYI... Please commit. Glen >=20 > Jung-uk Kim >=20 > > Best, > > Conrad > >=20 > > On Thu, Jun 9, 2016 at 5:00 PM, Glen Barber wrote: > >> On Thu, Jun 09, 2016 at 04:05:56PM +0000, Warner Losh wrote: > >>> Author: imp > >>> Date: Thu Jun 9 16:05:56 2016 > >>> New Revision: 301741 > >>> URL: https://svnweb.freebsd.org/changeset/base/301741 > >>> > >>> Log: > >>> Add place holder for SDIO CAM stuff for CCB XPT type. > >>> > >> > >> One of these commits breaks sparc64. > >> > >> In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: > >> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:44:31: > >> error: cam/nvme/nvme_all.h: No such file or directory > >> In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: > >> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:794: > >> error: field 'cmd' has incomplete type > >> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:795: > >> error: field 'cpl' has incomplete type > >> > >> Glen >=20 > Index: etc/mtree/BSD.include.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- etc/mtree/BSD.include.dist (revision 301775) > +++ etc/mtree/BSD.include.dist (working copy) > @@ -90,6 +90,8 @@ > cam > ata > .. > + nvme > + .. > scsi > .. > .. > Index: include/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- include/Makefile (revision 301775) > +++ include/Makefile (working copy) > @@ -42,7 +42,7 @@ LHDRS=3D aio.h errno.h fcntl.h linker_set.h poll.h s > LDIRS=3D bsm cam geom net net80211 netgraph netinet netinet6 \ > netipsec netnatm netsmb nfs nfsclient nfsserver sys vm > =20 > -LSUBDIRS=3D cam/ata cam/scsi \ > +LSUBDIRS=3D cam/ata cam/nvme cam/scsi \ > dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ > dev/hwpmc \ > dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/nvme \ --LCbsoPZWBRMqE7TI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXWkhEAAoJEAMUWKVHj+KT3vwP/2J+uUmQXLmy+ODzG8fZX4nW kr92N49zfGCi/7eIjmzAzhRLhusfAZ3OFjaBVmwChwSD89Kx3iJhyoRSNkYTAQB6 T7oFwMWMn6b/82TsxrEAaA672VXOAg8TRSGUmKaEpLgXRDboScbBx3853cOfi5ys XnkiPOuJGUbpi2WewU+D3N/YsCipS5eRLisqxZbjKxMeozxiCg3/1iVhv1dvRnkA v+TrduVJ/Lc7JR+96TobYkzDD0A6UHblIHvb3mAJCX7zo8TXnG3yj/rS3sz6dJdU bD8fXhG0zH/qyookRa+rcaySdd0P621edWeAqKZ5IMD1xKQaL/8ttn4WFAoPE7VU xsYMugrKdaGYtHfyBcJte4qVzl944b9ZAJhzf7iUhZiv4cRejhd/W9twdSvTZzKR UyZJ3et5tEZbL/7Sc/UcQrBUWxbPVII6iHLPY4Eq6uTar9tDt4Z70oGnDWVwtH4C Uner1HYGVD14eLovvl89x9jtaqoOTXBoZnYpYETN5fqwtQ8wwm3havYaE54D09nT g/WK8U1qf5QSdEwIHkYLs3UBNLULNRnQu0FXaGpzXbMnXwXe6WCM4W7og78i5Ety P4U4+cWepANvnczG80wsFNGe2wBtOGzuHV626J00stPZ6cW7fJJDuYvmFbjJ1A/e EPIoHUNzQZFE+UJps/C8 =WLKt -----END PGP SIGNATURE----- --LCbsoPZWBRMqE7TI-- From owner-svn-src-all@freebsd.org Fri Jun 10 04:56:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFA5B70243 for ; Fri, 10 Jun 2016 04:56:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC02F1DE6 for ; Fri, 10 Jun 2016 04:56:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id 5so56533953ioy.1 for ; Thu, 09 Jun 2016 21:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=0hDOKiyyhuU2toZ+TpOPRrVfuPuY34i8bl+rizH/Spw=; b=RJkvUlz1wkljFlOx2zr6KnU5zkEbG80uBEkyjMqV00hmPkVTHANEXxKj+6DzUJt08U eynbaWuwNkMgOMdAYld0rh0uJwy+J3TSK8gvXeR7T5Yg3rdVGqkk7AepihOXn2cjz2SU hXnFwDcG1tlaZz2wtdJxK6JvH9SUcOY1iD/s+MMVXalSo/lGi6xQkfGgotYgO9ntzy7U ZNG0jvwQIXZWuduMg2hacGYWPpVrzR3WiVU9md7Zu9Qt8J2HmlftAs1qmI53pE0BBG8o 3Z+1Ig0On6iZYfC+8saRpr+mwh3bEemqxo3+mEBir8eC0fIXLIY7KITCxFLrMElYU5Ho 1SPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=0hDOKiyyhuU2toZ+TpOPRrVfuPuY34i8bl+rizH/Spw=; b=WzzpM1L8NX31G9BgJUYCoZsORg0MzU9pco9/OXUGsT4bHaC1u+bMwuc19TDPn/LCsu mQiQav+7/q697bdoaHHNMIXWqcIfevvbSEjJstUr1V3IFxPQmq7G/PtHjas9tKv+on4v 0Ywg3hK5bokF2dLzhFX4rPAy9ccC4nUHH07Tp2e48A+ZrRHdvdsuQFLrpaKwDQR7SMX/ zbJwjhod5zBDoy6LtKC3D5WMM3zTkMnHuQl3Mx68FmlAi4ioCLMLRLIsPK/8R1WuliJz GcFNtkAhMn/Mdbbzwki05O0SeBUQ1VJI7cscHo6YxltXyQNW5GWcoO6seX4qT4lfPVpa ANKw== X-Gm-Message-State: ALyK8tIViTB04vLjxXPZx8YCWxUqO+VMOMZ9zi1HLjfkcTysj1H7q8QiWRL/7EMnhiPiGX8Ab5VzyAJwZlgvOA== MIME-Version: 1.0 X-Received: by 10.107.192.195 with SMTP id q186mr859159iof.197.1465534593201; Thu, 09 Jun 2016 21:56:33 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.75.3 with HTTP; Thu, 9 Jun 2016 21:56:33 -0700 (PDT) X-Originating-IP: [69.53.246.16] In-Reply-To: <09e5d94f-e3ec-723b-cb5a-0d582bf1d804@FreeBSD.org> References: <201606091605.u59G5u1O037551@repo.freebsd.org> <20160610000055.GT2323@FreeBSD.org> <09e5d94f-e3ec-723b-cb5a-0d582bf1d804@FreeBSD.org> Date: Fri, 10 Jun 2016 00:56:33 -0400 X-Google-Sender-Auth: MAkY8wtx-I2YA08XPp85mXTxflA Message-ID: Subject: Re: svn commit: r301741 - head/sys/cam From: Warner Losh To: Jung-uk Kim Cc: "Conrad E. Meyer" , Glen Barber , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 04:56:34 -0000 I'm about to commit a real fix. Warner On Fri, Jun 10, 2016 at 12:39 AM, Jung-uk Kim wrote: > On 06/ 9/16 08:35 PM, Conrad Meyer wrote: >> i386 as well (although we are replying to the wrong commit, I think >> r301771 is what broke it): >> >> In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: >> /usr/obj/usr/src/tmp/usr/include/cam/cam_ccb.h:44:10: fatal error: >> 'cam/nvme/nvme_all.h' file not found >> #include > > The attached patch fixed the build problem for me. > > FYI... > > Jung-uk Kim > >> Best, >> Conrad >> >> On Thu, Jun 9, 2016 at 5:00 PM, Glen Barber wrote: >>> On Thu, Jun 09, 2016 at 04:05:56PM +0000, Warner Losh wrote: >>>> Author: imp >>>> Date: Thu Jun 9 16:05:56 2016 >>>> New Revision: 301741 >>>> URL: https://svnweb.freebsd.org/changeset/base/301741 >>>> >>>> Log: >>>> Add place holder for SDIO CAM stuff for CCB XPT type. >>>> >>> >>> One of these commits breaks sparc64. >>> >>> In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: >>> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:44:31: >>> error: cam/nvme/nvme_all.h: No such file or directory >>> In file included from /usr/src/sbin/camcontrol/camcontrol.c:56: >>> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:794: >>> error: field 'cmd' has incomplete type >>> /usr/obj/sparc64.sparc64/usr/src/tmp/usr/include/cam/cam_ccb.h:795: >>> error: field 'cpl' has incomplete type >>> >>> Glen > From owner-svn-src-all@freebsd.org Fri Jun 10 05:21:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A914CB70682; Fri, 10 Jun 2016 05:21:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B23C1A5D; Fri, 10 Jun 2016 05:21:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A5LqHE035073; Fri, 10 Jun 2016 05:21:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A5Lqa6035072; Fri, 10 Jun 2016 05:21:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606100521.u5A5Lqa6035072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 10 Jun 2016 05:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301777 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 05:21:53 -0000 Author: pfg Date: Fri Jun 10 05:21:52 2016 New Revision: 301777 URL: https://svnweb.freebsd.org/changeset/base/301777 Log: Fix regression from r301461. The fix to the __collate_range_cmp() ABI breakage missed some replacements in libc's vfscanf(). Replace them with __wcollate_range_cmp() which does what is expected. This was breaking applications like xterm and pidgin when using wide characters. Reported by: Vitalij Satanivskij Approved by: re Modified: head/lib/libc/stdio/vfscanf.c Modified: head/lib/libc/stdio/vfscanf.c ============================================================================== --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016 (r301776) +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016 (r301777) @@ -873,7 +873,7 @@ doswitch: n = *fmt; if (n == ']' || (table->__collate_load_error ? n < c : - __collate_range_cmp (table, n, c) < 0 + __wcollate_range_cmp(table, n, c) < 0 ) ) { c = '-'; @@ -887,8 +887,8 @@ doswitch: } while (c < n); } else { for (i = 0; i < 256; i ++) - if ( __collate_range_cmp (table, c, i) < 0 - && __collate_range_cmp (table, i, n) <= 0 + if (__wcollate_range_cmp(table, c, i) < 0 && + __wcollate_range_cmp(table, i, n) <= 0 ) tab[i] = v; } From owner-svn-src-all@freebsd.org Fri Jun 10 06:04:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5126EB70EF7; Fri, 10 Jun 2016 06:04:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AC9F1DBE; Fri, 10 Jun 2016 06:04:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A64scK051369; Fri, 10 Jun 2016 06:04:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A64rQU051360; Fri, 10 Jun 2016 06:04:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201606100604.u5A64rQU051360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Jun 2016 06:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301778 - in head: etc/mtree include sys/cam sys/cam/nvme sys/conf 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-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 06:04:55 -0000 Author: imp Date: Fri Jun 10 06:04:53 2016 New Revision: 301778 URL: https://svnweb.freebsd.org/changeset/base/301778 Log: Commit the bits of nda that were missed. This should fix the build. Approved by: re@ Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/cam/cam_ccb.h head/sys/cam/nvme/nvme_xpt.c head/sys/conf/files head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ns_cmd.c head/sys/dev/nvme/nvme_private.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Fri Jun 10 05:21:52 2016 (r301777) +++ head/etc/mtree/BSD.include.dist Fri Jun 10 06:04:53 2016 (r301778) @@ -90,6 +90,8 @@ cam ata .. + nvme + .. scsi .. .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Fri Jun 10 05:21:52 2016 (r301777) +++ head/include/Makefile Fri Jun 10 06:04:53 2016 (r301778) @@ -42,7 +42,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set. LDIRS= bsm cam geom net net80211 netgraph netinet netinet6 \ netipsec netnatm netsmb nfs nfsclient nfsserver sys vm -LSUBDIRS= cam/ata cam/scsi \ +LSUBDIRS= cam/ata cam/nvme cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ dev/hwpmc \ dev/ic dev/iicbus dev/io dev/lmc dev/mfi dev/nvme \ Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri Jun 10 05:21:52 2016 (r301777) +++ head/sys/cam/cam_ccb.h Fri Jun 10 06:04:53 2016 (r301778) @@ -359,6 +359,8 @@ struct ccb_getdev { u_int8_t serial_num[252]; u_int8_t inq_flags; u_int8_t serial_num_len; + const struct nvme_controller_data *nvme_cdata; + const struct nvme_namespace_data *nvme_data; }; /* Device Statistics CCB */ @@ -619,6 +621,11 @@ struct ccb_pathinq_settings_fc { struct ccb_pathinq_settings_sas { u_int32_t bitrate; /* Mbps */ }; + +struct ccb_pathinq_settings_nvme { + uint16_t nsid; /* Namespace ID for this path */ +}; + #define PATHINQ_SETTINGS_SIZE 128 struct ccb_pathinq { @@ -649,6 +656,7 @@ struct ccb_pathinq { struct ccb_pathinq_settings_spi spi; struct ccb_pathinq_settings_fc fc; struct ccb_pathinq_settings_sas sas; + struct ccb_pathinq_settings_nvme nvme; char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE]; } xport_specific; u_int maxio; /* Max supported I/O size, in bytes. */ @@ -975,6 +983,18 @@ struct ccb_trans_settings_sata { #define CTS_SATA_CAPS_D_APST 0x00020000 }; +struct ccb_trans_settings_nvme +{ + u_int valid; /* Which fields to honor */ +#define CTS_NVME_VALID_SPEC 0x01 +#define CTS_NVME_VALID_CAPS 0x02 + u_int spec_major; /* Major version of spec supported */ + u_int spec_minor; /* Minor verison of spec supported */ + u_int spec_tiny; /* Tiny version of spec supported */ + u_int max_xfer; /* Max transfer size (0 -> unlimited */ + u_int caps; +}; + /* Get/Set transfer rate/width/disconnection/tag queueing settings */ struct ccb_trans_settings { struct ccb_hdr ccb_h; @@ -987,6 +1007,7 @@ struct ccb_trans_settings { u_int valid; /* Which fields to honor */ struct ccb_trans_settings_ata ata; struct ccb_trans_settings_scsi scsi; + struct ccb_trans_settings_nvme nvme; } proto_specific; union { u_int valid; /* Which fields to honor */ @@ -995,6 +1016,7 @@ struct ccb_trans_settings { struct ccb_trans_settings_sas sas; struct ccb_trans_settings_pata ata; struct ccb_trans_settings_sata sata; + struct ccb_trans_settings_nvme nvme; } xport_specific; }; Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Fri Jun 10 05:21:52 2016 (r301777) +++ head/sys/cam/nvme/nvme_xpt.c Fri Jun 10 06:04:53 2016 (r301778) @@ -137,7 +137,7 @@ static cam_status nvme_probe_register(st static void nvme_probe_schedule(struct cam_periph *nvme_probe_periph); static void nvme_probe_start(struct cam_periph *periph, union ccb *start_ccb); static void nvme_probe_cleanup(struct cam_periph *periph); -static void nvme_find_quirk(struct cam_ed *device); +//static void nvme_find_quirk(struct cam_ed *device); static void nvme_scan_lun(struct cam_periph *periph, struct cam_path *path, cam_flags flags, union ccb *ccb); @@ -312,6 +312,7 @@ nvme_probe_cleanup(struct cam_periph *pe free(periph->softc, M_CAMXPT); } +#if 0 /* XXX should be used, don't delete */ static void nvme_find_quirk(struct cam_ed *device) @@ -334,6 +335,7 @@ nvme_find_quirk(struct cam_ed *device) device->maxtags = quirk->maxtags; } } +#endif static void nvme_scan_lun(struct cam_periph *periph, struct cam_path *path, Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 10 05:21:52 2016 (r301777) +++ head/sys/conf/files Fri Jun 10 06:04:53 2016 (r301778) @@ -87,7 +87,7 @@ cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus cam/ata/ata_pmp.c optional scbus cam/nvme/nvme_all.c optional scbus nvme -cam/nvme/nvme_da.c optional scbus nvme da +cam/nvme/nvme_da.c optional scbus nvme da !nvd cam/nvme/nvme_xpt.c optional scbus nvme cam/scsi/scsi_xpt.c optional scbus cam/scsi/scsi_all.c optional scbus Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Jun 10 05:21:52 2016 (r301777) +++ head/sys/dev/nvme/nvme.h Fri Jun 10 06:04:53 2016 (r301778) @@ -47,7 +47,8 @@ */ #define NVME_GLOBAL_NAMESPACE_TAG ((uint32_t)0xFFFFFFFF) -#define NVME_MAX_XFER_SIZE MAXPHYS +/* Cap nvme to 1MB transfers driver explodes with larger sizes */ +#define NVME_MAX_XFER_SIZE (MAXPHYS < (1<<20) ? MAXPHYS : (1<<20)) union cap_lo_register { uint32_t raw; @@ -903,6 +904,52 @@ uint32_t nvme_ns_get_stripesize(struct n int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, nvme_cb_fn_t cb_fn); +/* Command building helper functions -- shared with CAM */ +static inline +void nvme_ns_flush_cmd(struct nvme_command *cmd, uint16_t nsid) +{ + + cmd->opc = NVME_OPC_FLUSH; + cmd->nsid = nsid; +} + +static inline +void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint16_t nsid, + uint64_t lba, uint32_t count) +{ + cmd->opc = rwcmd; + cmd->nsid = nsid; + *(uint64_t *)&cmd->cdw10 = lba; + cmd->cdw12 = count-1; + cmd->cdw13 = 0; + cmd->cdw14 = 0; + cmd->cdw15 = 0; +} + +static inline +void nvme_ns_write_cmd(struct nvme_command *cmd, uint16_t nsid, + uint64_t lba, uint32_t count) +{ + nvme_ns_rw_cmd(cmd, NVME_OPC_WRITE, nsid, lba, count); +} + +static inline +void nvme_ns_read_cmd(struct nvme_command *cmd, uint16_t nsid, + uint64_t lba, uint32_t count) +{ + nvme_ns_rw_cmd(cmd, NVME_OPC_READ, nsid, lba, count); +} + +static inline +void nvme_ns_trim_cmd(struct nvme_command *cmd, uint16_t nsid, + uint32_t num_ranges) +{ + cmd->opc = NVME_OPC_DATASET_MANAGEMENT; + cmd->nsid = nsid; + cmd->cdw10 = num_ranges - 1; + cmd->cdw11 = NVME_DSM_ATTR_DEALLOCATE; +} + #endif /* _KERNEL */ #endif /* __NVME_H__ */ Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Fri Jun 10 05:21:52 2016 (r301777) +++ head/sys/dev/nvme/nvme_ctrlr.c Fri Jun 10 06:04:53 2016 (r301778) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_cam.h" + #include #include #include @@ -801,7 +803,7 @@ nvme_ctrlr_reset_task(void *arg, int pen atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); } -static void +void nvme_ctrlr_intx_handler(void *arg) { struct nvme_controller *ctrlr = arg; Modified: head/sys/dev/nvme/nvme_ns_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ns_cmd.c Fri Jun 10 05:21:52 2016 (r301777) +++ head/sys/dev/nvme/nvme_ns_cmd.c Fri Jun 10 06:04:53 2016 (r301778) @@ -34,20 +34,14 @@ nvme_ns_cmd_read(struct nvme_namespace * uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_command *cmd; req = nvme_allocate_request_vaddr(payload, lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg); if (req == NULL) return (ENOMEM); - cmd = &req->cmd; - cmd->opc = NVME_OPC_READ; - cmd->nsid = ns->id; - /* TODO: create a read command data structure */ - *(uint64_t *)&cmd->cdw10 = lba; - cmd->cdw12 = lba_count-1; + nvme_ns_read_cmd(&req->cmd, ns->id, lba, lba_count); nvme_ctrlr_submit_io_request(ns->ctrlr, req); @@ -59,7 +53,6 @@ nvme_ns_cmd_read_bio(struct nvme_namespa nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_command *cmd; uint64_t lba; uint64_t lba_count; @@ -67,16 +60,10 @@ nvme_ns_cmd_read_bio(struct nvme_namespa if (req == NULL) return (ENOMEM); - cmd = &req->cmd; - cmd->opc = NVME_OPC_READ; - cmd->nsid = ns->id; lba = bp->bio_offset / nvme_ns_get_sector_size(ns); lba_count = bp->bio_bcount / nvme_ns_get_sector_size(ns); - - /* TODO: create a read command data structure */ - *(uint64_t *)&cmd->cdw10 = lba; - cmd->cdw12 = lba_count-1; + nvme_ns_read_cmd(&req->cmd, ns->id, lba, lba_count); nvme_ctrlr_submit_io_request(ns->ctrlr, req); @@ -88,7 +75,6 @@ nvme_ns_cmd_write(struct nvme_namespace uint32_t lba_count, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_command *cmd; req = nvme_allocate_request_vaddr(payload, lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg); @@ -96,13 +82,7 @@ nvme_ns_cmd_write(struct nvme_namespace if (req == NULL) return (ENOMEM); - cmd = &req->cmd; - cmd->opc = NVME_OPC_WRITE; - cmd->nsid = ns->id; - - /* TODO: create a write command data structure */ - *(uint64_t *)&cmd->cdw10 = lba; - cmd->cdw12 = lba_count-1; + nvme_ns_write_cmd(&req->cmd, ns->id, lba, lba_count); nvme_ctrlr_submit_io_request(ns->ctrlr, req); @@ -114,7 +94,6 @@ nvme_ns_cmd_write_bio(struct nvme_namesp nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_command *cmd; uint64_t lba; uint64_t lba_count; @@ -122,16 +101,9 @@ nvme_ns_cmd_write_bio(struct nvme_namesp if (req == NULL) return (ENOMEM); - cmd = &req->cmd; - cmd->opc = NVME_OPC_WRITE; - cmd->nsid = ns->id; - lba = bp->bio_offset / nvme_ns_get_sector_size(ns); lba_count = bp->bio_bcount / nvme_ns_get_sector_size(ns); - - /* TODO: create a write command data structure */ - *(uint64_t *)&cmd->cdw10 = lba; - cmd->cdw12 = lba_count-1; + nvme_ns_write_cmd(&req->cmd, ns->id, lba, lba_count); nvme_ctrlr_submit_io_request(ns->ctrlr, req); @@ -168,17 +140,13 @@ int nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - struct nvme_command *cmd; req = nvme_allocate_request_null(cb_fn, cb_arg); if (req == NULL) return (ENOMEM); - cmd = &req->cmd; - cmd->opc = NVME_OPC_FLUSH; - cmd->nsid = ns->id; - + nvme_ns_flush_cmd(&req->cmd, ns->id); nvme_ctrlr_submit_io_request(ns->ctrlr, req); return (0); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Jun 10 05:21:52 2016 (r301777) +++ head/sys/dev/nvme/nvme_private.h Fri Jun 10 06:04:53 2016 (r301778) @@ -245,6 +245,10 @@ struct nvme_controller { struct mtx lock; + struct cam_sim *sim; + struct cam_path *path; + int cam_ref; + uint32_t ready_timeout_in_ms; bus_space_tag_t bus_tag; @@ -528,4 +532,6 @@ void nvme_notify_async_consumers(struct void nvme_notify_fail_consumers(struct nvme_controller *ctrlr); void nvme_notify_new_controller(struct nvme_controller *ctrlr); +void nvme_ctrlr_intx_handler(void *arg); + #endif /* __NVME_PRIVATE_H__ */ From owner-svn-src-all@freebsd.org Fri Jun 10 08:20:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7945AAEE9F0 for ; Fri, 10 Jun 2016 08:20:17 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DEE117A1 for ; Fri, 10 Jun 2016 08:20:16 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id q132so3661751lfe.3 for ; Fri, 10 Jun 2016 01:20:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=eGy3APTA61wqi0sAudWw3hCGHjJFgeNDlJzuy8SydCo=; b=YuLY3oYgntfMFXlNsfuVUC2htbFIY4hSt/OFPK1SpgfeUkIcJZvMUNgjciGEGFszvF MLXaVzSZ+sO0ji9VDBK1M73J18e4F9LvPS21NqdonpbeZFtcYh7kOFrrZbwhxLLoGvsR 9KmJ8tRoKpiDi7qzmWE2ZFJmRpr9ta7va+ei00foH3ktIskSyoWYS6RN8i/mRqTWm8BJ SAKBniXGnvG5xDGS1abb2y8JOWF41fif6f8SkXgd6XntjCTQH3yN4km06ZyRZNqR8jsU IZfskboWHQaWncnA6/W9Qwm9CNt80vYhlUJKeTSc7njXcykVj45p1Qup0BIGYC15NM+c qdXg== X-Gm-Message-State: ALyK8tJCSXk6j/Se8//LHcSEMb5/v6NnJD8F+6lk7Ravk2pMg8LCWMfBn9aAfobYYuwamw== X-Received: by 10.25.81.148 with SMTP id f142mr205849lfb.206.1465546809120; Fri, 10 Jun 2016 01:20:09 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id kz1sm1083595lbc.4.2016.06.10.01.20.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Jun 2016 01:20:08 -0700 (PDT) Subject: Re: svn commit: r301777 - head/lib/libc/stdio To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> From: Andrey Chernov Message-ID: <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> Date: Fri, 10 Jun 2016 11:20:07 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606100521.u5A5Lqa6035072@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 08:20:17 -0000 Please back it out. __sccl() use plain chars, you can't just call wide chars __wcollate_range_cmp() from it. Never intermix plain chars and wide chars without conversion. The problem is somewhere else. The code used for [a-z] ranges in the format. Moreover, even if conversion added this code can't work with wchars by definition since uses the same loop as in regcomp() for (i = 0; i < 256; i ++) Counting completely broken regcomp, our locale quickly becomes intermixing junk of chars and wchars without any conversion. Please anybody stop hacking here, especially blindly adding wchars everywhere without analyzing rest of code. If you see 256 or UCHAR_MAX somewhere, this function can't be converted to wchars. On 10.06.2016 8:21, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Jun 10 05:21:52 2016 > New Revision: 301777 > URL: https://svnweb.freebsd.org/changeset/base/301777 > > Log: > Fix regression from r301461. > > The fix to the __collate_range_cmp() ABI breakage missed some replacements > in libc's vfscanf(). Replace them with __wcollate_range_cmp() which > does what is expected. > > This was breaking applications like xterm and pidgin when using wide > characters. > > Reported by: Vitalij Satanivskij > Approved by: re > > Modified: > head/lib/libc/stdio/vfscanf.c > > Modified: head/lib/libc/stdio/vfscanf.c > ============================================================================== > --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016 (r301776) > +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016 (r301777) > @@ -873,7 +873,7 @@ doswitch: > n = *fmt; > if (n == ']' > || (table->__collate_load_error ? n < c : > - __collate_range_cmp (table, n, c) < 0 > + __wcollate_range_cmp(table, n, c) < 0 > ) > ) { > c = '-'; > @@ -887,8 +887,8 @@ doswitch: > } while (c < n); > } else { > for (i = 0; i < 256; i ++) > - if ( __collate_range_cmp (table, c, i) < 0 > - && __collate_range_cmp (table, i, n) <= 0 > + if (__wcollate_range_cmp(table, c, i) < 0 && > + __wcollate_range_cmp(table, i, n) <= 0 > ) > tab[i] = v; > } > From owner-svn-src-all@freebsd.org Fri Jun 10 08:33:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 171DCB6F16E; Fri, 10 Jun 2016 08:33:17 +0000 (UTC) (envelope-from tz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5ACF1383; Fri, 10 Jun 2016 08:33:16 +0000 (UTC) (envelope-from tz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5A8XGYM006666; Fri, 10 Jun 2016 08:33:16 GMT (envelope-from tz@FreeBSD.org) Received: (from tz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5A8XGXF006665; Fri, 10 Jun 2016 08:33:16 GMT (envelope-from tz@FreeBSD.org) Message-Id: <201606100833.u5A8XGXF006665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tz set sender to tz@FreeBSD.org using -f From: Torsten Zuehlsdorff Date: Fri, 10 Jun 2016 08:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301779 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 08:33:17 -0000 Author: tz (ports committer) Date: Fri Jun 10 08:33:15 2016 New Revision: 301779 URL: https://svnweb.freebsd.org/changeset/base/301779 Log: - Add myself (tz / Torsten Zuehlsdorff) to ports commiters - Add mentors junovitch, pi, swills Approved by: re (gjb), junovitch (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Fri Jun 10 06:04:53 2016 (r301778) +++ head/share/misc/committers-ports.dot Fri Jun 10 08:33:15 2016 (r301779) @@ -226,6 +226,7 @@ tota [label="TAKATSU Tomonari\ntota@Free trasz [label="Edward Tomasz Napierala\ntrasz@FreeBSD.org\n2007/04/12"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2004/07/06"] trociny [label="Mikolaj Golub\ntrociny@FreeBSD.org\n2013/10/17"] +tz [label="Torsten Zuehlsdorff\ntz@FreeBSD.org\n2016/06/04"] uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"] vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] vg [label="Veniamin Gvozdikov\nvg@FreeBSD.org\n2013/06/11"] @@ -413,6 +414,8 @@ jadawin -> wen joerg -> netchild +junovitch -> tz + knu -> daichi knu -> maho knu -> nobutaka @@ -530,6 +533,8 @@ pgollucci -> swills philip -> koitsu +pi -> tz + rafan -> chinsan rakuco -> alonso @@ -573,6 +578,7 @@ swills -> milki swills -> pclin swills -> robak swills -> rpaulo +swills -> tz swills -> xmj tabthorpe -> ashish From owner-svn-src-all@freebsd.org Fri Jun 10 12:03:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC9ECB71E15 for ; Fri, 10 Jun 2016 12:03:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm14-vm0.bullet.mail.bf1.yahoo.com (nm14-vm0.bullet.mail.bf1.yahoo.com [98.139.213.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8276A1A3F for ; Fri, 10 Jun 2016 12:03:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465560217; bh=BqclPByYbXEc02+6R3zBjlrGhgRpf8NofmdjafW+V8M=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=GZojq+c6sxg946rKCOJMkYaQhpDfTDhO+Y0/Jarph46jo+vBXIaWg/hdD2kpIT4qq01blia5zd8YoBR1mgT6VMt/F9hgOCKtkAU/MUOUp+vmkDC3a32ZIqQnxypRHikaY2mVbgMDCmy5k35FfaCj0fZYuHyElB2rloEbiSWJGMbg8v0SZWz8eQxaoZhEvSnlZJgoiQuvSlDKS6KP/ptYVLdBpG74MWPSBwoZXAPEm4GKShR9TcZ3V2/KZoigkUwA1hNcYATsQbWmO8GPeYD4OpDGiOt0mYIsSzZLsiJ223snumUPz0LStHg/YVvIVEPcka1p2wCtgWSQefvbQHcPmw== Received: from [98.139.215.141] by nm14.bullet.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 12:03:37 -0000 Received: from [98.139.211.193] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 12:03:37 -0000 Received: from [127.0.0.1] by smtp202.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 12:03:37 -0000 X-Yahoo-Newman-Id: 667655.41851.bm@smtp202.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: fR.MccgVM1lM3E1RgG6b0wB3Vz1_ncrdn14Jt91iVRco10L 23R8ih7K1D5gIZRDJE8YF0tPMVEHQI.rfykpi7vjJGzCxCc3ka7QIjK5TMjF 3K3HVIJkypX19rrY4dYD5fwCz6Yt1o2d_6IQaPNGqDNEBHvU6BWjtgvKmRxL iifhsCZdyWuLleEKbc6Aym6GerxJx3d390Hf01gEOMNYUqDva_nxVKJ7l6s0 jd2KeLEtwBh3NU3iLRnuqKhGugD.pnHWzRdUR4T7emVT1xTwGUVk0tliBD6H dWS4j4dGeWhwDDY8akTK109rgRpNPBF._vGyevcUuyEI8T0TrNStcWGaPbKL Hl2TZO3MuW_t.K1fzqUrphuBNmJqRvTCRvzvC1zWILpZy4ygUIDv8jzxl2Je ZIoxFUgeS2vbpR0_VTARUNUOEBM4xM40.DvfAhi8A4yoawiEtfUiQ3XOczEK oXpbyFlkKHCCC4LY9Nsw3ZIWvqdZETYIBz2RyW19fElVbSQ7GU0hlrywBu6W SOJCkFQm9vgXMuLd.cp3lTu98BuTH8vRT X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r301777 - head/lib/libc/stdio To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> From: Pedro Giffuni Message-ID: Date: Fri, 10 Jun 2016 07:03:36 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 12:03:39 -0000 (Sorry I have been offline/sleep for a while) Hello; I cannot back this out because of this report: http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 This change only re-states what has been working before the ABI breakage fix in r301461. The fix to regex is completely independent. Pedro. On 06/10/16 03:20, Andrey Chernov wrote: > Please back it out. __sccl() use plain chars, you can't just call wide > chars __wcollate_range_cmp() from it. Never intermix plain chars and > wide chars without conversion. The problem is somewhere else. The code > used for [a-z] ranges in the format. Moreover, even if conversion added > this code can't work with wchars by definition since uses the same loop > as in regcomp() > for (i = 0; i < 256; i ++) > > Counting completely broken regcomp, our locale quickly becomes > intermixing junk of chars and wchars without any conversion. Please > anybody stop hacking here, especially blindly adding wchars everywhere > without analyzing rest of code. > If you see 256 or UCHAR_MAX somewhere, this function can't be converted > to wchars. > > On 10.06.2016 8:21, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Fri Jun 10 05:21:52 2016 >> New Revision: 301777 >> URL: https://svnweb.freebsd.org/changeset/base/301777 >> >> Log: >> Fix regression from r301461. >> >> The fix to the __collate_range_cmp() ABI breakage missed some replacements >> in libc's vfscanf(). Replace them with __wcollate_range_cmp() which >> does what is expected. >> >> This was breaking applications like xterm and pidgin when using wide >> characters. >> >> Reported by: Vitalij Satanivskij >> Approved by: re >> >> Modified: >> head/lib/libc/stdio/vfscanf.c >> >> Modified: head/lib/libc/stdio/vfscanf.c >> ============================================================================== >> --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016 (r301776) >> +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016 (r301777) >> @@ -873,7 +873,7 @@ doswitch: >> n = *fmt; >> if (n == ']' >> || (table->__collate_load_error ? n < c : >> - __collate_range_cmp (table, n, c) < 0 >> + __wcollate_range_cmp(table, n, c) < 0 >> ) >> ) { >> c = '-'; >> @@ -887,8 +887,8 @@ doswitch: >> } while (c < n); >> } else { >> for (i = 0; i < 256; i ++) >> - if ( __collate_range_cmp (table, c, i) < 0 >> - && __collate_range_cmp (table, i, n) <= 0 >> + if (__wcollate_range_cmp(table, c, i) < 0 && >> + __wcollate_range_cmp(table, i, n) <= 0 >> ) >> tab[i] = v; >> } >> > From owner-svn-src-all@freebsd.org Fri Jun 10 12:19:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE610AEE10D for ; Fri, 10 Jun 2016 12:19:52 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B6C81153 for ; Fri, 10 Jun 2016 12:19:52 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id q132so7223424lfe.3 for ; Fri, 10 Jun 2016 05:19:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=UGvO5WhYyFvD86x3bUsa0vZTySdIALyO4G91i3U5TRw=; b=K6HwKqBfBp+8RePejdmM+40/HbnWj893eKGWvrRgmaW0w9ZjlzxL6mbobT/9NhReD6 u3S2j47Sh7l1Sigl6mUeRDwaK0ZyhjNtOyWzFlXNkvjztkHANxsvcHZEO7Y7ubV+JQav rMKK/DBpWSFwmOxUKcCDKvDNi/dmwutd0zTbWeKKxGYmrxGkCqL/vNWP5bWqzsgkuo1R jHp0jiNYI8mr29PtDhw4lQDhU/4SdCx8onAkJM3qscf4n5A7oy4I9qQIbEeNrPbZayf4 Rztmdk3TfU+pJuHAqKIj7+2IXiXcKmYpt8AayjHStQnAZ/ECItxFzzXPiW1QLo/sMK1T 1ECw== X-Gm-Message-State: ALyK8tLm0VTi3wHWYY7TpUAd0n7iU48aTvMs1U3mQNkFJ7T9WdE1tsz69XzrlAQYzcI08A== X-Received: by 10.25.139.135 with SMTP id n129mr490323lfd.209.1465561184728; Fri, 10 Jun 2016 05:19:44 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id g82sm1127166ljg.45.2016.06.10.05.19.43 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Jun 2016 05:19:44 -0700 (PDT) Subject: Re: svn commit: r301777 - head/lib/libc/stdio To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> From: Andrey Chernov Message-ID: <52d3a4b3-0b52-abd3-8633-909885f12781@freebsd.org> Date: Fri, 10 Jun 2016 15:19:43 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 12:19:53 -0000 On 10.06.2016 15:03, Pedro Giffuni wrote: > (Sorry I have been offline/sleep for a while) > > Hello; > > I cannot back this out because of this report: > > http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 > > This change only re-states what has been working before the ABI breakage > fix in r301461. Because now strcoll_l() is used as before and it is broken in wide char converting process. It is broken for _all_, not just for vfscanf() ranges. It should never fail with any args. Real fix should be in strcoll_l(). > The fix to regex is completely independent. It is dependent. vfscanf() and regcomp() use the same code for range collation. If we remove range collation from everywhere, we save vfscanf(), but strcoll_l() remains broken. From owner-svn-src-all@freebsd.org Fri Jun 10 13:57:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D52AB703DF; Fri, 10 Jun 2016 13:57:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A84A14E3; Fri, 10 Jun 2016 13:57:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ADvuht026471; Fri, 10 Jun 2016 13:57:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ADvuGX026470; Fri, 10 Jun 2016 13:57:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101357.u5ADvuGX026470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 13:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301780 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 13:57:57 -0000 Author: ngie Date: Fri Jun 10 13:57:56 2016 New Revision: 301780 URL: https://svnweb.freebsd.org/changeset/base/301780 Log: MFC r299387: r299387 (by cem): netipsec: Fix minor style nit Coverity points out that 'continue' is equivalent to 'break' in a do {} while(false) loop. CID: 1354983 Modified: stable/10/sys/netipsec/key.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/key.c ============================================================================== --- stable/10/sys/netipsec/key.c Fri Jun 10 08:33:15 2016 (r301779) +++ stable/10/sys/netipsec/key.c Fri Jun 10 13:57:56 2016 (r301780) @@ -346,7 +346,7 @@ do { \ if ((head) != (sav)) { \ ipseclog((LOG_DEBUG, "%s: state mismatched (TREE=%d SA=%d)\n", \ (name), (head), (sav))); \ - continue; \ + break; \ } \ } while (0) From owner-svn-src-all@freebsd.org Fri Jun 10 14:06:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 561B6B7077C; Fri, 10 Jun 2016 14:06:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23DC31B13; Fri, 10 Jun 2016 14:06:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AE6GnB030146; Fri, 10 Jun 2016 14:06:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AE6GiF030145; Fri, 10 Jun 2016 14:06:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101406.u5AE6GiF030145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301781 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:06:17 -0000 Author: ngie Date: Fri Jun 10 14:06:16 2016 New Revision: 301781 URL: https://svnweb.freebsd.org/changeset/base/301781 Log: MFstable/10 r301780: MFC r299387: r299387 (by cem): netipsec: Fix minor style nit Coverity points out that 'continue' is equivalent to 'break' in a do {} while(false) loop. CID: 1354983 Modified: stable/9/sys/netipsec/key.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/key.c ============================================================================== --- stable/9/sys/netipsec/key.c Fri Jun 10 13:57:56 2016 (r301780) +++ stable/9/sys/netipsec/key.c Fri Jun 10 14:06:16 2016 (r301781) @@ -347,7 +347,7 @@ do { \ if ((head) != (sav)) { \ ipseclog((LOG_DEBUG, "%s: state mismatched (TREE=%d SA=%d)\n", \ (name), (head), (sav))); \ - continue; \ + break; \ } \ } while (0) From owner-svn-src-all@freebsd.org Fri Jun 10 14:08:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 829C7B70868; Fri, 10 Jun 2016 14:08:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 539041D93; Fri, 10 Jun 2016 14:08:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AE8fjE030400; Fri, 10 Jun 2016 14:08:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AE8fKA030399; Fri, 10 Jun 2016 14:08:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101408.u5AE8fKA030399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301782 - stable/10/sbin/fsck_ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:08:42 -0000 Author: ngie Date: Fri Jun 10 14:08:41 2016 New Revision: 301782 URL: https://svnweb.freebsd.org/changeset/base/301782 Log: MFC r299460: r299460 (by cem): fsck_ffs: Don't overrun mount device buffer Maybe this case is impossible. Either way, when attempting to "/dev/"-prefix a non-global device name, check that we do not overrun the f_mntfromname buffer. In this case, truncating (with strlcpy or similar) would not be useful, since the f_mntfromname result of getmntpt() is passed directly to open(2) later. CID: 1006789 Modified: stable/10/sbin/fsck_ffs/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_ffs/main.c ============================================================================== --- stable/10/sbin/fsck_ffs/main.c Fri Jun 10 14:06:16 2016 (r301781) +++ stable/10/sbin/fsck_ffs/main.c Fri Jun 10 14:08:41 2016 (r301782) @@ -644,6 +644,9 @@ getmntpt(const char *name) statfsp = &mntbuf[i]; ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { + if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; strcpy(device, _PATH_DEV); strcat(device, ddevname); strcpy(statfsp->f_mntfromname, device); From owner-svn-src-all@freebsd.org Fri Jun 10 14:10:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7171AB70A3B; Fri, 10 Jun 2016 14:10:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 421381F73; Fri, 10 Jun 2016 14:10:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEApIW031192; Fri, 10 Jun 2016 14:10:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEApbx031191; Fri, 10 Jun 2016 14:10:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101410.u5AEApbx031191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301783 - stable/9/sbin/fsck_ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:10:52 -0000 Author: ngie Date: Fri Jun 10 14:10:51 2016 New Revision: 301783 URL: https://svnweb.freebsd.org/changeset/base/301783 Log: MFstable/10 r301782: MFC r299460: r299460 (by cem): fsck_ffs: Don't overrun mount device buffer Maybe this case is impossible. Either way, when attempting to "/dev/"-prefix a non-global device name, check that we do not overrun the f_mntfromname buffer. In this case, truncating (with strlcpy or similar) would not be useful, since the f_mntfromname result of getmntpt() is passed directly to open(2) later. CID: 1006789 Modified: stable/9/sbin/fsck_ffs/main.c Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/fsck_ffs/ (props changed) Modified: stable/9/sbin/fsck_ffs/main.c ============================================================================== --- stable/9/sbin/fsck_ffs/main.c Fri Jun 10 14:08:41 2016 (r301782) +++ stable/9/sbin/fsck_ffs/main.c Fri Jun 10 14:10:51 2016 (r301783) @@ -627,6 +627,9 @@ getmntpt(const char *name) statfsp = &mntbuf[i]; ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { + if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; strcpy(device, _PATH_DEV); strcat(device, ddevname); strcpy(statfsp->f_mntfromname, device); From owner-svn-src-all@freebsd.org Fri Jun 10 14:13:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41818B70B17; Fri, 10 Jun 2016 14:13:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8CF1346; Fri, 10 Jun 2016 14:13:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEDPLq033907; Fri, 10 Jun 2016 14:13:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEDPTu033906; Fri, 10 Jun 2016 14:13:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101413.u5AEDPTu033906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301784 - stable/10/usr.sbin/makefs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:13:26 -0000 Author: ngie Date: Fri Jun 10 14:13:24 2016 New Revision: 301784 URL: https://svnweb.freebsd.org/changeset/base/301784 Log: MFC r299461: r299461 (by cem): ffs_bswap: Copy one UFS dinode member at a time No functional change. CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:10:51 2016 (r301783) +++ stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:13:24 2016 (r301784) @@ -135,7 +135,8 @@ ffs_dinode1_swap(struct ufs1_dinode *o, n->di_mtimensec = bswap32(o->di_mtimensec); n->di_ctime = bswap32(o->di_ctime); n->di_ctimensec = bswap32(o->di_ctimensec); - memcpy(n->di_db, o->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); n->di_flags = bswap32(o->di_flags); n->di_blocks = bswap32(o->di_blocks); n->di_gen = bswap32(o->di_gen); @@ -165,7 +166,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, n->di_kernflags = bswap32(o->di_kernflags); n->di_flags = bswap32(o->di_flags); n->di_extsize = bswap32(o->di_extsize); - memcpy(n->di_extb, o->di_extb, (NXADDR + NDADDR + NIADDR) * 8); + memcpy(n->di_extb, o->di_extb, sizeof(n->di_extb)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); } void From owner-svn-src-all@freebsd.org Fri Jun 10 14:15:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2185EB70B98 for ; Fri, 10 Jun 2016 14:15:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm2-vm1.bullet.mail.bf1.yahoo.com (nm2-vm1.bullet.mail.bf1.yahoo.com [98.139.213.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE1D31513 for ; Fri, 10 Jun 2016 14:15:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465568095; bh=haPbNIrR1VsQGjTPo+wPrqmrITcHB4fm7vlr8stJ9W8=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=XSOlmQCOfyI8urLgQyEnadQ5+LE2mnIaDU5UKs540i9FvADvunAmehwVz7VSJylgFaLffRxCY7ZTUL1E2/Ez7776J72LrH7QsBJiAl68oNy3LU1cRGHpeiS7X+ytEoBzBhf7GANQ/GOP7I0B9NmisLU809Sfk04kA0EkYas4FmylOwBnk93muHirLWJNDT+jUYX3D7hyBKlJlE2gdNSkzEpQl+75AfYEIVG6/PdAQkL3BOWoQ2uzLps5NQRwpJk/8nS1F7Lwds2RahBihUQHP2yRcuuErXPAtenC7H1pUZYWia8ExilS4Z4VCB014DZtf3yeB2lzuHBpcIIP224YOg== Received: from [98.139.170.179] by nm2.bullet.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 14:14:55 -0000 Received: from [68.142.230.72] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 14:14:55 -0000 Received: from [127.0.0.1] by smtp229.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 14:14:55 -0000 X-Yahoo-Newman-Id: 770678.50321.bm@smtp229.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6QT39HUVM1mRkKm8KtpKAYS9_kSua.iiipgkJVHhJYngAYL WIoe6EcQbzgH2F.idyAicBCNqcVbeMrCU_mn6aiSOhRP_99ydbi_rAbzAHtK siKSfu3dptN21uVGWBCzZ55B7_b1IX80LR5q3rH_97FfmpMal5FbkW0dMpQ3 2n1G9GRQkAYjuZNZ0onW27kSfdXfH7m9boXN5INLWPyfTkZJ6ISb34qY22vL hcq1_FtDt9cstIX58m7imzG9OuTLpjf.rzbJAAP2NnA.ckuvfIXp2OAwMI.X onFTSZfIdoIwNevY_BHCHSyE3VI2ItM.8XUCL0uIC4Ucsd27XAoIMm_BNIOc R6XHm5iNBC2icLUoeoQA4E_UefAU95CnLPgg0nWc4NQtGvs8X7JaMw9iz6Qh pgIfobWdFaTCNdin6Uclr4UvTrFTlNj3WkJiq_F_cIoQCq13wgJ.4Q.YSA00 GFMdb2iX.1qkJfMp.QZ3RN2hvyJ46AxQNfjRGoKqNXk9cR6Jdyp1K8HJFI0Z zdCkWsl7H9_dSV7THLMzCvaoMYL8jsuDf X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r301777 - head/lib/libc/stdio To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> <52d3a4b3-0b52-abd3-8633-909885f12781@freebsd.org> From: Pedro Giffuni Message-ID: <03897eab-0725-7c7a-0edf-04eb44eff6f7@FreeBSD.org> Date: Fri, 10 Jun 2016 09:14:55 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <52d3a4b3-0b52-abd3-8633-909885f12781@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:15:03 -0000 On 06/10/16 07:19, Andrey Chernov wrote: > On 10.06.2016 15:03, Pedro Giffuni wrote: >> (Sorry I have been offline/sleep for a while) >> >> Hello; >> >> I cannot back this out because of this report: >> >> http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 >> >> This change only re-states what has been working before the ABI breakage >> fix in r301461. > > Because now strcoll_l() is used as before and it is broken in wide char > converting process. It is broken for _all_, not just for vfscanf() > ranges. It should never fail with any args. > Real fix should be in strcoll_l(). > Yes, it is broken as before however the objective of r301461 was only to address the ABI breakage. If I revert r301777 then I have to backout r301461 too, and then we have again the ABI breakage. I understand you want to fix all but we are under code freeze and I have to go back to a known working (although still broken) state. >> The fix to regex is completely independent. > > It is dependent. vfscanf() and regcomp() use the same code for range > collation. If we remove range collation from everywhere, we save > vfscanf(), but strcoll_l() remains broken. > > We have had a broken regex for a very long time, and we new that before collation was introduced. I didn't take that decision but moving to libtre was a lot more work and we really had to have collation now. Pedro. From owner-svn-src-all@freebsd.org Fri Jun 10 14:27:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66538B70E20; Fri, 10 Jun 2016 14:27:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CB5C1CF6; Fri, 10 Jun 2016 14:27:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AERutd038226; Fri, 10 Jun 2016 14:27:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AERuVS038225; Fri, 10 Jun 2016 14:27:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101427.u5AERuVS038225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301785 - stable/9/usr.sbin/makefs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:27:57 -0000 Author: ngie Date: Fri Jun 10 14:27:56 2016 New Revision: 301785 URL: https://svnweb.freebsd.org/changeset/base/301785 Log: MFstable/10 r301784: MFC r299461: r299461 (by cem): ffs_bswap: Copy one UFS dinode member at a time No functional change. CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:13:24 2016 (r301784) +++ stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Fri Jun 10 14:27:56 2016 (r301785) @@ -135,7 +135,8 @@ ffs_dinode1_swap(struct ufs1_dinode *o, n->di_mtimensec = bswap32(o->di_mtimensec); n->di_ctime = bswap32(o->di_ctime); n->di_ctimensec = bswap32(o->di_ctimensec); - memcpy(n->di_db, o->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); n->di_flags = bswap32(o->di_flags); n->di_blocks = bswap32(o->di_blocks); n->di_gen = bswap32(o->di_gen); @@ -165,7 +166,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, n->di_kernflags = bswap32(o->di_kernflags); n->di_flags = bswap32(o->di_flags); n->di_extsize = bswap32(o->di_extsize); - memcpy(n->di_extb, o->di_extb, (NXADDR + NDADDR + NIADDR) * 8); + memcpy(n->di_extb, o->di_extb, sizeof(n->di_extb)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); } void From owner-svn-src-all@freebsd.org Fri Jun 10 14:31:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 606F3B710FA; Fri, 10 Jun 2016 14:31:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D7ED11BE; Fri, 10 Jun 2016 14:31:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEV3RS038456; Fri, 10 Jun 2016 14:31:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEV3pH038455; Fri, 10 Jun 2016 14:31:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101431.u5AEV3pH038455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301786 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:31:04 -0000 Author: ngie Date: Fri Jun 10 14:31:03 2016 New Revision: 301786 URL: https://svnweb.freebsd.org/changeset/base/301786 Log: MFC r299489: r299489 (by cem): camcontrol(8): Fix trival double-free CID: 1331223 Modified: stable/10/sbin/camcontrol/camcontrol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Fri Jun 10 14:27:56 2016 (r301785) +++ stable/10/sbin/camcontrol/camcontrol.c Fri Jun 10 14:31:03 2016 (r301786) @@ -4992,6 +4992,7 @@ dev_has_vpd_page(struct cam_device *dev, if (cam_send_ccb(dev, ccb) < 0) { cam_freeccb(ccb); + ccb = NULL; retval = -1; goto bailout; } From owner-svn-src-all@freebsd.org Fri Jun 10 14:32:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B830AB7115C; Fri, 10 Jun 2016 14:32:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D06D1442; Fri, 10 Jun 2016 14:32:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEVxir040516; Fri, 10 Jun 2016 14:31:59 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEVxUJ040515; Fri, 10 Jun 2016 14:31:59 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201606101431.u5AEVxUJ040515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 10 Jun 2016 14:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301787 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:32:00 -0000 Author: allanjude Date: Fri Jun 10 14:31:59 2016 New Revision: 301787 URL: https://svnweb.freebsd.org/changeset/base/301787 Log: Fix bsdinstall for root-on-zfs with MBR partitioning Fix an error where vfs.root.mountfrom was not always set as required when creating a bootpool. After the recent geliboot changes, it was only set if the main pool was encrypted. Also resolve an error where the bootpool was unmounted twice causing bsdinstall to stop with an error message about the failed command. Approved by: re (gjb) Sponsored by: BSDCan Hacker Lounge Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Fri Jun 10 14:31:03 2016 (r301786) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Fri Jun 10 14:31:59 2016 (r301787) @@ -1194,11 +1194,6 @@ zfs_create_boot() f_eval_catch $funcname chmod "$CHMOD_MODE" \ go-wrx "$bootpool/$zroot_key" || return $FAILURE - else - # Clean up - f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \ - "$bootpool_name" || return $FAILURE - f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi fi @@ -1409,6 +1404,11 @@ zfs_create_boot() "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ "$zroot_name" || return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch $funcname printf "$PRINTF_CONF" \ + vfs.root.mountfrom "\"zfs:$zroot_name/$zroot_bootfs\"" \ + $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + fi # # Set canmount=noauto so that the default Boot Environment (BE) does not # get mounted if a different BE is selected from the beastie menu @@ -1486,10 +1486,6 @@ zfs_create_boot() $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE done - f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - "\"zfs:$zroot_name/$zroot_bootfs\"" \ - $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE - return $SUCCESS } From owner-svn-src-all@freebsd.org Fri Jun 10 14:33:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C4F1B711C6; Fri, 10 Jun 2016 14:33:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39507174B; Fri, 10 Jun 2016 14:33:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEXLiS041840; Fri, 10 Jun 2016 14:33:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEXLmg041839; Fri, 10 Jun 2016 14:33:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101433.u5AEXLmg041839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301788 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:33:22 -0000 Author: ngie Date: Fri Jun 10 14:33:21 2016 New Revision: 301788 URL: https://svnweb.freebsd.org/changeset/base/301788 Log: MFC r299490: r299490 (by cem): camcontrol(8): Fix another trivial double-free CID: 1331222 Modified: stable/10/sbin/camcontrol/fwdownload.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/10/sbin/camcontrol/fwdownload.c Fri Jun 10 14:31:59 2016 (r301787) +++ stable/10/sbin/camcontrol/fwdownload.c Fri Jun 10 14:33:21 2016 (r301788) @@ -488,6 +488,7 @@ fw_validate_ibm(struct cam_device *dev, CAM_EPF_ALL, stderr); cam_freeccb(ccb); + ccb = NULL; goto bailout; } @@ -549,7 +550,8 @@ fw_validate_ibm(struct cam_device *dev, fprintf(stdout, "Firmware file is valid for this drive.\n"); retval = 0; bailout: - cam_freeccb(ccb); + if (ccb != NULL) + cam_freeccb(ccb); return (retval); } From owner-svn-src-all@freebsd.org Fri Jun 10 14:40:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3CBB712D9; Fri, 10 Jun 2016 14:40:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE411A50; Fri, 10 Jun 2016 14:40:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEefm6042806; Fri, 10 Jun 2016 14:40:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEefB0042805; Fri, 10 Jun 2016 14:40:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101440.u5AEefB0042805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301789 - stable/10/usr.sbin/route6d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:40:42 -0000 Author: ngie Date: Fri Jun 10 14:40:41 2016 New Revision: 301789 URL: https://svnweb.freebsd.org/changeset/base/301789 Log: MFC r299491: r299491 (by cem): route6d(8): Fix potential double-free In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed repeatedly. It isn't clear to me that that case is possible, but be clear and do the right thing in case it is. CID: 272537 Modified: stable/10/usr.sbin/route6d/route6d.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/route6d/route6d.c ============================================================================== --- stable/10/usr.sbin/route6d/route6d.c Fri Jun 10 14:33:21 2016 (r301788) +++ stable/10/usr.sbin/route6d/route6d.c Fri Jun 10 14:40:41 2016 (r301789) @@ -2602,8 +2602,10 @@ krtread(int again) sleep(1); retry++; errmsg = NULL; - if (buf) + if (buf) { free(buf); + buf = NULL; + } if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; From owner-svn-src-all@freebsd.org Fri Jun 10 14:42:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 132F3B714CD; Fri, 10 Jun 2016 14:42:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D66B91EFA; Fri, 10 Jun 2016 14:42:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEgbbc045725; Fri, 10 Jun 2016 14:42:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEgb3T045724; Fri, 10 Jun 2016 14:42:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101442.u5AEgb3T045724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301790 - stable/9/usr.sbin/route6d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:42:38 -0000 Author: ngie Date: Fri Jun 10 14:42:36 2016 New Revision: 301790 URL: https://svnweb.freebsd.org/changeset/base/301790 Log: MFstable/10 r301789: MFC r299491: r299491 (by cem): route6d(8): Fix potential double-free In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed repeatedly. It isn't clear to me that that case is possible, but be clear and do the right thing in case it is. CID: 272537 Modified: stable/9/usr.sbin/route6d/route6d.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/route6d/ (props changed) Modified: stable/9/usr.sbin/route6d/route6d.c ============================================================================== --- stable/9/usr.sbin/route6d/route6d.c Fri Jun 10 14:40:41 2016 (r301789) +++ stable/9/usr.sbin/route6d/route6d.c Fri Jun 10 14:42:36 2016 (r301790) @@ -2646,8 +2646,10 @@ krtread(int again) sleep(1); retry++; errmsg = NULL; - if (buf) + if (buf) { free(buf); + buf = NULL; + } if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; From owner-svn-src-all@freebsd.org Fri Jun 10 14:45:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE135B71575; Fri, 10 Jun 2016 14:45:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF5DD110E; Fri, 10 Jun 2016 14:45:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEjKfU048254; Fri, 10 Jun 2016 14:45:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEjKfm048253; Fri, 10 Jun 2016 14:45:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101445.u5AEjKfm048253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301791 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:45:22 -0000 Author: ngie Date: Fri Jun 10 14:45:20 2016 New Revision: 301791 URL: https://svnweb.freebsd.org/changeset/base/301791 Log: MFC r299494: r299494 (by cem): subr_vmem: Fix double-free in error case of vmem_create If vmem_init() fails, 'vm' is already destroyed and freed. Don't free it again. CID: 1042110 Modified: stable/10/sys/kern/subr_vmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_vmem.c ============================================================================== --- stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:42:36 2016 (r301790) +++ stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:45:20 2016 (r301791) @@ -1046,10 +1046,8 @@ vmem_create(const char *name, vmem_addr_ if (vm == NULL) return (NULL); if (vmem_init(vm, name, base, size, quantum, qcache_max, - flags) == NULL) { - free(vm, M_VMEM); + flags) == NULL) return (NULL); - } return (vm); } From owner-svn-src-all@freebsd.org Fri Jun 10 14:47:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D77E5B715E7; Fri, 10 Jun 2016 14:47:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A31F712DF; Fri, 10 Jun 2016 14:47:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 0FCA7358C5A; Fri, 10 Jun 2016 16:47:29 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id E156628494; Fri, 10 Jun 2016 16:47:28 +0200 (CEST) Date: Fri, 10 Jun 2016 16:47:28 +0200 From: Jilles Tjoelker To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl Message-ID: <20160610144728.GA85730@stack.nl> References: <201606080203.u5823rbD075793@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606080203.u5823rbD075793@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:47:32 -0000 On Wed, Jun 08, 2016 at 02:03:53AM +0000, Mariusz Zaborski wrote: > Author: oshogbo > Date: Wed Jun 8 02:03:53 2016 > New Revision: 301572 > URL: https://svnweb.freebsd.org/changeset/base/301572 > Log: > Add flags to the Casper services. > CASPER_SERVICE_STDIO - Casper will not close the first three descriptors (stdin, > stdout and stderr) this can be helpful for debugging. > CASPER_SERVICE_FD - Capser will not close all other descriptors, this can > be useful for a filesystem service. This reminds me that there are some common cases where it is wrong to close descriptors you don't know about. The non-POSIX command diff <(cmd1) <(cmd2) that compares the outputs of the two commands, when executed with bash that was compiled with the full /dev/fd visible (as in poudriere), will actually run something like diff /dev/fd/63 /dev/fd/62 passing two file descriptors to pipes. When created by a shell, these pathnames will start with /dev/fd/, but people could create symlinks to these special files. > [snip] > +static void > +stdnull(void) > +{ > + int fd; > + > + fd = open(_PATH_DEVNULL, O_RDWR); > + if (fd == -1) > + errx(1, "Unable to open %s", _PATH_DEVNULL); > + > + if (setsid() == -1) > + errx(1, "Unable to detach from session"); There is an implicit assumption here that stdnull() is only called from a process that was forked off from here, since setsid() will not and cannot work when called from a process that is already a session leader. If the application is running from a shell, this setsid() will exclude the process from most signals, including terminal ^C/^\/^Z, kill % and hangups. More generally, this might make it more likely for the process to hang around indefinitely after the parent is gone. > + > + if (dup2(fd, STDIN_FILENO) == -1) > + errx(1, "Unable to cover stdin"); > + if (dup2(fd, STDOUT_FILENO) == -1) > + errx(1, "Unable to cover stdout"); > + if (dup2(fd, STDERR_FILENO) == -1) > + errx(1, "Unable to cover stderr"); > + > + close(fd); This was not broken by this commit, but fd should not be closed if it is equal to STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO. > [snip] -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Fri Jun 10 14:48:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29DC1B71637; Fri, 10 Jun 2016 14:48:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBAD01493; Fri, 10 Jun 2016 14:48:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEmBvd048416; Fri, 10 Jun 2016 14:48:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEmBWD048415; Fri, 10 Jun 2016 14:48:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101448.u5AEmBWD048415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301792 - stable/10/crypto/heimdal/lib/krb5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:48:12 -0000 Author: ngie Date: Fri Jun 10 14:48:10 2016 New Revision: 301792 URL: https://svnweb.freebsd.org/changeset/base/301792 Log: MFC r299495: r299495 (by cem): libkrb5: Fix potential double-free If krb5_make_principal fails, tmp_creds.server may remain a pointer to freed memory and then be double-freed. After freeing it the first time, initialize it to NULL, which causes subsequent krb5_free_principal calls to do the right thing. CID: 1273430 Modified: stable/10/crypto/heimdal/lib/krb5/get_cred.c Directory Properties: stable/10/ (props changed) Modified: stable/10/crypto/heimdal/lib/krb5/get_cred.c ============================================================================== --- stable/10/crypto/heimdal/lib/krb5/get_cred.c Fri Jun 10 14:45:20 2016 (r301791) +++ stable/10/crypto/heimdal/lib/krb5/get_cred.c Fri Jun 10 14:48:10 2016 (r301792) @@ -831,6 +831,7 @@ get_cred_kdc_capath_worker(krb5_context if(strcmp(tgt_inst, server_realm) == 0) break; krb5_free_principal(context, tmp_creds.server); + tmp_creds.server = NULL; ret = krb5_make_principal(context, &tmp_creds.server, tgt_inst, KRB5_TGS_NAME, server_realm, NULL); if(ret) { From owner-svn-src-all@freebsd.org Fri Jun 10 14:51:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6886EB716C2; Fri, 10 Jun 2016 14:51:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A89E18D5; Fri, 10 Jun 2016 14:51:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AEpBDF049179; Fri, 10 Jun 2016 14:51:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AEpBC5049178; Fri, 10 Jun 2016 14:51:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101451.u5AEpBC5049178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 14:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301793 - stable/10/contrib/atf/atf-c/detail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:51:12 -0000 Author: ngie Date: Fri Jun 10 14:51:11 2016 New Revision: 301793 URL: https://svnweb.freebsd.org/changeset/base/301793 Log: MFC r299496: r299496 (by cem): atf map: Fix double-free in low memory error path If atf_list_append(, X, ) fails, X is freed. Don't free it again. CID: 979936 Modified: stable/10/contrib/atf/atf-c/detail/map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/atf-c/detail/map.c ============================================================================== --- stable/10/contrib/atf/atf-c/detail/map.c Fri Jun 10 14:48:10 2016 (r301792) +++ stable/10/contrib/atf/atf-c/detail/map.c Fri Jun 10 14:51:11 2016 (r301793) @@ -360,7 +360,6 @@ atf_map_insert(atf_map_t *m, const char if (atf_is_error(err)) { if (managed) free(value); - free(me); } } } else { From owner-svn-src-all@freebsd.org Fri Jun 10 14:59:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0C92B7186B; Fri, 10 Jun 2016 14:59:12 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9D41C1C; Fri, 10 Jun 2016 14:59:12 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AExBSG052109; Fri, 10 Jun 2016 14:59:11 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AExBmK052108; Fri, 10 Jun 2016 14:59:11 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201606101459.u5AExBmK052108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 10 Jun 2016 14:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301794 - head/usr.sbin/services_mkdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 14:59:12 -0000 Author: allanjude Date: Fri Jun 10 14:59:11 2016 New Revision: 301794 URL: https://svnweb.freebsd.org/changeset/base/301794 Log: Fix a miss merge in the services_mkdb(8) man page Restore the cross reference to getservent(3) to the correct line Approved by: re (gjb) Sponsored by: BSDCan Hacker Lounge Modified: head/usr.sbin/services_mkdb/services_mkdb.8 Modified: head/usr.sbin/services_mkdb/services_mkdb.8 ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.8 Fri Jun 10 14:51:11 2016 (r301793) +++ head/usr.sbin/services_mkdb/services_mkdb.8 Fri Jun 10 14:59:11 2016 (r301794) @@ -75,6 +75,7 @@ Print the services file to stdout, omitt .El .Pp The databases are used by the C library services routines (see +.Xr getservent 3 ) . .Pp The .Fl b @@ -82,7 +83,6 @@ and .Fl l flags are mutually exclusive. The default byte ordering is the current host order. -.Xr getservent 3 ) . .Sh FILES .Bl -tag -width ".Pa /var/db/services.db.tmp" -compact .It Pa /var/db/services.db From owner-svn-src-all@freebsd.org Fri Jun 10 15:01:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC267B718FB for ; Fri, 10 Jun 2016 15:01:26 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DBDE1EF1 for ; Fri, 10 Jun 2016 15:01:26 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f43.google.com with SMTP id q132so10110718lfe.3 for ; Fri, 10 Jun 2016 08:01:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=8iBa3XjnMuON3p4WEB4OzKhhzbFvaktXGhXAV6KDxX8=; b=BkQlowH7w5j6wuA8CncMBH4lZaBSeqT6zB4W6D0dKU6S73vfeoKwQx+2JG7IyjGd4b mFFcyOWbNKGrj43RlybVtHr8OXa4Q3Ml0cWjYIC7rlOM3EpUWa8/PeEXDGa82gC/0Sce PTr3uWlW4FfyWL4aGvtAfFR2FJIQLUxN6Le8JSqB7u9QpIR5sgYM7wde4An9R85h3vn7 8olwB6fD6VnaDT+nJfG04YBxwhc9g9iNSaY8uqdFWfmnPVl6Jpp1UWkLh6G+FiCVqXj5 lKGw5Grs8N+V4cfG8qbq5xCOfk9OrfL7/1AShM/U5ghY05b6yVclpwsaH+aQ+iA7psax OZIQ== X-Gm-Message-State: ALyK8tJEDKjfAfpLyeM7ur+sGXf1wBm6jZqBewwsnZ/fUw8nkaCqtmp9z2Yr/w1kpOapyg== X-Received: by 10.25.151.74 with SMTP id z71mr815828lfd.30.1465570883858; Fri, 10 Jun 2016 08:01:23 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 139sm891336ljj.1.2016.06.10.08.01.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Jun 2016 08:01:23 -0700 (PDT) Subject: Re: svn commit: r301777 - head/lib/libc/stdio To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> <52d3a4b3-0b52-abd3-8633-909885f12781@freebsd.org> <03897eab-0725-7c7a-0edf-04eb44eff6f7@FreeBSD.org> From: Andrey Chernov Message-ID: <6d1d7aaa-eef0-cafc-b11a-3b81ee3fb230@freebsd.org> Date: Fri, 10 Jun 2016 18:01:22 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <03897eab-0725-7c7a-0edf-04eb44eff6f7@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------D1E3F9F08EFAE110A4449F74" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:01:27 -0000 This is a multi-part message in MIME format. --------------D1E3F9F08EFAE110A4449F74 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 10.06.2016 17:14, Pedro Giffuni wrote: >> Because now strcoll_l() is used as before and it is broken in wide char >> converting process. It is broken for _all_, not just for vfscanf() >> ranges. It should never fail with any args. >> Real fix should be in strcoll_l(). >> > > Yes, it is broken as before however the objective of r301461 was only > to address the ABI breakage. If I revert r301777 then I have to backout > r301461 too, and then we have again the ABI breakage. > > I understand you want to fix all but we are under code freeze and > I have to go back to a known working (although still broken) state. I can't make strcoll or vfscanf to drop core in my simple tests. Too little info in the bug report. In any case here is vfscanf.c fix attached (by removing collation range). >> It is dependent. vfscanf() and regcomp() use the same code for range >> collation. If we remove range collation from everywhere, we save >> vfscanf(), but strcoll_l() remains broken. >> >> > > We have had a broken regex for a very long time, and we new that > before collation was introduced. I didn't take that decision but > moving to libtre was a lot more work and we really had to have > collation now. No, we have perfectly working single byte regex with collation ranges for many years until those wchars was invaded the code very recently. --------------D1E3F9F08EFAE110A4449F74 Content-Type: text/plain; charset=UTF-8; name="vfscanf.c.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="vfscanf.c.diff" SW5kZXg6IHZmc2NhbmYuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB2ZnNjYW5mLmMJKHJldmlzaW9u IDMwMTc3OSkKKysrIHZmc2NhbmYuYwkod29ya2luZyBjb3B5KQpAQCAtODE2LDkgKzgxNiw3 IEBACiBzdGF0aWMgY29uc3QgdV9jaGFyICoKIF9fc2NjbChjaGFyICp0YWIsIGNvbnN0IHVf Y2hhciAqZm10KQogewotCWludCBjLCBuLCB2LCBpOwotCXN0cnVjdCB4bG9jYWxlX2NvbGxh dGUgKnRhYmxlID0KLQkJKHN0cnVjdCB4bG9jYWxlX2NvbGxhdGUqKV9fZ2V0X2xvY2FsZSgp LT5jb21wb25lbnRzW1hMQ19DT0xMQVRFXTsKKwlpbnQgYywgbiwgdjsKIAogCS8qIGZpcnN0 IGBjbGVhcicgdGhlIHdob2xlIHRhYmxlICovCiAJYyA9ICpmbXQrKzsJCS8qIGZpcnN0IGNo YXIgaGF0ID0+IG5lZ2F0ZWQgc2NhbnNldCAqLwpAQCAtODcxLDI5ICs4NjksMTUgQEAKIAkJ CSAqIHdlIGp1c3Qgc3RvcmVkIGluIHRoZSB0YWJsZSAoYykuCiAJCQkgKi8KIAkJCW4gPSAq Zm10OwotCQkJaWYgKG4gPT0gJ10nCi0JCQkgICAgfHwgKHRhYmxlLT5fX2NvbGxhdGVfbG9h ZF9lcnJvciA/IG4gPCBjIDoKLQkJCQlfX3djb2xsYXRlX3JhbmdlX2NtcCh0YWJsZSwgbiwg YykgPCAwCi0JCQkgICAgICAgKQotCQkJICAgKSB7CisJCQlpZiAobiA9PSAnXScgfHwgbiA8 IGMpIHsKIAkJCQljID0gJy0nOwogCQkJCWJyZWFrOwkvKiByZXN1bWUgdGhlIGZvcig7Oykg Ki8KIAkJCX0KIAkJCWZtdCsrOwotCQkJLyogZmlsbCBpbiB0aGUgcmFuZ2UgKi8KLQkJCWlm ICh0YWJsZS0+X19jb2xsYXRlX2xvYWRfZXJyb3IpIHsKLQkJCQlkbyB7Ci0JCQkJCXRhYlsr K2NdID0gdjsKLQkJCQl9IHdoaWxlIChjIDwgbik7Ci0JCQl9IGVsc2UgewotCQkJCWZvciAo aSA9IDA7IGkgPCAyNTY7IGkgKyspCi0JCQkJCWlmIChfX3djb2xsYXRlX3JhbmdlX2NtcCh0 YWJsZSwgYywgaSkgPCAwICYmCi0JCQkJCSAgICBfX3djb2xsYXRlX3JhbmdlX2NtcCh0YWJs ZSwgaSwgbikgPD0gMAotCQkJCQkgICApCi0JCQkJCQl0YWJbaV0gPSB2OwotCQkJfQorCQkJ ZG8gewkJLyogZmlsbCBpbiB0aGUgcmFuZ2UgKi8KKwkJCQl0YWJbKytjXSA9IHY7CisJCQl9 IHdoaWxlIChjIDwgbik7CiAjaWYgMQkvKiBYWFggYW5vdGhlciBkaXNndXN0aW5nIGNvbXBh dGliaWxpdHkgaGFjayAqLwotCQkJYyA9IG47CiAJCQkvKgogCQkJICogQWxhcywgdGhlIFY3 IFVuaXggc2NhbmYgYWxzbyB0cmVhdHMgZm9ybWF0cwogCQkJICogc3VjaCBhcyBbYS1jLWVd IGFzIGB0aGUgbGV0dGVycyBhIHRocm91Z2ggZScuCg== --------------D1E3F9F08EFAE110A4449F74-- From owner-svn-src-all@freebsd.org Fri Jun 10 15:03:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1DBFB71AAF; Fri, 10 Jun 2016 15:03:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3B93117C; Fri, 10 Jun 2016 15:03:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AF3JgC055614; Fri, 10 Jun 2016 15:03:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AF3JF1055613; Fri, 10 Jun 2016 15:03:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606101503.u5AF3JF1055613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Jun 2016 15:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301795 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:03:20 -0000 Author: cy Date: Fri Jun 10 15:03:18 2016 New Revision: 301795 URL: https://svnweb.freebsd.org/changeset/base/301795 Log: MFC r301295: Enable daily_ntpd_leapfile_enable by default. Otherwise an expired leapfile will be ignored and ntpd will behave as if it has no leapfile. While here, remove an extraneous blank line. Suggested by: ache Modified: stable/10/etc/defaults/periodic.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/periodic.conf ============================================================================== --- stable/10/etc/defaults/periodic.conf Fri Jun 10 14:59:11 2016 (r301794) +++ stable/10/etc/defaults/periodic.conf Fri Jun 10 15:03:18 2016 (r301795) @@ -139,9 +139,8 @@ daily_status_mail_rejects_logs=3 # How daily_status_mail_rejects_shorten="NO" # Shorten output # 480.leapfile-ntpd -daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile daily_ntpd_avoid_congestion="YES" # Avoid congesting - # leapfile sources # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status From owner-svn-src-all@freebsd.org Fri Jun 10 15:03:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 377DCB71AFE; Fri, 10 Jun 2016 15:03:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0525C1319; Fri, 10 Jun 2016 15:03:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AF3kma055667; Fri, 10 Jun 2016 15:03:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AF3k9t055666; Fri, 10 Jun 2016 15:03:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606101503.u5AF3k9t055666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Jun 2016 15:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301796 - stable/9/etc/defaults X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:03:47 -0000 Author: cy Date: Fri Jun 10 15:03:45 2016 New Revision: 301796 URL: https://svnweb.freebsd.org/changeset/base/301796 Log: MFC r301295: Enable daily_ntpd_leapfile_enable by default. Otherwise an expired leapfile will be ignored and ntpd will behave as if it has no leapfile. While here, remove an extraneous blank line. Suggested by: ache Modified: stable/9/etc/defaults/periodic.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/defaults/periodic.conf ============================================================================== --- stable/9/etc/defaults/periodic.conf Fri Jun 10 15:03:18 2016 (r301795) +++ stable/9/etc/defaults/periodic.conf Fri Jun 10 15:03:45 2016 (r301796) @@ -143,7 +143,7 @@ daily_status_named_enable="YES" daily_status_named_usedns="YES" # DNS lookups are ok # 480.leapfile-ntpd -daily_ntpd_leapfile_enable="NO" # Fetch NTP leapfile +daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile daily_ntpd_avoid_congestion="YES" # Avoid congesting # 480.status-ntpd From owner-svn-src-all@freebsd.org Fri Jun 10 15:05:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68437B71B8C; Fri, 10 Jun 2016 15:05:36 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FACC1508; Fri, 10 Jun 2016 15:05:36 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AF5Zw1055770; Fri, 10 Jun 2016 15:05:35 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AF5ZuF055769; Fri, 10 Jun 2016 15:05:35 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606101505.u5AF5ZuF055769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 10 Jun 2016 15:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301797 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:05:36 -0000 Author: lidl Date: Fri Jun 10 15:05:35 2016 New Revision: 301797 URL: https://svnweb.freebsd.org/changeset/base/301797 Log: Relnotes entries for blacklist project Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 10 15:03:45 2016 (r301796) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 10 15:05:35 2016 (r301797) @@ -608,6 +608,29 @@ OpenBSM has been updated to version 1.2 alpha 4. + The NetBSD + Project's &man.libblacklist.3; library and applications + have been ported and integrated into the system. Packet + filtering support for the &man.pf.4; packet filtering systems + has been implemented. The blacklist + system provides the blacklistd + daemon, the helper script + blacklistd-helper to make changes + to the running packet filter system and the + blacklistctl control program. + A selection of system daemons, including: + fingerd, + ftpd, + rlogind, + rshd, and + sshd have been modified to support + sending notifications to the blacklistd + daemon. + + Support for + the &man.ipfw.4; packet filter has been added to the + blacklistd-helper script. + From owner-svn-src-all@freebsd.org Fri Jun 10 15:42:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEB4B715FF; Fri, 10 Jun 2016 15:42:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 313F51814; Fri, 10 Jun 2016 15:42:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AFgHP6070263; Fri, 10 Jun 2016 15:42:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AFgHks070262; Fri, 10 Jun 2016 15:42:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101542.u5AFgHks070262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 15:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301798 - stable/10/lib/libc/tests/nss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:42:18 -0000 Author: ngie Date: Fri Jun 10 15:42:17 2016 New Revision: 301798 URL: https://svnweb.freebsd.org/changeset/base/301798 Log: MFC r299502: r299502 (by cem): nss/gethostby_test: fix broken vector iteration of gethostbyaddr h_aliases h_aliases is a NULL-terminated rather than fixed-length array. nitems() is not a valid way to determine its end; instead, check for NULL. CID: 1346578 Modified: stable/10/lib/libc/tests/nss/gethostby_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- stable/10/lib/libc/tests/nss/gethostby_test.c Fri Jun 10 15:05:35 2016 (r301797) +++ stable/10/lib/libc/tests/nss/gethostby_test.c Fri Jun 10 15:42:17 2016 (r301798) @@ -893,7 +893,7 @@ hostent_test_getnameinfo_eq(struct hoste printf("matched official hostname\n"); #endif } else { - for (i = 0; i < nitems(result->h_aliases); i++) { + for (i = 0; result->h_aliases[i] != NULL; i++) { printf("[%d] resolved: %s\n", i, result->h_aliases[i]); if (strcmp(result->h_aliases[i], From owner-svn-src-all@freebsd.org Fri Jun 10 15:47:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72918B71714; Fri, 10 Jun 2016 15:47:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 356491B0C; Fri, 10 Jun 2016 15:47:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AFlKOg070517; Fri, 10 Jun 2016 15:47:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AFlKdU070516; Fri, 10 Jun 2016 15:47:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101547.u5AFlKdU070516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 15:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301799 - stable/10/sys/dev/sound/pci/hda X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 15:47:21 -0000 Author: ngie Date: Fri Jun 10 15:47:20 2016 New Revision: 301799 URL: https://svnweb.freebsd.org/changeset/base/301799 Log: MFC r299503,r299504: r299503 (by cem): snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter None of the sysctl handlers in hdaa use the arg2 parameter, so just pass zero instead. Additionally, the sizes being passed in were suspect (size of the pointer rather than the value). CIDs: 1007694, 1009679 r299504 (by cem): snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter (again) More of the same sort of issue as r299503, just missed some sysctls added in a different place than the others. CIDs: 1007692, 1009677, 1009678 Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdaa.c Fri Jun 10 15:42:17 2016 (r301798) +++ stable/10/sys/dev/sound/pci/hda/hdaa.c Fri Jun 10 15:47:20 2016 (r301799) @@ -1553,20 +1553,20 @@ hdaa_widget_parse(struct hdaa_widget *w) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - w, sizeof(w), hdaa_sysctl_caps, "A", "Node capabilities"); + w, 0, hdaa_sysctl_caps, "A", "Node capabilities"); if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { snprintf(buf, sizeof(buf), "nid%d_config", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &w->wclass.pin.newconf, sizeof(&w->wclass.pin.newconf), - hdaa_sysctl_config, "A", "Current pin configuration"); + &w->wclass.pin.newconf, 0, hdaa_sysctl_config, "A", + "Current pin configuration"); snprintf(buf, sizeof(buf), "nid%d_original", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - &w->wclass.pin.original, sizeof(&w->wclass.pin.original), - hdaa_sysctl_config, "A", "Original pin configuration"); + &w->wclass.pin.original, 0, hdaa_sysctl_config, "A", + "Original pin configuration"); } hdaa_lock(w->devinfo); } @@ -6641,38 +6641,32 @@ hdaa_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &devinfo->newquirks, sizeof(&devinfo->newquirks), - hdaa_sysctl_quirks, "A", "Configuration options"); + &devinfo->newquirks, 0, hdaa_sysctl_quirks, "A", + "Configuration options"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpi_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpi_state, "A", "GPI state"); + devinfo, 0, hdaa_sysctl_gpi_state, "A", "GPI state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_state, "A", "GPIO state"); + devinfo, 0, hdaa_sysctl_gpio_state, "A", "GPIO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_config, "A", "GPIO configuration"); + devinfo, 0, hdaa_sysctl_gpio_config, "A", "GPIO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_state, "A", "GPO state"); + devinfo, 0, hdaa_sysctl_gpo_state, "A", "GPO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_config, "A", "GPO configuration"); + devinfo, 0, hdaa_sysctl_gpo_config, "A", "GPO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "reconfig", CTLTYPE_INT | CTLFLAG_RW, - dev, sizeof(dev), - hdaa_sysctl_reconfig, "I", "Reprocess configuration"); + dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); bus_generic_attach(dev); return (0); } From owner-svn-src-all@freebsd.org Fri Jun 10 17:53:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C3C4AD9AE7; Fri, 10 Jun 2016 17:53:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 692462746; Fri, 10 Jun 2016 17:53:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AHrSne018275; Fri, 10 Jun 2016 17:53:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AHrSBo018274; Fri, 10 Jun 2016 17:53:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101753.u5AHrSBo018274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 17:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301800 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 17:53:29 -0000 Author: ngie Date: Fri Jun 10 17:53:28 2016 New Revision: 301800 URL: https://svnweb.freebsd.org/changeset/base/301800 Log: Deobfuscate cleanup path in clnt_bck_create(..) Similar to r300836, cl and ct will always be non-NULL as they're allocated using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`. Deobfuscating the cleanup path fixes a leak where if cl was NULL and ct was not, ct would not be free'd, and also removes a duplicate test for cl not being NULL. Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6801 MFC after: 1 week Reported by: Coverity CID: 1229999 Reviewed by: cem Sponsored by: EMC / Isilon Storage Division Modified: head/sys/rpc/clnt_bck.c Modified: head/sys/rpc/clnt_bck.c ============================================================================== --- head/sys/rpc/clnt_bck.c Fri Jun 10 15:47:20 2016 (r301799) +++ head/sys/rpc/clnt_bck.c Fri Jun 10 17:53:28 2016 (r301800) @@ -175,14 +175,9 @@ clnt_bck_create( return (cl); err: - if (cl) { - if (ct) { - mtx_destroy(&ct->ct_lock); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); - } + mtx_destroy(&ct->ct_lock); + mem_free(ct, sizeof (struct ct_data)); + mem_free(cl, sizeof (CLIENT)); return (NULL); } From owner-svn-src-all@freebsd.org Fri Jun 10 17:57:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E016AD9BC6; Fri, 10 Jun 2016 17:57:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1262D290F; Fri, 10 Jun 2016 17:57:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AHvohi018521; Fri, 10 Jun 2016 17:57:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AHvoU8018520; Fri, 10 Jun 2016 17:57:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101757.u5AHvoU8018520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 17:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301801 - stable/10/sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 17:57:51 -0000 Author: ngie Date: Fri Jun 10 17:57:50 2016 New Revision: 301801 URL: https://svnweb.freebsd.org/changeset/base/301801 Log: MFC r300836: Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being non-NULL is incorrect -- it misleads Coverity and it misleads the reader. Remove some unnecessary NULL initializations as a follow up to help solidify the fact that these pointers will be initialized properly in sys/rpc/.. with the interfaces the way they are currently. CID: 1007338, 1007339, 1007340 Modified: stable/10/sys/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc_vc.c ============================================================================== --- stable/10/sys/rpc/svc_vc.c Fri Jun 10 17:53:28 2016 (r301800) +++ stable/10/sys/rpc/svc_vc.c Fri Jun 10 17:57:50 2016 (r301801) @@ -189,11 +189,11 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCKBUF_UNLOCK(&so->so_rcv); return (xprt); + cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + return (NULL); } @@ -203,8 +203,8 @@ cleanup_svc_vc_create: SVCXPRT * svc_vc_create_conn(SVCPOOL *pool, struct socket *so, struct sockaddr *raddr) { - SVCXPRT *xprt = NULL; - struct cf_conn *cd = NULL; + SVCXPRT *xprt; + struct cf_conn *cd; struct sockaddr* sa = NULL; struct sockopt opt; int one = 1; @@ -279,12 +279,10 @@ svc_vc_create_conn(SVCPOOL *pool, struct return (xprt); cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } - if (cd) - mem_free(cd, sizeof(*cd)); + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + mem_free(cd, sizeof(*cd)); + return (NULL); } From owner-svn-src-all@freebsd.org Fri Jun 10 17:59:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACA2AD9C39; Fri, 10 Jun 2016 17:59:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D69D62A93; Fri, 10 Jun 2016 17:59:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AHxVxx018639; Fri, 10 Jun 2016 17:59:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AHxVLR018638; Fri, 10 Jun 2016 17:59:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101759.u5AHxVLR018638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 17:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301802 - stable/9/sys/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 17:59:32 -0000 Author: ngie Date: Fri Jun 10 17:59:30 2016 New Revision: 301802 URL: https://svnweb.freebsd.org/changeset/base/301802 Log: MFstable/10 r301801: MFC r300836: Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprt Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being non-NULL is incorrect -- it misleads Coverity and it misleads the reader. Remove some unnecessary NULL initializations as a follow up to help solidify the fact that these pointers will be initialized properly in sys/rpc/.. with the interfaces the way they are currently. CID: 1007338, 1007339, 1007340 Modified: stable/9/sys/rpc/svc_vc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/svc_vc.c ============================================================================== --- stable/9/sys/rpc/svc_vc.c Fri Jun 10 17:57:50 2016 (r301801) +++ stable/9/sys/rpc/svc_vc.c Fri Jun 10 17:59:30 2016 (r301802) @@ -186,11 +186,11 @@ svc_vc_create(SVCPOOL *pool, struct sock SOCKBUF_UNLOCK(&so->so_rcv); return (xprt); + cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + return (NULL); } @@ -200,8 +200,8 @@ cleanup_svc_vc_create: SVCXPRT * svc_vc_create_conn(SVCPOOL *pool, struct socket *so, struct sockaddr *raddr) { - SVCXPRT *xprt = NULL; - struct cf_conn *cd = NULL; + SVCXPRT *xprt; + struct cf_conn *cd; struct sockaddr* sa = NULL; struct sockopt opt; int one = 1; @@ -274,12 +274,10 @@ svc_vc_create_conn(SVCPOOL *pool, struct return (xprt); cleanup_svc_vc_create: - if (xprt) { - sx_destroy(&xprt->xp_lock); - svc_xprt_free(xprt); - } - if (cd) - mem_free(cd, sizeof(*cd)); + sx_destroy(&xprt->xp_lock); + svc_xprt_free(xprt); + mem_free(cd, sizeof(*cd)); + return (NULL); } From owner-svn-src-all@freebsd.org Fri Jun 10 18:02:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47B56AD9E18; Fri, 10 Jun 2016 18:02:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F30112E09; Fri, 10 Jun 2016 18:02:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AI2qUl022034; Fri, 10 Jun 2016 18:02:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AI2qYm022033; Fri, 10 Jun 2016 18:02:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101802.u5AI2qYm022033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301803 - stable/10/usr.sbin/rtadvd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:02:53 -0000 Author: ngie Date: Fri Jun 10 18:02:51 2016 New Revision: 301803 URL: https://svnweb.freebsd.org/changeset/base/301803 Log: MFC r299507: r299507 (by cem): rtadvd(8): Fix a typo in full msg receive logic Check against the size of the struct, not the pointer. Previously, a message with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow and read(2) to be invoked with msglen size (implicitly cast to signed), overrunning the caller-provided buffer. All users of cm_recv() supply a stack buffer. On the other hand, the rtadvd control socket appears to only be writable by the owner, who is probably root. While here, correct some types to be size_t or ssize_t. CID: 1008477 Security: unix socket remotes may overflow stack in rtadvd Modified: stable/10/usr.sbin/rtadvd/control.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/control.c ============================================================================== --- stable/10/usr.sbin/rtadvd/control.c Fri Jun 10 17:59:30 2016 (r301802) +++ stable/10/usr.sbin/rtadvd/control.c Fri Jun 10 18:02:51 2016 (r301803) @@ -59,7 +59,7 @@ int cm_recv(int fd, char *buf) { - int n; + ssize_t n; struct ctrl_msg_hdr *cm; char *msg; struct pollfd pfds[1]; @@ -98,7 +98,7 @@ cm_recv(int fd, char *buf) } } - if (n != sizeof(*cm)) { + if (n != (ssize_t)sizeof(*cm)) { syslog(LOG_WARNING, "<%s> received a too small message.", __func__); goto cm_recv_err; @@ -123,11 +123,11 @@ cm_recv(int fd, char *buf) "<%s> ctrl msg received: type=%d", __func__, cm->cm_type); - if (cm->cm_len > sizeof(cm)) { - int msglen = cm->cm_len - sizeof(*cm); + if (cm->cm_len > sizeof(*cm)) { + size_t msglen = cm->cm_len - sizeof(*cm); syslog(LOG_DEBUG, - "<%s> ctrl msg has payload (len=%d)", __func__, + "<%s> ctrl msg has payload (len=%zu)", __func__, msglen); for (;;) { @@ -153,7 +153,7 @@ cm_recv(int fd, char *buf) } break; } - if (n != msglen) { + if (n != (ssize_t)msglen) { syslog(LOG_WARNING, "<%s> payload size mismatch.", __func__); goto cm_recv_err; From owner-svn-src-all@freebsd.org Fri Jun 10 18:04:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3270DAD9ECC; Fri, 10 Jun 2016 18:04:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDCB92F69; Fri, 10 Jun 2016 18:04:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AI4tSG022159; Fri, 10 Jun 2016 18:04:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AI4tBQ022158; Fri, 10 Jun 2016 18:04:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101804.u5AI4tBQ022158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301804 - stable/9/usr.sbin/rtadvd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:04:56 -0000 Author: ngie Date: Fri Jun 10 18:04:54 2016 New Revision: 301804 URL: https://svnweb.freebsd.org/changeset/base/301804 Log: MFstable/10 r301803: MFC r299507: r299507 (by cem): rtadvd(8): Fix a typo in full msg receive logic Check against the size of the struct, not the pointer. Previously, a message with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow and read(2) to be invoked with msglen size (implicitly cast to signed), overrunning the caller-provided buffer. All users of cm_recv() supply a stack buffer. On the other hand, the rtadvd control socket appears to only be writable by the owner, who is probably root. While here, correct some types to be size_t or ssize_t. CID: 1008477 Security: unix socket remotes may overflow stack in rtadvd Modified: stable/9/usr.sbin/rtadvd/control.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) Modified: stable/9/usr.sbin/rtadvd/control.c ============================================================================== --- stable/9/usr.sbin/rtadvd/control.c Fri Jun 10 18:02:51 2016 (r301803) +++ stable/9/usr.sbin/rtadvd/control.c Fri Jun 10 18:04:54 2016 (r301804) @@ -59,7 +59,7 @@ int cm_recv(int fd, char *buf) { - int n; + ssize_t n; struct ctrl_msg_hdr *cm; char *msg; struct pollfd pfds[1]; @@ -98,7 +98,7 @@ cm_recv(int fd, char *buf) } } - if (n != sizeof(*cm)) { + if (n != (ssize_t)sizeof(*cm)) { syslog(LOG_WARNING, "<%s> received a too small message.", __func__); goto cm_recv_err; @@ -123,11 +123,11 @@ cm_recv(int fd, char *buf) "<%s> ctrl msg received: type=%d", __func__, cm->cm_type); - if (cm->cm_len > sizeof(cm)) { - int msglen = cm->cm_len - sizeof(*cm); + if (cm->cm_len > sizeof(*cm)) { + size_t msglen = cm->cm_len - sizeof(*cm); syslog(LOG_DEBUG, - "<%s> ctrl msg has payload (len=%d)", __func__, + "<%s> ctrl msg has payload (len=%zu)", __func__, msglen); for (;;) { @@ -153,7 +153,7 @@ cm_recv(int fd, char *buf) } break; } - if (n != msglen) { + if (n != (ssize_t)msglen) { syslog(LOG_WARNING, "<%s> payload size mismatch.", __func__); goto cm_recv_err; From owner-svn-src-all@freebsd.org Fri Jun 10 18:07:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB1EAD9F5A; Fri, 10 Jun 2016 18:07:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB4D20EB; Fri, 10 Jun 2016 18:07:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AI7Z2m022316; Fri, 10 Jun 2016 18:07:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AI7ZXu022315; Fri, 10 Jun 2016 18:07:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101807.u5AI7ZXu022315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301805 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:07:36 -0000 Author: ngie Date: Fri Jun 10 18:07:35 2016 New Revision: 301805 URL: https://svnweb.freebsd.org/changeset/base/301805 Log: MFC r299508: r299508 (by cem): kern_descrip_test: Fix trivial buffer overrun with readlink(2) CID: 1229965, 1229972 Modified: stable/10/tests/sys/kern/kern_descrip_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/kern_descrip_test.c ============================================================================== --- stable/10/tests/sys/kern/kern_descrip_test.c Fri Jun 10 18:04:54 2016 (r301804) +++ stable/10/tests/sys/kern/kern_descrip_test.c Fri Jun 10 18:07:35 2016 (r301805) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -170,7 +171,7 @@ ATF_TC_CLEANUP(kern_maxfiles__increase, char buf[80]; if ((n = readlink(VALUE, buf, sizeof(buf))) > 0) { - buf[n] = '\0'; + buf[MIN((size_t)n, sizeof(buf) - 1)] = '\0'; if (sscanf(buf, "%d", &oldmaxfiles) == 1) { oldlen = sizeof(oldmaxfiles); (void) sysctlbyname("kern.maxfiles", NULL, 0, From owner-svn-src-all@freebsd.org Fri Jun 10 18:10:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EF9CADA002; Fri, 10 Jun 2016 18:10:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3E3422BB; Fri, 10 Jun 2016 18:10:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIAXwq022495; Fri, 10 Jun 2016 18:10:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIAX86022494; Fri, 10 Jun 2016 18:10:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101810.u5AIAX86022494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301806 - stable/10/lib/libmp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:10:34 -0000 Author: ngie Date: Fri Jun 10 18:10:32 2016 New Revision: 301806 URL: https://svnweb.freebsd.org/changeset/base/301806 Log: MFC r299510: r299510 (by cem): libmp: Fix trivial buffer overrun fgetln yields a non-NUL-terminated buffer and its length. This routine attempted to NUL-terminate it, but did not allocate space for the NUL. So, allocate space for the NUL. CID: 1017457 Modified: stable/10/lib/libmp/mpasbn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmp/mpasbn.c ============================================================================== --- stable/10/lib/libmp/mpasbn.c Fri Jun 10 18:07:35 2016 (r301805) +++ stable/10/lib/libmp/mpasbn.c Fri Jun 10 18:10:32 2016 (r301806) @@ -286,10 +286,10 @@ mp_min(MINT *mp) line = fgetln(stdin, &linelen); if (line == NULL) MPERR(("min")); - nline = malloc(linelen); + nline = malloc(linelen + 1); if (nline == NULL) MPERR(("min")); - strncpy(nline, line, linelen); + memcpy(nline, line, linelen); nline[linelen] = '\0'; rmp = _dtom("min", nline); _movem("min", rmp, mp); From owner-svn-src-all@freebsd.org Fri Jun 10 18:12:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA9BADA29E; Fri, 10 Jun 2016 18:12:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DA982694; Fri, 10 Jun 2016 18:12:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AICBkf025800; Fri, 10 Jun 2016 18:12:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AICB5j025799; Fri, 10 Jun 2016 18:12:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101812.u5AICB5j025799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301807 - stable/9/lib/libmp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:12:12 -0000 Author: ngie Date: Fri Jun 10 18:12:11 2016 New Revision: 301807 URL: https://svnweb.freebsd.org/changeset/base/301807 Log: MFstable/10 r301806: MFC r299510: r299510 (by cem): libmp: Fix trivial buffer overrun fgetln yields a non-NUL-terminated buffer and its length. This routine attempted to NUL-terminate it, but did not allocate space for the NUL. So, allocate space for the NUL. CID: 1017457 Modified: stable/9/lib/libmp/mpasbn.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) Modified: stable/9/lib/libmp/mpasbn.c ============================================================================== --- stable/9/lib/libmp/mpasbn.c Fri Jun 10 18:10:32 2016 (r301806) +++ stable/9/lib/libmp/mpasbn.c Fri Jun 10 18:12:11 2016 (r301807) @@ -286,10 +286,10 @@ mp_min(MINT *mp) line = fgetln(stdin, &linelen); if (line == NULL) MPERR(("min")); - nline = malloc(linelen); + nline = malloc(linelen + 1); if (nline == NULL) MPERR(("min")); - strncpy(nline, line, linelen); + memcpy(nline, line, linelen); nline[linelen] = '\0'; rmp = _dtom("min", nline); _movem("min", rmp, mp); From owner-svn-src-all@freebsd.org Fri Jun 10 18:13:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16041ADA312; Fri, 10 Jun 2016 18:13:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA1C928EB; Fri, 10 Jun 2016 18:13:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIDgff025914; Fri, 10 Jun 2016 18:13:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIDgWw025913; Fri, 10 Jun 2016 18:13:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101813.u5AIDgWw025913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301808 - stable/10/lib/libc/tests/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:13:43 -0000 Author: ngie Date: Fri Jun 10 18:13:41 2016 New Revision: 301808 URL: https://svnweb.freebsd.org/changeset/base/301808 Log: MFC r299511: r299511 (by cem): print_positional_test: Fix misuse of wchar APIs These APIs take unit length, not byte length parameters. CIDs: 1338543, 1338544, 1338545 Modified: stable/10/lib/libc/tests/stdio/print_positional_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/stdio/print_positional_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/print_positional_test.c Fri Jun 10 18:12:11 2016 (r301807) +++ stable/10/lib/libc/tests/stdio/print_positional_test.c Fri Jun 10 18:13:41 2016 (r301808) @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -94,7 +95,7 @@ ATF_TC_WITHOUT_HEAD(positional_wide); ATF_TC_BODY(positional_wide, tc) { - swprintf(wbuf1, sizeof wbuf1, + swprintf(wbuf1, nitems(wbuf1), L"|xx %1$s %2$s %3$s %4$s\n" "|xx %5$s %6$s %7$s %8$s\n" "|xx %9$s %10$s %11$s %12$s\n" @@ -117,7 +118,7 @@ ATF_TC_BODY(positional_wide, tc) "43", "44", 45, -1L, 1LL, -1, 1LL ); temp = correct; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } @@ -139,7 +140,7 @@ ATF_TC_BODY(positional_precision_wide, t swprintf(wbuf1, sizeof buf, L"%2$.*4$s %2$.*3$s %1$s", "BSD", "bsd", 2, 1); temp = correct2; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } From owner-svn-src-all@freebsd.org Fri Jun 10 18:21:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CFDDADA434; Fri, 10 Jun 2016 18:21:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 169BC2B73; Fri, 10 Jun 2016 18:21:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIL6h1026272; Fri, 10 Jun 2016 18:21:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIL6bX026270; Fri, 10 Jun 2016 18:21:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101821.u5AIL6bX026270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301809 - stable/10/usr.sbin/rtadvd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:21:07 -0000 Author: ngie Date: Fri Jun 10 18:21:05 2016 New Revision: 301809 URL: https://svnweb.freebsd.org/changeset/base/301809 Log: MFC r299513,r299515: r299513 (by cem): rtadvd(8): Don't use-after-free This whole block of code as committed fully formed in r224144. I'm not really sure what the intent was, but it seems plausible that !persist ifis could need other member cleanup. Don't free the object until after we've finished cleaning its members. CID: 1006079 r299515 (by cem): rtadvd(8): Fix use-after-close in cm_handler_client cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. CID: 1006078 Modified: stable/10/usr.sbin/rtadvd/config.c stable/10/usr.sbin/rtadvd/control_client.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtadvd/config.c ============================================================================== --- stable/10/usr.sbin/rtadvd/config.c Fri Jun 10 18:13:41 2016 (r301808) +++ stable/10/usr.sbin/rtadvd/config.c Fri Jun 10 18:21:05 2016 (r301809) @@ -229,7 +229,6 @@ rm_ifinfo(struct ifinfo *ifi) TAILQ_REMOVE(&ifilist, ifi, ifi_next); syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", __func__, ifi->ifi_ifindex); - free(ifi); } else { /* recreate an empty entry */ update_persist_ifinfo(&ifilist, ifi->ifi_ifname); @@ -273,6 +272,8 @@ rm_ifinfo(struct ifinfo *ifi) } syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); + if (!ifi->ifi_persist) + free(ifi); return (0); } Modified: stable/10/usr.sbin/rtadvd/control_client.c ============================================================================== --- stable/10/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:13:41 2016 (r301808) +++ stable/10/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:21:05 2016 (r301809) @@ -92,9 +92,11 @@ cm_handler_client(int fd, int state, cha case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; error = cm_send(fd, buf); - if (error) + if (error) { syslog(LOG_WARNING, "<%s> cm_send()", __func__); + return (-1); + } state = CM_STATE_ACK_WAIT; break; case CM_STATE_ACK_WAIT: From owner-svn-src-all@freebsd.org Fri Jun 10 18:22:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D27D5ADA605; Fri, 10 Jun 2016 18:22:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87E092E58; Fri, 10 Jun 2016 18:22:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIMLHS029126; Fri, 10 Jun 2016 18:22:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIMLhp029124; Fri, 10 Jun 2016 18:22:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101822.u5AIMLhp029124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301810 - stable/9/usr.sbin/rtadvd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:22:22 -0000 Author: ngie Date: Fri Jun 10 18:22:21 2016 New Revision: 301810 URL: https://svnweb.freebsd.org/changeset/base/301810 Log: MFstable/10 r301809: MFC r299513,r299515: r299513 (by cem): rtadvd(8): Don't use-after-free This whole block of code as committed fully formed in r224144. I'm not really sure what the intent was, but it seems plausible that !persist ifis could need other member cleanup. Don't free the object until after we've finished cleaning its members. CID: 1006079 r299515 (by cem): rtadvd(8): Fix use-after-close in cm_handler_client cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. CID: 1006078 Modified: stable/9/usr.sbin/rtadvd/config.c stable/9/usr.sbin/rtadvd/control_client.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) Modified: stable/9/usr.sbin/rtadvd/config.c ============================================================================== --- stable/9/usr.sbin/rtadvd/config.c Fri Jun 10 18:21:05 2016 (r301809) +++ stable/9/usr.sbin/rtadvd/config.c Fri Jun 10 18:22:21 2016 (r301810) @@ -229,7 +229,6 @@ rm_ifinfo(struct ifinfo *ifi) TAILQ_REMOVE(&ifilist, ifi, ifi_next); syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", __func__, ifi->ifi_ifindex); - free(ifi); } else { /* recreate an empty entry */ update_persist_ifinfo(&ifilist, ifi->ifi_ifname); @@ -273,6 +272,8 @@ rm_ifinfo(struct ifinfo *ifi) } syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); + if (!ifi->ifi_persist) + free(ifi); return (0); } Modified: stable/9/usr.sbin/rtadvd/control_client.c ============================================================================== --- stable/9/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:21:05 2016 (r301809) +++ stable/9/usr.sbin/rtadvd/control_client.c Fri Jun 10 18:22:21 2016 (r301810) @@ -92,9 +92,11 @@ cm_handler_client(int fd, int state, cha case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; error = cm_send(fd, buf); - if (error) + if (error) { syslog(LOG_WARNING, "<%s> cm_send()", __func__); + return (-1); + } state = CM_STATE_ACK_WAIT; break; case CM_STATE_ACK_WAIT: From owner-svn-src-all@freebsd.org Fri Jun 10 18:34:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4969ADA943; Fri, 10 Jun 2016 18:34:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A89542586; Fri, 10 Jun 2016 18:34:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIYVJK033954; Fri, 10 Jun 2016 18:34:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIYVDm033950; Fri, 10 Jun 2016 18:34:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101834.u5AIYVDm033950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301811 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:34:33 -0000 Author: ngie Date: Fri Jun 10 18:34:31 2016 New Revision: 301811 URL: https://svnweb.freebsd.org/changeset/base/301811 Log: MFC r295618,r300100,r300531: r295618 (by cem): NTB: workaround for high traffic hardware hang This patch comes from Dave Jiang's Linux tree, davejiang/ntb. It hasn't been accepted into Linus' tree, so I do not have an authoritative SHA1 to point at. Original commit log: ===================================================================== A hardware errata causes the NTB to hang when heavy bi-directional traffic in addition to the usage of BAR0/1 (where the registers reside, including the doorbell registers to trigger interrupts). This workaround is only available on Haswell and Broadwell platform. The workaround is to enable split BAR in the BIOS to allow the 64bit BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed to LAPIC region of the remote host. We will bypass the db mechanism and directly trigger the MSIX interrupts. The offsets and vectors are exchanged during transport scratch pad negotiation. The scratch pads are now overloaded in order to allow the exchange of the information. This gets around using the doorbell and prevents the lockup with additional pcode changes in BIOS. Signed-off-by: Dave Jiang ===================================================================== Notable changes in the FreeBSD version of this patch: * The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx). The Linux version of the patch only uses BAR4. * MSIX negotiation aborts if the link goes down. Obtained from: Linux (Dual BSD/GPL driver) r300100 (by cem): ntb_hw(4): Add sysctls for administrative/test link config, state dev.ntb_hw.0.admin_up=0/1: Like ifconfig UP/DOWN. dev.ntb_hw.0.active=0/1: Like ifconfig 'status' r300531 (by cem): ntb_hw(4): Only record the first three MSIX vectors Don't overrun the msix_data array by reading the (unused) link state interrupt information. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 10 18:22:21 2016 (r301810) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Fri Jun 10 18:34:31 2016 (r301811) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -42,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +73,19 @@ __FBSDID("$FreeBSD$"); #define DEVICE2SOFTC(dev) ((struct ntb_softc *) device_get_softc(dev)) +#define NTB_MSIX_VER_GUARD 0xaabbccdd +#define NTB_MSIX_RECEIVED 0xe0f0e0f0 +#define ONE_MB (1024u * 1024) + +/* + * PCI constants could be somewhere more generic, but aren't defined/used in + * pci.c. + */ +#define PCI_MSIX_ENTRY_SIZE 16 +#define PCI_MSIX_ENTRY_LOWER_ADDR 0 +#define PCI_MSIX_ENTRY_UPPER_ADDR 4 +#define PCI_MSIX_ENTRY_DATA 8 + enum ntb_device_type { NTB_XEON, NTB_ATOM @@ -95,6 +111,18 @@ enum ntb_bar { NTB_MAX_BARS }; +enum { + NTB_MSIX_GUARD = 0, + NTB_MSIX_DATA0, + NTB_MSIX_DATA1, + NTB_MSIX_DATA2, + NTB_MSIX_OFS0, + NTB_MSIX_OFS1, + NTB_MSIX_OFS2, + NTB_MSIX_DONE, + NTB_MAX_MSIX_SPAD +}; + /* Device features and workarounds */ #define HAS_FEATURE(feature) \ ((ntb->features & (feature)) != 0) @@ -131,6 +159,7 @@ struct ntb_int_info { struct ntb_vec { struct ntb_softc *ntb; uint32_t num; + unsigned masked; }; struct ntb_reg { @@ -169,6 +198,11 @@ struct ntb_b2b_addr { uint64_t bar5_addr32; }; +struct ntb_msix_data { + uint32_t nmd_ofs; + uint32_t nmd_data; +}; + struct ntb_softc { device_t device; enum ntb_device_type type; @@ -178,6 +212,13 @@ struct ntb_softc { struct ntb_int_info int_info[MAX_MSIX_INTERRUPTS]; uint32_t allocated_interrupts; + struct ntb_msix_data peer_msix_data[XEON_NONLINK_DB_MSIX_BITS]; + struct ntb_msix_data msix_data[XEON_NONLINK_DB_MSIX_BITS]; + bool peer_msix_good; + bool peer_msix_done; + struct ntb_pci_bar_info *peer_lapic_bar; + struct callout peer_msix_work; + struct callout heartbeat_timer; struct callout lr_timer; @@ -198,6 +239,7 @@ struct ntb_softc { /* Memory window used to access peer bar0 */ #define B2B_MW_DISABLED UINT8_MAX uint8_t b2b_mw_idx; + uint8_t msix_mw_idx; uint8_t mw_count; uint8_t spad_count; @@ -292,6 +334,8 @@ static inline void db_iowrite(struct ntb static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); static void ntb_free_msix_vec(struct ntb_softc *ntb); +static void ntb_get_msix_info(struct ntb_softc *ntb); +static void ntb_exchange_msix(void *); static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); static void ntb_detect_max_mw(struct ntb_softc *ntb); static int ntb_detect_xeon(struct ntb_softc *ntb); @@ -308,7 +352,9 @@ static void xeon_set_pbar_xlat(struct nt enum ntb_bar idx); static int xeon_setup_b2b_mw(struct ntb_softc *, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr); +static int xeon_setup_msix_bar(struct ntb_softc *); static inline bool link_is_up(struct ntb_softc *ntb); +static inline bool _xeon_link_is_up(struct ntb_softc *ntb); static inline bool atom_link_is_err(struct ntb_softc *ntb); static inline enum ntb_speed ntb_link_sta_speed(struct ntb_softc *); static inline enum ntb_width ntb_link_sta_width(struct ntb_softc *); @@ -319,6 +365,8 @@ static bool ntb_poll_link(struct ntb_sof static void save_bar_parameters(struct ntb_pci_bar_info *bar); static void ntb_sysctl_init(struct ntb_softc *); static int sysctl_handle_features(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS); static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS); static int sysctl_handle_register(SYSCTL_HANDLER_ARGS); @@ -397,6 +445,13 @@ ntb_vm_memattr_to_str(vm_memattr_t pat) } } +static int g_ntb_msix_idx = 0; +SYSCTL_INT(_hw_ntb, OID_AUTO, msix_mw_idx, CTLFLAG_RDTUN, &g_ntb_msix_idx, + 0, "Use this memory window to access the peer MSIX message complex on " + "certain Xeon-based NTB systems, as a workaround for a hardware errata. " + "Like b2b_mw_idx, negative values index from the last available memory " + "window. (Applies on Xeon platforms with SB01BASE_LOCKUP errata.)"); + static int g_ntb_mw_idx = -1; TUNABLE_INT("hw.ntb.b2b_mw_idx", &g_ntb_mw_idx); SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTUN, &g_ntb_mw_idx, @@ -604,10 +659,12 @@ ntb_attach(device_t device) ntb->type = p->type; ntb->features = p->features; ntb->b2b_mw_idx = B2B_MW_DISABLED; + ntb->msix_mw_idx = B2B_MW_DISABLED; /* Heartbeat timer for NTB_ATOM since there is no link interrupt */ callout_init(&ntb->heartbeat_timer, CALLOUT_MPSAFE); callout_init(&ntb->lr_timer, CALLOUT_MPSAFE); + callout_init(&ntb->peer_msix_work, 1); mtx_init(&ntb->db_mask_lock, "ntb hw bits", NULL, MTX_SPIN); mtx_init(&ntb->ctx_lock, "ntb ctx", NULL, MTX_DEF); @@ -632,6 +689,8 @@ ntb_attach(device_t device) if (error != 0) goto out; + ntb_spad_clear(ntb); + ntb_poll_link(ntb); ntb_sysctl_init(ntb); @@ -649,10 +708,14 @@ ntb_detach(device_t device) ntb = DEVICE2SOFTC(device); - if (ntb->self_reg != NULL) - ntb_db_set_mask(ntb, ntb->db_valid_mask); + if (ntb->self_reg != NULL) { + DB_MASK_LOCK(ntb); + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_valid_mask); + DB_MASK_UNLOCK(ntb); + } callout_drain(&ntb->heartbeat_timer); callout_drain(&ntb->lr_timer); + callout_drain(&ntb->peer_msix_work); pci_disable_busmaster(ntb->device); if (ntb->type == NTB_XEON) ntb_teardown_xeon(ntb); @@ -978,9 +1041,12 @@ ntb_init_isr(struct ntb_softc *ntb) ntb->last_ts = ticks; /* - * Mask all doorbell interrupts. + * Mask all doorbell interrupts. (Except link events!) */ - ntb_db_set_mask(ntb, ntb->db_valid_mask); + DB_MASK_LOCK(ntb); + ntb->db_mask = ntb->db_valid_mask; + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + DB_MASK_UNLOCK(ntb); num_vectors = desired_vectors = MIN(pci_msix_count(ntb->device), ntb->db_count); @@ -1005,12 +1071,28 @@ ntb_init_isr(struct ntb_softc *ntb) num_vectors = 1; if (ntb->type == NTB_XEON && num_vectors < ntb->db_vec_count) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + device_printf(ntb->device, + "Errata workaround does not support MSI or INTX\n"); + return (EINVAL); + } + ntb->db_vec_count = 1; ntb->db_vec_shift = XEON_DB_TOTAL_SHIFT; rc = ntb_setup_legacy_interrupt(ntb); } else { + if (num_vectors - 1 != XEON_NONLINK_DB_MSIX_BITS && + HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + device_printf(ntb->device, + "Errata workaround expects %d doorbell bits\n", + XEON_NONLINK_DB_MSIX_BITS); + return (EINVAL); + } + ntb_create_msix_vec(ntb, num_vectors); rc = ntb_setup_msix(ntb, num_vectors); + if (rc == 0 && HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + ntb_get_msix_info(ntb); } if (rc != 0) { device_printf(ntb->device, @@ -1116,6 +1198,9 @@ void ntb_db_set_mask(struct ntb_softc *ntb, uint64_t bits) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return; + DB_MASK_LOCK(ntb); ntb->db_mask |= bits; db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); @@ -1131,6 +1216,9 @@ ntb_db_clear_mask(struct ntb_softc *ntb, (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return; + DB_MASK_LOCK(ntb); ntb->db_mask &= ~bits; db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); @@ -1141,6 +1229,18 @@ uint64_t ntb_db_read(struct ntb_softc *ntb) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + uint64_t res; + unsigned i; + + res = 0; + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if (ntb->msix_vec[i].masked != 0) + res |= ntb_db_vector_mask(ntb, i); + } + return (res); + } + return (db_ioread(ntb, ntb->self_reg->db_bell)); } @@ -1153,6 +1253,25 @@ ntb_db_clear(struct ntb_softc *ntb, uint (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + unsigned i; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((bits & ntb_db_vector_mask(ntb, i)) != 0) { + DB_MASK_LOCK(ntb); + if (ntb->msix_vec[i].masked != 0) { + /* XXX These need a public API. */ +#if 0 + pci_unmask_msix(ntb->device, i); +#endif + ntb->msix_vec[i].masked = 0; + } + DB_MASK_UNLOCK(ntb); + } + } + return; + } + db_iowrite(ntb, ntb->self_reg->db_bell, bits); } @@ -1179,6 +1298,19 @@ ntb_interrupt(struct ntb_softc *ntb, uin ntb_link_event(ntb); } + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + (vec_mask & ntb->db_link_mask) == 0) { + DB_MASK_LOCK(ntb); + if (ntb->msix_vec[vec].masked == 0) { + /* XXX These need a public API. */ +#if 0 + pci_mask_msix(ntb->device, vec); +#endif + ntb->msix_vec[vec].masked = 1; + } + DB_MASK_UNLOCK(ntb); + } + if ((vec_mask & ntb->db_valid_mask) != 0) ntb_db_event(ntb, vec); } @@ -1224,6 +1356,40 @@ ntb_free_msix_vec(struct ntb_softc *ntb) ntb->msix_vec = NULL; } +static void +ntb_get_msix_info(struct ntb_softc *ntb) +{ + struct pci_devinfo *dinfo; + struct pcicfg_msix *msix; + uint32_t laddr, data, i, offset; + + dinfo = device_get_ivars(ntb->device); + msix = &dinfo->cfg.msix; + + laddr = data = 0; + + CTASSERT(XEON_NONLINK_DB_MSIX_BITS == nitems(ntb->msix_data)); + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + offset = msix->msix_table_offset + i * PCI_MSIX_ENTRY_SIZE; + + laddr = bus_read_4(msix->msix_table_res, offset + + PCI_MSIX_ENTRY_LOWER_ADDR); + ntb_printf(2, "local lower MSIX addr(%u): 0x%x\n", i, laddr); + + KASSERT((laddr & MSI_INTEL_ADDR_BASE) == MSI_INTEL_ADDR_BASE, + ("local MSIX addr 0x%x not in MSI base 0x%x", laddr, + MSI_INTEL_ADDR_BASE)); + ntb->msix_data[i].nmd_ofs = laddr & ~MSI_INTEL_ADDR_BASE; + + data = bus_read_4(msix->msix_table_res, offset + + PCI_MSIX_ENTRY_DATA); + ntb_printf(2, "local MSIX data(%u): 0x%x\n", i, data); + + ntb->msix_data[i].nmd_data = data; + } +} + static struct ntb_hw_info * ntb_get_device_info(uint32_t device_id) { @@ -1276,9 +1442,12 @@ ntb_detect_xeon(struct ntb_softc *ntb) if ((ppd & XEON_PPD_SPLIT_BAR) != 0) ntb->features |= NTB_SPLIT_BAR; - /* SB01BASE_LOCKUP errata is a superset of SDOORBELL errata */ + /* + * SDOORBELL errata workaround gets in the way of SB01BASE_LOCKUP + * errata workaround; only do one at a time. + */ if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) - ntb->features |= NTB_SDOORBELL_LOCKUP; + ntb->features &= ~NTB_SDOORBELL_LOCKUP; conn_type = ppd & XEON_PPD_CONN_TYPE; switch (conn_type) { @@ -1342,19 +1511,28 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) ntb->peer_reg = &xeon_b2b_reg; ntb->xlat_reg = &xeon_sec_xlat; - /* - * There is a Xeon hardware errata related to writes to SDOORBELL or - * B2BDOORBELL in conjunction with inbound access to NTB MMIO space, - * which may hang the system. To workaround this, use a memory - * window to access the interrupt and scratch pad registers on the - * remote system. - */ - if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + ntb->msix_mw_idx = (ntb->mw_count + g_ntb_msix_idx) % + ntb->mw_count; + ntb_printf(2, "Setting up MSIX mw idx %d means %u\n", + g_ntb_msix_idx, ntb->msix_mw_idx); + rc = ntb_mw_set_wc_internal(ntb, ntb->msix_mw_idx, + VM_MEMATTR_UNCACHEABLE); + KASSERT(rc == 0, ("shouldn't fail")); + } else if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { + /* + * There is a Xeon hardware errata related to writes to SDOORBELL or + * B2BDOORBELL in conjunction with inbound access to NTB MMIO space, + * which may hang the system. To workaround this, use a memory + * window to access the interrupt and scratch pad registers on the + * remote system. + */ ntb->b2b_mw_idx = (ntb->mw_count + g_ntb_mw_idx) % ntb->mw_count; ntb_printf(2, "Setting up b2b mw idx %d means %u\n", g_ntb_mw_idx, ntb->b2b_mw_idx); - rc = ntb_mw_set_wc_internal(ntb, ntb->b2b_mw_idx, VM_MEMATTR_UNCACHEABLE); + rc = ntb_mw_set_wc_internal(ntb, ntb->b2b_mw_idx, + VM_MEMATTR_UNCACHEABLE); KASSERT(rc == 0, ("shouldn't fail")); } else if (HAS_FEATURE(NTB_B2BDOORBELL_BIT14)) /* @@ -1385,7 +1563,14 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) /* * Mask all doorbell interrupts. */ - ntb_db_set_mask(ntb, ntb->db_valid_mask); + DB_MASK_LOCK(ntb); + ntb->db_mask = ntb->db_valid_mask; + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + DB_MASK_UNLOCK(ntb); + + rc = xeon_setup_msix_bar(ntb); + if (rc != 0) + return (rc); rc = ntb_init_isr(ntb); return (rc); @@ -1489,6 +1674,15 @@ xeon_reset_sbar_size(struct ntb_softc *n bar_sz--; else bar_sz = 0; + } else if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) { + /* Restrict LAPIC BAR to 1MB */ + pci_write_config(ntb->device, bar->psz_off, 20, 1); + pci_write_config(ntb->device, bar->ssz_off, 20, 1); + bar_sz = pci_read_config(ntb->device, bar->psz_off, 1); + bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); + (void)bar_sz; + return; } pci_write_config(ntb->device, bar->ssz_off, bar_sz, 1); bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); @@ -1499,28 +1693,37 @@ static void xeon_set_sbar_base_and_limit(struct ntb_softc *ntb, uint64_t bar_addr, enum ntb_bar idx, enum ntb_bar regbar) { - uint64_t reg_val; + uint64_t reg_val, lmt_addr; uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); if (idx == regbar) bar_addr += ntb->b2b_off; + lmt_addr = bar_addr; + + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && + ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) + lmt_addr += ONE_MB; + /* + * Set limit registers first to avoid an errata where setting the base + * registers locks the limit registers. + */ if (!bar_is_64bit(ntb, idx)) { - ntb_reg_write(4, base_reg, bar_addr); - reg_val = ntb_reg_read(4, base_reg); + ntb_reg_write(4, lmt_reg, lmt_addr); + reg_val = ntb_reg_read(4, lmt_reg); (void)reg_val; - ntb_reg_write(4, lmt_reg, bar_addr); - reg_val = ntb_reg_read(4, lmt_reg); + ntb_reg_write(4, base_reg, bar_addr); + reg_val = ntb_reg_read(4, base_reg); (void)reg_val; } else { - ntb_reg_write(8, base_reg, bar_addr); - reg_val = ntb_reg_read(8, base_reg); + ntb_reg_write(8, lmt_reg, lmt_addr); + reg_val = ntb_reg_read(8, lmt_reg); (void)reg_val; - ntb_reg_write(8, lmt_reg, bar_addr); - reg_val = ntb_reg_read(8, lmt_reg); + ntb_reg_write(8, base_reg, bar_addr); + reg_val = ntb_reg_read(8, base_reg); (void)reg_val; } } @@ -1542,6 +1745,37 @@ xeon_set_pbar_xlat(struct ntb_softc *ntb } static int +xeon_setup_msix_bar(struct ntb_softc *ntb) +{ + struct ntb_pci_bar_info *lapic_bar; + enum ntb_bar bar_num; + int rc; + + if (!HAS_FEATURE(NTB_SB01BASE_LOCKUP)) + return (0); + + bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); + lapic_bar = &ntb->bar_info[bar_num]; + + /* Restrict LAPIC BAR to 1MB */ + if (lapic_bar->size > ONE_MB) { + rc = bus_adjust_resource(ntb->device, SYS_RES_MEMORY, + lapic_bar->pci_resource, lapic_bar->pbase, + lapic_bar->pbase + ONE_MB - 1); + if (rc == 0) + lapic_bar->size = ONE_MB; + else { + ntb_printf(0, "Failed to shrink LAPIC BAR resource to " + "1 MB: %d\n", rc); + /* Ignore error */ + } + } + + ntb->peer_lapic_bar = lapic_bar; + return (0); +} + +static int xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr) { @@ -1619,6 +1853,43 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, ntb_reg_write(8, XEON_SBAR2XLAT_OFFSET, 0); ntb_reg_write(8, XEON_SBAR4XLAT_OFFSET, 0); + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + size_t size, xlatoffset; + + switch (ntb_mw_to_bar(ntb, ntb->msix_mw_idx)) { + case NTB_B2B_BAR_1: + size = 8; + xlatoffset = XEON_SBAR2XLAT_OFFSET; + break; + case NTB_B2B_BAR_2: + xlatoffset = XEON_SBAR4XLAT_OFFSET; + if (HAS_FEATURE(NTB_SPLIT_BAR)) + size = 4; + else + size = 8; + break; + case NTB_B2B_BAR_3: + xlatoffset = XEON_SBAR5XLAT_OFFSET; + size = 4; + break; + default: + KASSERT(false, ("Bogus msix mw idx: %u", + ntb->msix_mw_idx)); + return (EINVAL); + } + + /* + * We point the chosen MSIX MW BAR xlat to remote LAPIC for + * workaround + */ + if (size == 4) + ntb_reg_write(4, xlatoffset, MSI_INTEL_ADDR_BASE); + else + ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); + } + (void)ntb_reg_read(8, XEON_SBAR2XLAT_OFFSET); + (void)ntb_reg_read(8, XEON_SBAR4XLAT_OFFSET); + /* Zero outgoing translation limits (whole bar size windows) */ ntb_reg_write(8, XEON_PBAR2LMT_OFFSET, 0); ntb_reg_write(8, XEON_PBAR4LMT_OFFSET, 0); @@ -1656,14 +1927,21 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, } static inline bool +_xeon_link_is_up(struct ntb_softc *ntb) +{ + + if (ntb->conn_type == NTB_CONN_TRANSPARENT) + return (true); + return ((ntb->lnk_sta & NTB_LINK_STATUS_ACTIVE) != 0); +} + +static inline bool link_is_up(struct ntb_softc *ntb) { - if (ntb->type == NTB_XEON) { - if (ntb->conn_type == NTB_CONN_TRANSPARENT) - return (true); - return ((ntb->lnk_sta & NTB_LINK_STATUS_ACTIVE) != 0); - } + if (ntb->type == NTB_XEON) + return (_xeon_link_is_up(ntb) && (ntb->peer_msix_good || + !HAS_FEATURE(NTB_SB01BASE_LOCKUP))); KASSERT(ntb->type == NTB_ATOM, ("ntb type")); return ((ntb->ntb_ctl & ATOM_CNTL_LINK_DOWN) == 0); @@ -1881,6 +2159,8 @@ ntb_link_enable(struct ntb_softc *ntb, e { uint32_t cntl; + ntb_printf(2, "%s\n", __func__); + if (ntb->type == NTB_ATOM) { pci_write_config(ntb->device, NTB_PPD_OFFSET, ntb->ppd | ATOM_PPD_INIT_LINK, 4); @@ -1919,6 +2199,8 @@ ntb_link_disable(struct ntb_softc *ntb) { uint32_t cntl; + ntb_printf(2, "%s\n", __func__); + if (ntb->conn_type == NTB_CONN_TRANSPARENT) { ntb_link_event(ntb); return (0); @@ -1934,6 +2216,23 @@ ntb_link_disable(struct ntb_softc *ntb) return (0); } +bool +ntb_link_enabled(struct ntb_softc *ntb) +{ + uint32_t cntl; + + if (ntb->type == NTB_ATOM) { + cntl = pci_read_config(ntb->device, NTB_PPD_OFFSET, 4); + return ((cntl & ATOM_PPD_INIT_LINK) != 0); + } + + if (ntb->conn_type == NTB_CONN_TRANSPARENT) + return (true); + + cntl = ntb_reg_read(4, ntb->reg->ntb_ctl); + return ((cntl & NTB_CNTL_LINK_DISABLE) == 0); +} + static void recover_atom_link(void *arg) { @@ -2002,6 +2301,19 @@ ntb_poll_link(struct ntb_softc *ntb) return (false); ntb->lnk_sta = reg_val; + + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + if (_xeon_link_is_up(ntb)) { + if (!ntb->peer_msix_good) { + callout_reset(&ntb->peer_msix_work, 0, + ntb_exchange_msix, ntb); + return (false); + } + } else { + ntb->peer_msix_good = false; + ntb->peer_msix_done = false; + } + } } return (true); } @@ -2040,16 +2352,26 @@ SYSCTL_NODE(_hw_ntb, OID_AUTO, debug_inf static void ntb_sysctl_init(struct ntb_softc *ntb) { - struct sysctl_oid_list *tree_par, *regpar, *statpar, *errpar; + struct sysctl_oid_list *globals, *tree_par, *regpar, *statpar, *errpar; struct sysctl_ctx_list *ctx; struct sysctl_oid *tree, *tmptree; ctx = device_get_sysctl_ctx(ntb->device); + globals = SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)); + + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "link_status", + CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, + sysctl_handle_link_status_human, "A", + "Link status (human readable)"); + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "active", + CTLFLAG_RD | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_status, + "IU", "Link status (1=active, 0=inactive)"); + SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "admin_up", + CTLFLAG_RW | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_admin, + "IU", "Set/get interface status (1=UP, 0=DOWN)"); - tree = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)), OID_AUTO, - "debug_info", CTLFLAG_RD, NULL, - "Driver state, statistics, and HW registers"); + tree = SYSCTL_ADD_NODE(ctx, globals, OID_AUTO, "debug_info", + CTLFLAG_RD, NULL, "Driver state, statistics, and HW registers"); tree_par = SYSCTL_CHILDREN(tree); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "conn_type", CTLFLAG_RD, @@ -2081,10 +2403,6 @@ ntb_sysctl_init(struct ntb_softc *ntb) __DEVOLATILE(uint32_t *, &ntb->lnk_sta), 0, "LNK STA register (cached)"); - SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "link_status", - CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_link_status, - "A", "Link status"); - #ifdef notyet SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "mw_count", CTLFLAG_RD, &ntb->mw_count, 0, "MW count"); @@ -2332,7 +2650,37 @@ sysctl_handle_features(SYSCTL_HANDLER_AR } static int -sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) +sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS) +{ + struct ntb_softc *ntb; + unsigned old, new; + int error; + + error = 0; + ntb = arg1; + + old = ntb_link_enabled(ntb); + + error = SYSCTL_OUT(req, &old, sizeof(old)); + if (error != 0 || req->newptr == NULL) + return (error); + + error = SYSCTL_IN(req, &new, sizeof(new)); + if (error != 0) + return (error); + + ntb_printf(0, "Admin set interface state to '%sabled'\n", + (new != 0)? "en" : "dis"); + + if (new != 0) + error = ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); + else + error = ntb_link_disable(ntb); + return (error); +} + +static int +sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS) { struct ntb_softc *ntb; struct sbuf sb; @@ -2360,6 +2708,24 @@ sysctl_handle_link_status(SYSCTL_HANDLER } static int +sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) +{ + struct ntb_softc *ntb; + unsigned res; + int error; + + error = 0; + ntb = arg1; + + res = ntb_link_is_up(ntb, NULL, NULL); + + error = SYSCTL_OUT(req, &res, sizeof(res)); + if (error || !req->newptr) + return (error); + return (EINVAL); +} + +static int sysctl_handle_register(SYSCTL_HANDLER_ARGS) { struct ntb_softc *ntb; @@ -2434,12 +2800,70 @@ static unsigned ntb_user_mw_to_idx(struct ntb_softc *ntb, unsigned uidx) { - if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && - uidx >= ntb->b2b_mw_idx) - return (uidx + 1); + if ((ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && + uidx >= ntb->b2b_mw_idx) || + (ntb->msix_mw_idx != B2B_MW_DISABLED && uidx >= ntb->msix_mw_idx)) + uidx++; + if ((ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 && + uidx >= ntb->b2b_mw_idx) && + (ntb->msix_mw_idx != B2B_MW_DISABLED && uidx >= ntb->msix_mw_idx)) + uidx++; return (uidx); } +static void +ntb_exchange_msix(void *ctx) +{ + struct ntb_softc *ntb; + uint32_t val; + unsigned i; + + ntb = ctx; + + if (ntb->peer_msix_done) + goto msix_done; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + ntb_peer_spad_write(ntb, NTB_MSIX_DATA0 + i, + ntb->msix_data[i].nmd_data); + ntb_peer_spad_write(ntb, NTB_MSIX_OFS0 + i, + ntb->msix_data[i].nmd_ofs); + } + ntb_peer_spad_write(ntb, NTB_MSIX_GUARD, NTB_MSIX_VER_GUARD); + + ntb_spad_read(ntb, NTB_MSIX_GUARD, &val); + if (val != NTB_MSIX_VER_GUARD) + goto reschedule; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + ntb_spad_read(ntb, NTB_MSIX_DATA0 + i, &val); + ntb->peer_msix_data[i].nmd_data = val; + ntb_spad_read(ntb, NTB_MSIX_OFS0 + i, &val); + ntb->peer_msix_data[i].nmd_ofs = val; + } + + ntb->peer_msix_done = true; + +msix_done: + ntb_peer_spad_write(ntb, NTB_MSIX_DONE, NTB_MSIX_RECEIVED); + ntb_spad_read(ntb, NTB_MSIX_DONE, &val); + if (val != NTB_MSIX_RECEIVED) + goto reschedule; + + ntb->peer_msix_good = true; + + ntb_poll_link(ntb); + ntb_link_event(ntb); + return; + +reschedule: + ntb->lnk_sta = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); + if (_xeon_link_is_up(ntb)) + callout_reset(&ntb->peer_msix_work, hz / 100, ntb_exchange_msix, ntb); + else + ntb_spad_clear(ntb); +} + /* * Public API to the rest of the OS */ @@ -2469,10 +2893,14 @@ ntb_get_max_spads(struct ntb_softc *ntb) uint8_t ntb_mw_count(struct ntb_softc *ntb) { + uint8_t res; + res = ntb->mw_count; if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0) - return (ntb->mw_count - 1); - return (ntb->mw_count); + res--; + if (ntb->msix_mw_idx != B2B_MW_DISABLED) + res--; + return (res); } /** @@ -2498,6 +2926,18 @@ ntb_spad_write(struct ntb_softc *ntb, un return (0); } +/* + * Zeros the local scratchpad. + */ +void +ntb_spad_clear(struct ntb_softc *ntb) +{ + unsigned i; + + for (i = 0; i < ntb->spad_count; i++) + ntb_spad_write(ntb, i, 0); +} + /** * ntb_spad_read() - read from the primary scratchpad register * @ntb: pointer to ntb_softc instance @@ -2826,6 +3266,22 @@ void ntb_peer_db_set(struct ntb_softc *ntb, uint64_t bit) { + if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) { + struct ntb_pci_bar_info *lapic; + unsigned i; + + lapic = ntb->peer_lapic_bar; + + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((bit & ntb_db_vector_mask(ntb, i)) != 0) + bus_space_write_4(lapic->pci_bus_tag, + lapic->pci_bus_handle, + ntb->peer_msix_data[i].nmd_ofs, + ntb->peer_msix_data[i].nmd_data); + } + return; + } + if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) { ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bit); return; Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h Fri Jun 10 18:22:21 2016 (r301810) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h Fri Jun 10 18:34:31 2016 (r301811) @@ -70,6 +70,7 @@ bool ntb_link_is_up(struct ntb_softc *, void ntb_link_event(struct ntb_softc *); int ntb_link_enable(struct ntb_softc *, enum ntb_speed, enum ntb_width); int ntb_link_disable(struct ntb_softc *); +bool ntb_link_enabled(struct ntb_softc *); int ntb_set_ctx(struct ntb_softc *, void *, const struct ntb_ctx_ops *); void *ntb_get_ctx(struct ntb_softc *, const struct ntb_ctx_ops **); @@ -86,6 +87,7 @@ int ntb_mw_get_wc(struct ntb_softc *, un int ntb_mw_set_wc(struct ntb_softc *, unsigned mw_idx, vm_memattr_t mode); uint8_t ntb_get_max_spads(struct ntb_softc *ntb); +void ntb_spad_clear(struct ntb_softc *ntb); int ntb_spad_write(struct ntb_softc *ntb, unsigned int idx, uint32_t val); int ntb_spad_read(struct ntb_softc *ntb, unsigned int idx, uint32_t *val); int ntb_peer_spad_write(struct ntb_softc *ntb, unsigned int idx, Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Fri Jun 10 18:22:21 2016 (r301810) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h Fri Jun 10 18:34:31 2016 (r301811) @@ -44,6 +44,7 @@ #define XEON_DB_MSIX_VECTOR_COUNT 4 #define XEON_DB_MSIX_VECTOR_SHIFT 5 #define XEON_DB_LINK_BIT (1 << XEON_DB_LINK) +#define XEON_NONLINK_DB_MSIX_BITS 3 #define XEON_SPCICMD_OFFSET 0x0504 #define XEON_DEVCTRL_OFFSET 0x0598 From owner-svn-src-all@freebsd.org Fri Jun 10 18:40:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2BC6ADAA65; Fri, 10 Jun 2016 18:40:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4AB52779; Fri, 10 Jun 2016 18:40:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIe3O2034273; Fri, 10 Jun 2016 18:40:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIe3ph034270; Fri, 10 Jun 2016 18:40:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101840.u5AIe3ph034270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301812 - stable/10/sys/dev/ioat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:40:05 -0000 Author: ngie Date: Fri Jun 10 18:40:03 2016 New Revision: 301812 URL: https://svnweb.freebsd.org/changeset/base/301812 Log: MFC r301296,r301297,r301300: r301296 (by cem): ioat(4): Make channel indices unsigned r301297 (by cem): ioat(4): Export the number of available channels r301300 (by cem): ioat(4): Always log capabilities on attach Different, relatively recent Intel Xeon hardware support radically different features. E.g., BDX support CRC32 while BDX-DE does not. Modified: stable/10/sys/dev/ioat/ioat.c stable/10/sys/dev/ioat/ioat.h stable/10/sys/dev/ioat/ioat_internal.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ioat/ioat.c ============================================================================== --- stable/10/sys/dev/ioat/ioat.c Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat.c Fri Jun 10 18:40:03 2016 (r301812) @@ -152,8 +152,8 @@ MODULE_VERSION(ioat, 1); * Private data structures */ static struct ioat_softc *ioat_channel[IOAT_MAX_CHANNELS]; -static int ioat_channel_index = 0; -SYSCTL_INT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, +static unsigned ioat_channel_index = 0; +SYSCTL_UINT(_hw_ioat, OID_AUTO, channels, CTLFLAG_RD, &ioat_channel_index, 0, "Number of IOAT channels attached"); static struct _pcsid @@ -407,7 +407,7 @@ ioat3_attach(device_t device) ioat = DEVICE2SOFTC(device); ioat->capabilities = ioat_read_dmacapability(ioat); - ioat_log_message(1, "Capabilities: %b\n", (int)ioat->capabilities, + ioat_log_message(0, "Capabilities: %b\n", (int)ioat->capabilities, IOAT_DMACAP_STR); xfercap = ioat_read_xfercap(ioat); @@ -742,6 +742,13 @@ ioat_reset_hw_task(void *ctx, int pendin /* * User API functions */ +unsigned +ioat_get_nchannels(void) +{ + + return (ioat_channel_index); +} + bus_dmaengine_t ioat_get_dmaengine(uint32_t index, int flags) { Modified: stable/10/sys/dev/ioat/ioat.h ============================================================================== --- stable/10/sys/dev/ioat/ioat.h Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat.h Fri Jun 10 18:40:03 2016 (r301812) @@ -85,6 +85,8 @@ typedef void *bus_dmaengine_t; struct bus_dmadesc; typedef void (*bus_dmaengine_callback_t)(void *arg, int error); +unsigned ioat_get_nchannels(void); + /* * Called first to acquire a reference to the DMA channel * Modified: stable/10/sys/dev/ioat/ioat_internal.h ============================================================================== --- stable/10/sys/dev/ioat/ioat_internal.h Fri Jun 10 18:34:31 2016 (r301811) +++ stable/10/sys/dev/ioat/ioat_internal.h Fri Jun 10 18:40:03 2016 (r301812) @@ -455,7 +455,7 @@ struct ioat_softc { }) int version; - int chan_idx; + unsigned chan_idx; struct mtx submit_lock; device_t device; From owner-svn-src-all@freebsd.org Fri Jun 10 18:47:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F977ADABF8; Fri, 10 Jun 2016 18:47:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CDD52B24; Fri, 10 Jun 2016 18:47:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AIlBgq037765; Fri, 10 Jun 2016 18:47:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AIlB21037764; Fri, 10 Jun 2016 18:47:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606101847.u5AIlB21037764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 10 Jun 2016 18:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301813 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 18:47:12 -0000 Author: ngie Date: Fri Jun 10 18:47:11 2016 New Revision: 301813 URL: https://svnweb.freebsd.org/changeset/base/301813 Log: Record mergeinfo for all complete commits done in the ioat(4) merge in r300661 This will make it easier for someone to determine what's missing when running `svn mergeinfo --show-revs eligible` r299353 wasn't recorded intentionally because it was only a "partial" merge Sponsored by: EMC / Isilon Storage Division Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Fri Jun 10 19:06:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDFCFAD9286; Fri, 10 Jun 2016 19:06:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A11FC26EC; Fri, 10 Jun 2016 19:06:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AJ6B8e045420; Fri, 10 Jun 2016 19:06:11 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AJ6BVE045417; Fri, 10 Jun 2016 19:06:11 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201606101906.u5AJ6BVE045417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 10 Jun 2016 19:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301814 - in head/sys: conf modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 19:06:13 -0000 Author: jtl Date: Fri Jun 10 19:06:11 2016 New Revision: 301814 URL: https://svnweb.freebsd.org/changeset/base/301814 Log: Change the default build behavior so we don't compile extra TCP modules by default. At least initially, the feature to support multiple TCP stacks is aimed at supporting advanced use cases and TCP development, but it is not necessarily aimed at a wide audience. Therefore, there is no need to build and install the extra TCP stacks by default. Instead, the people who are using or developing this functionality can add the extra option to build/ install the extra TCP stacks. However, we do want to build the extra TCP stacks as part of test builds (e.g. LINT or tinderbox) to ensure that developers who are testing their changes will know that their changes do not break the additional TCP stack modules. After this change, a user will need to add WITH_EXTRA_TCP_STACKS=1 to make.conf or the kernel config in order to build the extra TCP modules. Differential Revision: https://reviews.freebsd.org/D6795 Reviewed by: sjg Approved by: re (kib) Modified: head/sys/conf/kern.opts.mk head/sys/conf/kern.post.mk head/sys/modules/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri Jun 10 18:47:11 2016 (r301813) +++ head/sys/conf/kern.opts.mk Fri Jun 10 19:06:11 2016 (r301814) @@ -45,6 +45,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EISA \ + EXTRA_TCP_STACKS \ NAND \ OFED Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri Jun 10 18:47:11 2016 (r301813) +++ head/sys/conf/kern.post.mk Fri Jun 10 19:06:11 2016 (r301814) @@ -23,6 +23,10 @@ MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAG MKMODULESENV+= WITH_CTF="${WITH_CTF}" .endif +.if defined(WITH_EXTRA_TCP_STACKS) +MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP_STACKS}" +.endif + # Allow overriding the kernel debug directory, so kernel and user debug may be # installed in different directories. Setting it to "" restores the historical # behavior of installing debug files in the kernel directory. Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Jun 10 18:47:11 2016 (r301813) +++ head/sys/modules/Makefile Fri Jun 10 19:06:11 2016 (r301814) @@ -353,7 +353,7 @@ SUBDIR= \ ${_syscons} \ sysvipc \ ${_ti} \ - tcp/fastpath \ + ${_tcp_fastpath} \ tests/framework \ tests/callout_test \ tl \ @@ -436,6 +436,10 @@ _random_other= random_other SUBDIR+= cuse .endif +.if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES) +_tcp_fastpath= tcp/fastpath +.endif + .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _carp= carp From owner-svn-src-all@freebsd.org Fri Jun 10 19:17:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 100A1AD9695; Fri, 10 Jun 2016 19:17:09 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8A312CB5; Fri, 10 Jun 2016 19:17:08 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-io0-x230.google.com with SMTP id n127so73891205iof.3; Fri, 10 Jun 2016 12:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wfr6LAdQIWZhFIGutY1TTd84meVz98gzHoQHjXYB4Dw=; b=U+ThT8L1yK/J/Zf54M7zPnUGPPG3m9WLVl6RxL6KRv4ZEuzhysJJ031LdAgQ46c03d ep+ay8NaJgt2tQh503EOHxRkonqq1sRcKUTcoFkyXzc9Dz/5hbrGrHW2NIvMtzRh9l2e GBEpWAT4/dPuQm3Wlp95XHSieBQ5EV8cnb9mxsDSqznT0T0L9ZlRPdfKnPf4KFX03xKO ohyW/4E+m913jJsqTLwAg8C7cuHw7Oy+K6O/j7bn/6K8qOBI3glKNj8UQ1bDgKIfZVbH iqL7RWO3lNP5zu4AkUYEjCNHqeMH1fwsW4ZstmLfC+cY0LTdpVFHhPPQ7p721WYDfQOU Amew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=wfr6LAdQIWZhFIGutY1TTd84meVz98gzHoQHjXYB4Dw=; b=fIaIhmrLJ86nGWJ4SrZ4dMR/GG1eY+lTLZdcCMwpZ7YP9tQYpLohSnrl1z/lN7hSLk YDPwqWreJlWtZQfDyp++tIosm8OYB5SKQ+Xoy9+d630DRl6/XgTQUx6F99vcwT2SSGfJ DMgVLLtxw8dUolt79bcpeI7cwC6+stF8ugkCLNYNgoUeAyfmTiCri1M9rOiAKovMtC5C XKUZg32yRbOzhzr+9phQ2Lb+2+fzQf79EBSYOCEca0YDPPTaT9PDBip2jQIUHAYYKSso amUT23AskMIRRz7p3RRnpsWY2QBtcO1ZSHWhSHtVp9LnzFGfHzD3+FNZjJat1D7vGZbY JyIQ== X-Gm-Message-State: ALyK8tK/OoojYriudu9TXZ4vLF0SUxiNUFicB7lWUTZGg1oGAkcdmM/ov08xoKdY04XsIA== X-Received: by 10.107.200.138 with SMTP id y132mr6370711iof.187.1465586228147; Fri, 10 Jun 2016 12:17:08 -0700 (PDT) Received: from jarvis ([137.122.64.8]) by smtp.gmail.com with ESMTPSA id e65sm6173867ioa.42.2016.06.10.12.17.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jun 2016 12:17:07 -0700 (PDT) Sender: Mariusz Zaborski Date: Fri, 10 Jun 2016 21:17:45 +0200 From: Mariusz Zaborski To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl Message-ID: <20160610191745.GA18133@jarvis> References: <201606080203.u5823rbD075793@repo.freebsd.org> <20160610144728.GA85730@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline In-Reply-To: <20160610144728.GA85730@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 19:17:09 -0000 --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 10, 2016 at 04:47:28PM +0200, Jilles Tjoelker wrote: > On Wed, Jun 08, 2016 at 02:03:53AM +0000, Mariusz Zaborski wrote: > > Author: oshogbo > > Date: Wed Jun 8 02:03:53 2016 > > New Revision: 301572 > > URL: https://svnweb.freebsd.org/changeset/base/301572 >=20 > > Log: > > Add flags to the Casper services. >=20 > > CASPER_SERVICE_STDIO - Casper will not close the first three descript= ors (stdin, > > stdout and stderr) this can be helpful for debugging. > > CASPER_SERVICE_FD - Capser will not close all other descriptors, this= can > > be useful for a filesystem service. >=20 > This reminds me that there are some common cases where it is wrong to > close descriptors you don't know about. The non-POSIX command > diff <(cmd1) <(cmd2) > that compares the outputs of the two commands, when executed with bash > that was compiled with the full /dev/fd visible (as in poudriere), will > actually run something like > diff /dev/fd/63 /dev/fd/62 > passing two file descriptors to pipes. >=20 > When created by a shell, these pathnames will start with /dev/fd/, but > people could create symlinks to these special files. This is why the CASPER_SERVICE_FD was added. :) > > [snip] > > +static void > > +stdnull(void) > > +{ > > + int fd; > > + > > + fd =3D open(_PATH_DEVNULL, O_RDWR); > > + if (fd =3D=3D -1) > > + errx(1, "Unable to open %s", _PATH_DEVNULL); > > + > > + if (setsid() =3D=3D -1) > > + errx(1, "Unable to detach from session"); >=20 > There is an implicit assumption here that stdnull() is only called from > a process that was forked off from here, since setsid() will not and > cannot work when called from a process that is already a session leader. >=20 > If the application is running from a shell, this setsid() will exclude > the process from most signals, including terminal ^C/^\/^Z, kill % and > hangups. More generally, this might make it more likely for the process > to hang around indefinitely after the parent is gone. I'm not sure but if the process descriptor not solve that? If we close all process descriptor to the process it should die then, so you need to kill just the process which is using service. > > + > > + if (dup2(fd, STDIN_FILENO) =3D=3D -1) > > + errx(1, "Unable to cover stdin"); > > + if (dup2(fd, STDOUT_FILENO) =3D=3D -1) > > + errx(1, "Unable to cover stdout"); > > + if (dup2(fd, STDERR_FILENO) =3D=3D -1) > > + errx(1, "Unable to cover stderr"); > > + > > + close(fd); >=20 > This was not broken by this commit, but fd should not be closed if it is > equal to STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO. Yes you are in 100% right. Thanks, I will fix that. Thanks, --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 --CE+1k2dSO48ffgeK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXWxJVAAoJEN/ChBrixsVkC70QALCuuSYjjvOoNrNrAUszSvFV Fs565nImHWLQItVN1nndrMTTxaHG6RsYW+i/Md1xan0Pcn2o31MqqjhjLDBPy2+6 VwWVdN4YfBIox+rGRQ7S2e626ygkjRnYJVQwshHSjsZWVpCxp99YJC0wskF5Ykeu 7ioGatI2JSSLRkzKsQ+nAHeKGNgL4/hvLKCcGG8CcoAyIfUEOJ7SrB0WrtrJsxDo viPh8lQuDUI/kMiD4x7VjJ91keAtsFutmLz4SEZPQZe9K6IwmNi5i1WDfrMPan/Y XqeA15zrylKc4rzGQTfcL0TA/EtmvSwEWWE/cxOpgyyeg1shIXNEjNG90qQ6XdEB 7C1YvoSK/+YRpzyZSYzBwxq57SyOFtorFDpy5Otyg0C593fBexqvzyjeYIZhoIqR BXS6s7lfPgNxpN691dK9c9/XCgdvCMNr7HDAT/+1a2RAdO3KmBaWfAqPG1QA5a1C cc+q/dEwkS5Er7xJasDmMlO7M61QyrQFcLpOYFXxwimoiYv6ZLkP8uu2nRqUYlWz HZ5JCfSQc9OWmxfewghR2Acw+ZtntbgseFAa76qra9TzLv5HCQOaO6qUvn7WNedB 0JtBcLbyI+Ad+02muKkoo5oMHR8s6KR0K0FFnkzPjfrrxDRfmT/C4fAve4hXZHte 304DL9cyFUSmscTJQnrR =jY8w -----END PGP SIGNATURE----- --CE+1k2dSO48ffgeK-- From owner-svn-src-all@freebsd.org Fri Jun 10 19:29:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F0BBAD9D5E; Fri, 10 Jun 2016 19:29:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11E5F2586; Fri, 10 Jun 2016 19:29:55 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AJTttO052671; Fri, 10 Jun 2016 19:29:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AJTtLQ052670; Fri, 10 Jun 2016 19:29:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606101929.u5AJTtLQ052670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 10 Jun 2016 19:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301815 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 19:29:56 -0000 Author: gjb Date: Fri Jun 10 19:29:55 2016 New Revision: 301815 URL: https://svnweb.freebsd.org/changeset/base/301815 Log: Update 11.0 to ALPHA3 in preparation for new snapshot builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jun 10 19:06:11 2016 (r301814) +++ head/sys/conf/newvers.sh Fri Jun 10 19:29:55 2016 (r301815) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="ALPHA2" +BRANCH="ALPHA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jun 10 21:46:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF235AEF601; Fri, 10 Jun 2016 21:46:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AA15A2C7C; Fri, 10 Jun 2016 21:46:03 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 6BC85358C5A; Fri, 10 Jun 2016 23:46:00 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 4AAEC28494; Fri, 10 Jun 2016 23:46:00 +0200 (CEST) Date: Fri, 10 Jun 2016 23:46:00 +0200 From: Jilles Tjoelker To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl Message-ID: <20160610214600.GA87900@stack.nl> References: <201606080203.u5823rbD075793@repo.freebsd.org> <20160610144728.GA85730@stack.nl> <20160610191745.GA18133@jarvis> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160610191745.GA18133@jarvis> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 21:46:04 -0000 On Fri, Jun 10, 2016 at 09:17:45PM +0200, Mariusz Zaborski wrote: > On Fri, Jun 10, 2016 at 04:47:28PM +0200, Jilles Tjoelker wrote: > > On Wed, Jun 08, 2016 at 02:03:53AM +0000, Mariusz Zaborski wrote: > > > + if (setsid() == -1) > > > + errx(1, "Unable to detach from session"); > > There is an implicit assumption here that stdnull() is only called from > > a process that was forked off from here, since setsid() will not and > > cannot work when called from a process that is already a session leader. > > If the application is running from a shell, this setsid() will exclude > > the process from most signals, including terminal ^C/^\/^Z, kill % and > > hangups. More generally, this might make it more likely for the process > > to hang around indefinitely after the parent is gone. > I'm not sure but if the process descriptor not solve that? > If we close all process descriptor to the process it should die then, so you > need to kill just the process which is using service. Oh, right. For termination this is probably even better since terminating properly may require casper daemons, and for stopping it probably doesn't matter much. For opening files in utilities called from an interactive shell it is probably still bad since it breaks /dev/tty and obscures blocking opens such as fifos. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Fri Jun 10 21:47:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15862AEF677; Fri, 10 Jun 2016 21:47:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D98AF2DFF; Fri, 10 Jun 2016 21:47:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ALlcWu004799; Fri, 10 Jun 2016 21:47:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ALlcaZ004798; Fri, 10 Jun 2016 21:47:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606102147.u5ALlcaZ004798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 10 Jun 2016 21:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301816 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 21:47:39 -0000 Author: pfg Date: Fri Jun 10 21:47:37 2016 New Revision: 301816 URL: https://svnweb.freebsd.org/changeset/base/301816 Log: MFC r300333: gas: Implement the .inst assembler directive for arm. We normally use the binutils from ports but on other systems this is required for building gcc 4.9. Obtained from: OpenBSD (CVS rev. 1.5) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-arm.c Fri Jun 10 19:29:55 2016 (r301815) +++ stable/10/contrib/binutils/gas/config/tc-arm.c Fri Jun 10 21:47:37 2016 (r301816) @@ -2284,6 +2284,37 @@ s_unreq (int a ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +static void +s_inst(int unused ATTRIBUTE_UNUSED) +{ + expressionS exp; + + if (thumb_mode) { + as_bad(".inst not implemented for Thumb mode"); + ignore_rest_of_line(); + return; + } + + if (is_it_end_of_statement()) { + demand_empty_rest_of_line(); + return; + } + + do { + expression(&exp); + + if (exp.X_op != O_constant) + as_bad("constant expression required"); + else + emit_expr(&exp, 4); + + } while (*input_line_pointer++ == ','); + + /* Put terminator back into stream. */ + input_line_pointer--; + demand_empty_rest_of_line(); +} + /* Directives: Instruction set selection. */ #ifdef OBJ_ELF @@ -3895,6 +3926,7 @@ const pseudo_typeS md_pseudo_table[] = { "object_arch", s_arm_object_arch, 0 }, { "fpu", s_arm_fpu, 0 }, { "arch_extension", s_arm_arch_extension, 0 }, + { "inst", s_inst, 0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, From owner-svn-src-all@freebsd.org Fri Jun 10 22:07:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18DA2AEF8D7; Fri, 10 Jun 2016 22:07:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C44F62517; Fri, 10 Jun 2016 22:07:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5AM7IEC012124; Fri, 10 Jun 2016 22:07:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5AM7HBI012123; Fri, 10 Jun 2016 22:07:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606102207.u5AM7HBI012123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 10 Jun 2016 22:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301817 - stable/10/contrib/gcc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 22:07:19 -0000 Author: pfg Date: Fri Jun 10 22:07:17 2016 New Revision: 301817 URL: https://svnweb.freebsd.org/changeset/base/301817 Log: MFC r300301, r300319: GCC: Add support for named initializers for anonymous structs/unions. This is a C11 feature that is starting to get used in places such as Mesa. This implementation takes a different approach to upstream and is therefore not covered by GPLv3. Obtained from: OpenBSD (CVS rev. 1.2) Modified: stable/10/contrib/gcc/c-typeck.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/c-typeck.c ============================================================================== --- stable/10/contrib/gcc/c-typeck.c Fri Jun 10 21:47:37 2016 (r301816) +++ stable/10/contrib/gcc/c-typeck.c Fri Jun 10 22:07:17 2016 (r301817) @@ -6041,6 +6041,7 @@ set_init_index (tree first, tree last) void set_init_label (tree fieldname) { + tree anon = NULL_TREE; tree tail; if (set_designator (0)) @@ -6058,19 +6059,39 @@ set_init_label (tree fieldname) for (tail = TYPE_FIELDS (constructor_type); tail; tail = TREE_CHAIN (tail)) { + if (DECL_NAME (tail) == NULL_TREE + && (TREE_CODE (TREE_TYPE (tail)) == RECORD_TYPE + || TREE_CODE (TREE_TYPE (tail)) == UNION_TYPE)) + { + anon = lookup_field (tail, fieldname); + if (anon) + break; + } + if (DECL_NAME (tail) == fieldname) break; } if (tail == 0) error ("unknown field %qE specified in initializer", fieldname); - else + + while (tail) { constructor_fields = tail; designator_depth++; designator_erroneous = 0; if (constructor_range_stack) push_range_stack (NULL_TREE); + + if (anon) + { + if (set_designator (0)) + return; + tail = TREE_VALUE(anon); + anon = TREE_CHAIN(anon); + } + else + tail = NULL_TREE; } } From owner-svn-src-all@freebsd.org Sat Jun 11 01:34:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD059AD9BDE; Sat, 11 Jun 2016 01:34:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6FD28FA; Sat, 11 Jun 2016 01:34:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B1Yf8U089055; Sat, 11 Jun 2016 01:34:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B1YfxD089054; Sat, 11 Jun 2016 01:34:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606110134.u5B1YfxD089054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 01:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301818 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 01:34:42 -0000 Author: ngie Date: Sat Jun 11 01:34:41 2016 New Revision: 301818 URL: https://svnweb.freebsd.org/changeset/base/301818 Log: MFC r301683: Fix typo with description for $ipv6_cpe_wanif (upstram -> upstream) PR: 210146 Modified: stable/10/etc/defaults/rc.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Fri Jun 10 22:07:17 2016 (r301817) +++ stable/10/etc/defaults/rc.conf Sat Jun 11 01:34:41 2016 (r301818) @@ -485,7 +485,7 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:0000:0000:0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. -ipv6_cpe_wanif="NO" # Set to the upstram interface name if this +ipv6_cpe_wanif="NO" # Set to the upstream interface name if this # node will work as a router to forward IPv6 # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs From owner-svn-src-all@freebsd.org Sat Jun 11 01:35:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C17AD9C6B; Sat, 11 Jun 2016 01:35:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 494322A60; Sat, 11 Jun 2016 01:35:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B1ZYFu089173; Sat, 11 Jun 2016 01:35:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B1ZYRG089172; Sat, 11 Jun 2016 01:35:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606110135.u5B1ZYRG089172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 01:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301819 - stable/9/etc/defaults X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 01:35:35 -0000 Author: ngie Date: Sat Jun 11 01:35:34 2016 New Revision: 301819 URL: https://svnweb.freebsd.org/changeset/base/301819 Log: MFstable/10 r301818: MFC r301683: Fix typo with description for $ipv6_cpe_wanif (upstram -> upstream) PR: 210146 Modified: stable/9/etc/defaults/rc.conf Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Sat Jun 11 01:34:41 2016 (r301818) +++ stable/9/etc/defaults/rc.conf Sat Jun 11 01:35:34 2016 (r301819) @@ -483,7 +483,7 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:0000:0000:0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. -ipv6_cpe_wanif="NO" # Set to the upstram interface name if this +ipv6_cpe_wanif="NO" # Set to the upstream interface name if this # node will work as a router to forward IPv6 # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs From owner-svn-src-all@freebsd.org Sat Jun 11 01:38:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E1FAD9DAE; Sat, 11 Jun 2016 01:38:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DEE02C41; Sat, 11 Jun 2016 01:38:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B1bx5k089320; Sat, 11 Jun 2016 01:37:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B1bxYx089319; Sat, 11 Jun 2016 01:37:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606110137.u5B1bxYx089319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 01:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301820 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 01:38:00 -0000 Author: ngie Date: Sat Jun 11 01:37:59 2016 New Revision: 301820 URL: https://svnweb.freebsd.org/changeset/base/301820 Log: MFC r301704: Test for strchr(3) returning NULL, not 0 Modified: stable/10/lib/libc/rpc/getnetpath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getnetpath.c ============================================================================== --- stable/10/lib/libc/rpc/getnetpath.c Sat Jun 11 01:35:34 2016 (r301819) +++ stable/10/lib/libc/rpc/getnetpath.c Sat Jun 11 01:37:59 2016 (r301820) @@ -264,7 +264,7 @@ int token; /* char to parse string for *cp++ = '\0'; /* null-terminate token */ /* get rid of any backslash escapes */ ep = npp; - while ((np = strchr(ep, '\\')) != 0) { + while ((np = strchr(ep, '\\')) != NULL) { if (np[1] == '\\') np++; strcpy(np, (ep = &np[1])); /* XXX: overlapping string copy */ From owner-svn-src-all@freebsd.org Sat Jun 11 01:44:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75FB3AD9F8B; Sat, 11 Jun 2016 01:44:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 480FD2F96; Sat, 11 Jun 2016 01:44:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B1iRtM092787; Sat, 11 Jun 2016 01:44:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B1iRIQ092786; Sat, 11 Jun 2016 01:44:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606110144.u5B1iRIQ092786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 01:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301821 - stable/9/lib/libc/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 01:44:28 -0000 Author: ngie Date: Sat Jun 11 01:44:27 2016 New Revision: 301821 URL: https://svnweb.freebsd.org/changeset/base/301821 Log: MFstable/10 r301820: MFC r301704: Test for strchr(3) returning NULL, not 0 Modified: stable/9/lib/libc/rpc/getnetpath.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/rpc/getnetpath.c ============================================================================== --- stable/9/lib/libc/rpc/getnetpath.c Sat Jun 11 01:37:59 2016 (r301820) +++ stable/9/lib/libc/rpc/getnetpath.c Sat Jun 11 01:44:27 2016 (r301821) @@ -265,7 +265,7 @@ int token; /* char to parse string for *cp++ = '\0'; /* null-terminate token */ /* get rid of any backslash escapes */ ep = npp; - while ((np = strchr(ep, '\\')) != 0) { + while ((np = strchr(ep, '\\')) != NULL) { if (np[1] == '\\') np++; strcpy(np, (ep = &np[1])); /* XXX: overlapping string copy */ From owner-svn-src-all@freebsd.org Sat Jun 11 03:59:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D2C0AEF4C4; Sat, 11 Jun 2016 03:59:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3022B7B; Sat, 11 Jun 2016 03:58:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B3wxM0041258; Sat, 11 Jun 2016 03:58:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B3wxtF041257; Sat, 11 Jun 2016 03:58:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606110358.u5B3wxtF041257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 11 Jun 2016 03:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301822 - stable/10/gnu/lib/libsupc++ X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 03:59:00 -0000 Author: pfg Date: Sat Jun 11 03:58:59 2016 New Revision: 301822 URL: https://svnweb.freebsd.org/changeset/base/301822 Log: MFC r301570: libsupc++: Fix typo in symbol map. This went mostly unnoticed with the deprecation of the GNU toolchain in tier 1 platforms. Fix it now for the rest. PR: 169901 Modified: stable/10/gnu/lib/libsupc++/Version.map Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/lib/libsupc++/Version.map ============================================================================== --- stable/10/gnu/lib/libsupc++/Version.map Sat Jun 11 01:44:27 2016 (r301821) +++ stable/10/gnu/lib/libsupc++/Version.map Sat Jun 11 03:58:59 2016 (r301822) @@ -132,7 +132,7 @@ CXXABI_1.3 { GLIBCXX_3.4 { # operator new and new[] - _Znai[jm]; + _Zna[jm]; _Zna[jm]RKSt9nothrow_t; _Znw[jm]; _Znw[jm]RKSt9nothrow_t; From owner-svn-src-all@freebsd.org Sat Jun 11 03:59:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9AF3AEF56F; Sat, 11 Jun 2016 03:59:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6FEB2CD1; Sat, 11 Jun 2016 03:59:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B3xicr041341; Sat, 11 Jun 2016 03:59:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B3xiL2041340; Sat, 11 Jun 2016 03:59:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606110359.u5B3xiL2041340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 11 Jun 2016 03:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301823 - stable/9/gnu/lib/libsupc++ X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 03:59:46 -0000 Author: pfg Date: Sat Jun 11 03:59:44 2016 New Revision: 301823 URL: https://svnweb.freebsd.org/changeset/base/301823 Log: MFC r301570: libsupc++: Fix typo in symbol map. This went mostly unnoticed with the deprecation of the GNU toolchain in tier 1 platforms. Fix it now for the rest. PR: 169901 Modified: stable/9/gnu/lib/libsupc++/Version.map Directory Properties: stable/9/gnu/lib/libsupc++/ (props changed) Modified: stable/9/gnu/lib/libsupc++/Version.map ============================================================================== --- stable/9/gnu/lib/libsupc++/Version.map Sat Jun 11 03:58:59 2016 (r301822) +++ stable/9/gnu/lib/libsupc++/Version.map Sat Jun 11 03:59:44 2016 (r301823) @@ -132,7 +132,7 @@ CXXABI_1.3 { GLIBCXX_3.4 { # operator new and new[] - _Znai[jm]; + _Zna[jm]; _Zna[jm]RKSt9nothrow_t; _Znw[jm]; _Znw[jm]RKSt9nothrow_t; From owner-svn-src-all@freebsd.org Sat Jun 11 05:53:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECB79AEF812; Sat, 11 Jun 2016 05:53:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD77025BB; Sat, 11 Jun 2016 05:53:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B5roqB085042; Sat, 11 Jun 2016 05:53:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B5rolj085041; Sat, 11 Jun 2016 05:53:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201606110553.u5B5rolj085041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 Jun 2016 05:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301824 - stable/10/release/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 05:53:52 -0000 Author: delphij Date: Sat Jun 11 05:53:50 2016 New Revision: 301824 URL: https://svnweb.freebsd.org/changeset/base/301824 Log: MFC r301584: Apply mergemaster r255428: Pass -n (do not emit comments) when saving mtree information for future mergemaster(8) runs. Modified: stable/10/release/scripts/mm-mtree.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/scripts/mm-mtree.sh ============================================================================== --- stable/10/release/scripts/mm-mtree.sh Sat Jun 11 03:59:44 2016 (r301823) +++ stable/10/release/scripts/mm-mtree.sh Sat Jun 11 05:53:50 2016 (r301824) @@ -147,7 +147,7 @@ find -d ${TEMPROOT} -type d -empty -dele # Build the mtree database in a temporary location. MTREENEW=`mktemp -t mergemaster.mtree` -mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null +mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" From owner-svn-src-all@freebsd.org Sat Jun 11 05:58:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9395BAEF8AA; Sat, 11 Jun 2016 05:58:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59DF02733; Sat, 11 Jun 2016 05:58:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B5wpIK085269; Sat, 11 Jun 2016 05:58:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B5wpCb085268; Sat, 11 Jun 2016 05:58:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201606110558.u5B5wpCb085268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 Jun 2016 05:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301825 - stable/9/release/scripts X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 05:58:52 -0000 Author: delphij Date: Sat Jun 11 05:58:51 2016 New Revision: 301825 URL: https://svnweb.freebsd.org/changeset/base/301825 Log: MFC r301584: Apply mergemaster r255428: Pass -n (do not emit comments) when saving mtree information for future mergemaster(8) runs. Modified: stable/9/release/scripts/mm-mtree.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/scripts/mm-mtree.sh ============================================================================== --- stable/9/release/scripts/mm-mtree.sh Sat Jun 11 05:53:50 2016 (r301824) +++ stable/9/release/scripts/mm-mtree.sh Sat Jun 11 05:58:51 2016 (r301825) @@ -142,7 +142,7 @@ find -d ${TEMPROOT} -type d -empty -dele # Build the mtree database in a temporary location. MTREENEW=`mktemp -t mergemaster.mtree` -mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null +mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" From owner-svn-src-all@freebsd.org Sat Jun 11 06:36:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16C29AEF08E; Sat, 11 Jun 2016 06:36:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6AE32686; Sat, 11 Jun 2016 06:36:12 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B6aC1S099704; Sat, 11 Jun 2016 06:36:12 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B6aCkx099703; Sat, 11 Jun 2016 06:36:12 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606110636.u5B6aCkx099703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 11 Jun 2016 06:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301826 - vendor/ldns-host/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 06:36:13 -0000 Author: des Date: Sat Jun 11 06:36:11 2016 New Revision: 301826 URL: https://svnweb.freebsd.org/changeset/base/301826 Log: upstream hg 06347b1f76fe Modified: vendor/ldns-host/dist/ldns-host.c Modified: vendor/ldns-host/dist/ldns-host.c ============================================================================== --- vendor/ldns-host/dist/ldns-host.c Sat Jun 11 05:58:51 2016 (r301825) +++ vendor/ldns-host/dist/ldns-host.c Sat Jun 11 06:36:11 2016 (r301826) @@ -156,6 +156,19 @@ memerr: return LDNS_STATUS_MEM_ERR; } +static uint32_t +ldns_rr_soa_get_serial(const ldns_rr *rr) +{ + const ldns_rdf *rdf; + + if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) return 0; + if (ldns_rr_rd_count(rr) != 7) return 0; + rdf = ldns_rr_rdf(rr, 2); + if (ldns_rdf_get_type(rdf) != LDNS_RDF_TYPE_INT32) return 0; + if (ldns_rdf_size(rdf) != 4) return 0; + return ldns_rdf2native_int32(rdf); +} + static ldns_status ldns_tcp_start(ldns_resolver *res, ldns_pkt *qpkt, int nameserver) { /* This routine is based on ldns_axfr_start, with the major @@ -873,18 +886,16 @@ dozonetransfer(ldns_resolver *res, ldns_ ldns_rdf *dname; ldns_rr_type rrtype; ldns_rr_list *rrl; - int i, nsoa = 0; + ldns_rr *rr; + size_t i, nsoa = 0; + uint32_t first_serial; rrtype = o_rrtype; o_rrtype = (o_mode == M_AXFR) ? LDNS_RR_TYPE_AXFR : LDNS_RR_TYPE_IXFR; dname = search(res, domain, &pkt, absolute, false); for (;;) { - rrl = ldns_pkt_answer(pkt); - for (i = ldns_rr_list_rr_count(rrl) - 1; i >= 0; i--) { - if (ldns_rr_get_type(ldns_rr_list_rr(rrl, i)) == LDNS_RR_TYPE_SOA) - nsoa++; - } + rrl = ldns_rr_list_clone(ldns_pkt_answer(pkt)); ldns_pkt_filter_answer(pkt, rrtype); report(res, dname != NULL ? dname : domain, pkt); if ((dname == NULL) || @@ -893,9 +904,29 @@ dozonetransfer(ldns_resolver *res, ldns_ ldns_tcp_close(res); return false; } - if (nsoa >= 2) { - ldns_tcp_close(res); - return true; + for (i = 0; i < ldns_rr_list_rr_count(rrl); i++) { + rr = ldns_rr_list_rr(rrl, i); + if (nsoa == 0) { + if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { + printf("; Transfer failed. " + "Didn't start with SOA answer.\n"); + ldns_tcp_close(res); + return false; + } + first_serial = ldns_rr_soa_get_serial(rr); + if ((o_mode == M_IXFR) && (first_serial <= o_ixfr_serial)) { + ldns_tcp_close(res); + return true; + } + } + if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { + nsoa = nsoa < 2 ? nsoa + 1 : 1; + if ((nsoa == 2) && + (ldns_rr_soa_get_serial(rr) == first_serial)) { + ldns_tcp_close(res); + return true; + } + } } if (ldns_tcp_read(&nextpkt, res) != LDNS_STATUS_OK) { printf("; Transfer failed.\n"); @@ -904,6 +935,7 @@ dozonetransfer(ldns_resolver *res, ldns_ ldns_pkt_set_answerfrom(nextpkt, ldns_rdf_clone(ldns_pkt_answerfrom(pkt))); ldns_pkt_free(pkt); + ldns_rr_list_free(rrl); pkt = nextpkt; } } From owner-svn-src-all@freebsd.org Sat Jun 11 06:37:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C066CAEF0EC; Sat, 11 Jun 2016 06:37:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78FA427D0; Sat, 11 Jun 2016 06:37:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B6b9Oo099783; Sat, 11 Jun 2016 06:37:09 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B6b9bi099782; Sat, 11 Jun 2016 06:37:09 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606110637.u5B6b9bi099782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 11 Jun 2016 06:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301827 - vendor/ldns-host/hg-20160610-06347b1f76fe X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 06:37:10 -0000 Author: des Date: Sat Jun 11 06:37:09 2016 New Revision: 301827 URL: https://svnweb.freebsd.org/changeset/base/301827 Log: Tag 20160610-06347b1f76fe Added: vendor/ldns-host/hg-20160610-06347b1f76fe/ - copied from r301826, vendor/ldns-host/dist/ From owner-svn-src-all@freebsd.org Sat Jun 11 06:41:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65C0AAEF2C9; Sat, 11 Jun 2016 06:41:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1974D2AF5; Sat, 11 Jun 2016 06:41:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B6fsBT000677; Sat, 11 Jun 2016 06:41:54 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B6fslm000676; Sat, 11 Jun 2016 06:41:54 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606110641.u5B6fslm000676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 11 Jun 2016 06:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301828 - vendor/ldns-host/hg-20160501-114105 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 06:41:55 -0000 Author: des Date: Sat Jun 11 06:41:54 2016 New Revision: 301828 URL: https://svnweb.freebsd.org/changeset/base/301828 Log: Tag hg-20160501-114105 Added: vendor/ldns-host/hg-20160501-114105/ - copied from r301755, vendor/ldns-host/dist/ From owner-svn-src-all@freebsd.org Sat Jun 11 06:42:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C558AEF370; Sat, 11 Jun 2016 06:42:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06D672C8E; Sat, 11 Jun 2016 06:42:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B6gFFt001391; Sat, 11 Jun 2016 06:42:15 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B6gF0C001390; Sat, 11 Jun 2016 06:42:15 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606110642.u5B6gF0C001390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 11 Jun 2016 06:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301829 - vendor/ldns-host/hg-20160610-170001 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 06:42:16 -0000 Author: des Date: Sat Jun 11 06:42:15 2016 New Revision: 301829 URL: https://svnweb.freebsd.org/changeset/base/301829 Log: Tag hg-20160610-170001 Added: vendor/ldns-host/hg-20160610-170001/ - copied from r301828, vendor/ldns-host/dist/ From owner-svn-src-all@freebsd.org Sat Jun 11 06:42:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EE2AEF3E9; Sat, 11 Jun 2016 06:42:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF5A82DF7; Sat, 11 Jun 2016 06:42:35 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5B6gZoG003410; Sat, 11 Jun 2016 06:42:35 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5B6gZ3R003409; Sat, 11 Jun 2016 06:42:35 GMT (envelope-from des@FreeBSD.org) Message-Id: <201606110642.u5B6gZ3R003409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 11 Jun 2016 06:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301830 - in vendor/ldns-host: hg-20160501-0289cde234a0 hg-20160610-06347b1f76fe X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 06:42:36 -0000 Author: des Date: Sat Jun 11 06:42:34 2016 New Revision: 301830 URL: https://svnweb.freebsd.org/changeset/base/301830 Log: Remove incorrect tags Deleted: vendor/ldns-host/hg-20160501-0289cde234a0/ vendor/ldns-host/hg-20160610-06347b1f76fe/ From owner-svn-src-all@freebsd.org Sat Jun 11 11:24:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88A9AEF9F5; Sat, 11 Jun 2016 11:24:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB6B216A; Sat, 11 Jun 2016 11:24:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5BBOUEl005744; Sat, 11 Jun 2016 11:24:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5BBOUWE005743; Sat, 11 Jun 2016 11:24:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606111124.u5BBOUWE005743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 11:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301831 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 11:24:31 -0000 Author: ngie Date: Sat Jun 11 11:24:30 2016 New Revision: 301831 URL: https://svnweb.freebsd.org/changeset/base/301831 Log: MFC r300220,r300223: Differential Revision: https://reviews.freebsd.org/D6803 Reviewed by: alc, kib Sponsored by: EMC / Isilon Storage Division r300220 (by cem): sys/vmmeter.h: Fix trivial '-Wsign-compare' warning in common header Frankly, it doesn't make sense for vm_pageout_wakeup_thresh to have a negative value (it is only ever set to a fraction of v_free_min, which is unsigned and also obviously non-negative). But I'm not going to try and convert every non-negative scalar in the VM to unsigned today, so just cast it for the comparison. r300223 (by cem): vm/vm_page.h: Fix trivial '-Wpointer-sign' warning pq_vcnt, as a count of real things, has no business being negative. It is only ever initialized by a u_int counter. The warning came from the atomic_add_int() in vm_pagequeue_cnt_add(). Rectify the warning by changing the variable to u_int. No functional change. Suggested by: Clang 3.3 Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Sat Jun 11 11:25:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 917B8AEFAB2; Sat, 11 Jun 2016 11:25:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A4F42416; Sat, 11 Jun 2016 11:25:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5BBPnQT005848; Sat, 11 Jun 2016 11:25:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5BBPneq005847; Sat, 11 Jun 2016 11:25:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606111125.u5BBPneq005847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 11:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301832 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 11:25:50 -0000 Author: ngie Date: Sat Jun 11 11:25:49 2016 New Revision: 301832 URL: https://svnweb.freebsd.org/changeset/base/301832 Log: Revert r301831 -- I forgot to add the diff from Phabricator Pointyhat to: ngie (never commit without svn status half asleep) Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Sat Jun 11 11:28:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68274AEFCE3; Sat, 11 Jun 2016 11:28:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A42526D4; Sat, 11 Jun 2016 11:28:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5BBSUeF005992; Sat, 11 Jun 2016 11:28:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5BBSUeD005988; Sat, 11 Jun 2016 11:28:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606111128.u5BBSUeD005988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 11 Jun 2016 11:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301833 - in stable/10/sys: sys vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2016 11:28:31 -0000 Author: ngie Date: Sat Jun 11 11:28:29 2016 New Revision: 301833 URL: https://svnweb.freebsd.org/changeset/base/301833 Log: Redo MFC r300220,r300223: Differential Revision: https://reviews.freebsd.org/D6803 Reviewed by: alc, kib Sponsored by: EMC / Isilon Storage Division r300220 (by cem): sys/vmmeter.h: Fix trivial '-Wsign-compare' warning in common header Frankly, it doesn't make sense for vm_pageout_wakeup_thresh to have a negative value (it is only ever set to a fraction of v_free_min, which is unsigned and also obviously non-negative). But I'm not going to try and convert every non-negative scalar in the VM to unsigned today, so just cast it for the comparison. r300223 (by cem): vm/vm_page.h: Fix trivial '-Wpointer-sign' warning pq_vcnt, as a count of real things, has no business being negative. It is only ever initialized by a u_int counter. The warning came from the atomic_add_int() in vm_pagequeue_cnt_add(). Rectify the warning by changing the variable to u_int. No functional change. Suggested by: Clang 3.3 Modified: stable/10/sys/sys/vmmeter.h stable/10/sys/vm/vm_page.c stable/10/sys/vm/vm_page.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/vmmeter.h ============================================================================== --- stable/10/sys/sys/vmmeter.h Sat Jun 11 11:25:49 2016 (r301832) +++ stable/10/sys/sys/vmmeter.h Sat Jun 11 11:28:29 2016 (r301833) @@ -183,7 +183,8 @@ static __inline int vm_paging_needed(void) { - return (cnt.v_free_count + cnt.v_cache_count < vm_pageout_wakeup_thresh); + return (cnt.v_free_count + cnt.v_cache_count < + (u_int)vm_pageout_wakeup_thresh); } #endif Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Sat Jun 11 11:25:49 2016 (r301832) +++ stable/10/sys/vm/vm_page.c Sat Jun 11 11:28:29 2016 (r301833) @@ -253,11 +253,11 @@ vm_page_domain_init(struct vm_domain *vm *__DECONST(char **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_name) = "vm inactive pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = &cnt.v_inactive_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_name) = "vm active pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = &cnt.v_active_count; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; Modified: stable/10/sys/vm/vm_page.h ============================================================================== --- stable/10/sys/vm/vm_page.h Sat Jun 11 11:25:49 2016 (r301832) +++ stable/10/sys/vm/vm_page.h Sat Jun 11 11:28:29 2016 (r301833) @@ -215,7 +215,7 @@ struct vm_pagequeue { struct mtx pq_mutex; struct pglist pq_pl; int pq_cnt; - int * const pq_vcnt; + u_int * const pq_vcnt; const char * const pq_name; } __aligned(CACHE_LINE_SIZE);