From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 00:02:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FE623AE; Sun, 14 Sep 2014 00:02:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4CFABD; Sun, 14 Sep 2014 00:02:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E02c33036044; Sun, 14 Sep 2014 00:02:38 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E02cUr036043; Sun, 14 Sep 2014 00:02:38 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201409140002.s8E02cUr036043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 14 Sep 2014 00:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271561 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 00:02:38 -0000 Author: kan Date: Sun Sep 14 00:02:37 2014 New Revision: 271561 URL: http://svnweb.freebsd.org/changeset/base/271561 Log: Add delay to Octeon MDIO access routines. Prevent saturattion of the bus by constant polling which in extreme cases can cause interface lockup. This makes FreeBSD match similar case in the executive. Modified: head/sys/mips/cavium/octe/ethernet-mdio.c Modified: head/sys/mips/cavium/octe/ethernet-mdio.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mdio.c Sat Sep 13 23:50:51 2014 (r271560) +++ head/sys/mips/cavium/octe/ethernet-mdio.c Sun Sep 14 00:02:37 2014 (r271561) @@ -71,6 +71,7 @@ int cvm_oct_mdio_read(struct ifnet *ifp, cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { + cvmx_wait(1000); smi_rd.u64 = cvmx_read_csr(CVMX_SMI_RD_DAT); } while (smi_rd.s.pending); @@ -108,6 +109,7 @@ void cvm_oct_mdio_write(struct ifnet *if cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { + cvmx_wait(1000); smi_wr.u64 = cvmx_read_csr(CVMX_SMI_WR_DAT); } while (smi_wr.s.pending); MDIO_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 00:02:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00AA249E; Sun, 14 Sep 2014 00:02:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8CD7ABE; Sun, 14 Sep 2014 00:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E02eWw036107; Sun, 14 Sep 2014 00:02:40 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E02etf036106; Sun, 14 Sep 2014 00:02:40 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201409140002.s8E02etf036106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sun, 14 Sep 2014 00:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271562 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 00:02:41 -0000 Author: kan Date: Sun Sep 14 00:02:40 2014 New Revision: 271562 URL: http://svnweb.freebsd.org/changeset/base/271562 Log: Fix RTC clock writes on many Octeon boards. The struct clocktime uses 0-based week day number, so back out part of r229161 by gonzo, which actually broke the RTC clock writes on Sundays. Modified: head/sys/mips/cavium/octeon_ds1337.c Modified: head/sys/mips/cavium/octeon_ds1337.c ============================================================================== --- head/sys/mips/cavium/octeon_ds1337.c Sun Sep 14 00:02:37 2014 (r271561) +++ head/sys/mips/cavium/octeon_ds1337.c Sun Sep 14 00:02:40 2014 (r271562) @@ -81,7 +81,7 @@ static int validate_ct_struct(struct clo CT_CHECK(ct->min < 0 || ct->min > 59, "minute"); CT_CHECK(ct->hour < 0 || ct->hour > 23, "hour"); CT_CHECK(ct->day < 1 || ct->day > 31, "day"); - CT_CHECK(ct->dow < 1 || ct->dow > 7, "day of week"); + CT_CHECK(ct->dow < 0 || ct->dow > 6, "day of week"); CT_CHECK(ct->mon < 1 || ct->mon > 12, "month"); CT_CHECK(ct->year > 2037,"year"); @@ -124,7 +124,7 @@ uint32_t cvmx_rtc_ds1337_read(void) { ct.hour = (ct.hour + 12) % 24; } - ct.dow = (reg[3] & 0x7); /* Day of week field is 1..7 */ + ct.dow = (reg[3] & 0x7) - 1; /* Day of week field is 0..6 */ ct.day = bcd2bin(reg[4] & 0x3f); ct.mon = bcd2bin(reg[5] & 0x1f); /* Month field is 1..12 */ #if defined(OCTEON_BOARD_CAPK_0100ND) @@ -136,7 +136,6 @@ uint32_t cvmx_rtc_ds1337_read(void) ct.year = ((reg[5] & 0x80) ? 2000 : 1900) + bcd2bin(reg[6]); #endif - if (validate_ct_struct(&ct)) cvmx_dprintf("Warning: RTC calendar is not configured properly\n"); @@ -174,13 +173,15 @@ int cvmx_rtc_ds1337_write(uint32_t time) reg[0] = bin2bcd(ct.sec); reg[1] = bin2bcd(ct.min); reg[2] = bin2bcd(ct.hour); /* Force 0..23 format even if using AM/PM */ - reg[3] = bin2bcd(ct.dow); + reg[3] = bin2bcd(ct.dow + 1); reg[4] = bin2bcd(ct.day); reg[5] = bin2bcd(ct.mon); +#if !defined(OCTEON_BOARD_CAPK_0100ND) if (ct.year >= 2000) /* Set century bit*/ { reg[5] |= 0x80; } +#endif reg[6] = bin2bcd(ct.year % 100); /* Lockless write: detects the infrequent roll-over and retries */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 01:57:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 545329B; Sun, 14 Sep 2014 01:57:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F15D374; Sun, 14 Sep 2014 01:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E1vNfH087273; Sun, 14 Sep 2014 01:57:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E1vNFw087272; Sun, 14 Sep 2014 01:57:23 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409140157.s8E1vNFw087272@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 14 Sep 2014 01:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271563 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 01:57:23 -0000 Author: allanjude (doc committer) Date: Sun Sep 14 01:57:22 2014 New Revision: 271563 URL: http://svnweb.freebsd.org/changeset/base/271563 Log: Make the root-on-zfs part of the installer warn a user who booted the installer via UEFI that we do not support booting ZFS via UEFI yet PR: 193595 Approved by: nwhitehorn MFC after: 5 days Sponsored by: ScaleEngine Inc. CR: https://reviews.freebsd.org/D782 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun Sep 14 00:02:40 2014 (r271562) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun Sep 14 01:57:22 2014 (r271563) @@ -293,6 +293,7 @@ msg_swap_mirror_help="Mirror swap partit msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." @@ -687,6 +688,48 @@ dialog_menu_layout() return $DIALOG_OK } +# dialog_uefi_prompt +# +# Confirm that the user wants to continue with the installation on a BIOS +# system when they have booted with UEFI +# +dialog_uefi_prompt() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt # Calculated below + local hline="$hline_arrows_tab_enter" + + local height=8 width=50 prefix=" " + local plen=${#prefix} list= line= + local max_width=$(( $width - 3 - $plen )) + + local yes no defaultno extra_args format + if [ "$USE_XDIALOG" ]; then + yes=ok no=cancel defaultno=default-no + extra_args="--wrap --left" + format="$msg_uefi_not_supported" + else + yes=yes no=no defaultno=defaultno + extra_args="--cr-wrap" + format="$msg_uefi_not_supported" + fi + + # Add height for Xdialog(1) + [ "$USE_XDIALOG" ] && height=$(( $height + $height / 5 + 3 )) + + prompt=$( printf "$format" ) + f_dprintf "%s: UEFI prompt" "$0" + $DIALOG \ + --title "$title" \ + --backtitle "$btitle" \ + --hline "$hline" \ + --$yes-label "$msg_yes" \ + --$no-label "$msg_no" \ + $extra_args \ + --yesno "$prompt" $height $width +} + # zfs_create_diskpart $disk $index # # For each block device to be used in the zpool, rather than just create the @@ -1384,6 +1427,21 @@ f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSD f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # +# If the system was booted with UEFI, warn the user that FreeBSD can't do +# ZFS with UEFI yet +# +if f_interactive; then + bootmethod=$(sysctl -n machdep.bootmethod) + f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" + if [ "$bootmethod" != "BIOS" ]; then + dialog_uefi_prompt + retval=$? + f_dprintf "uefi_prompt=[%s]" "$retval" + [ $retval -eq $DIALOG_OK ] || f_die + fi +fi + +# # Loop over the main menu until we've accomplished what we came here to do # while :; do From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 02:31:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A70F845; Sun, 14 Sep 2014 02:31:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24DF788A; Sun, 14 Sep 2014 02:31:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E2VsBx005044; Sun, 14 Sep 2014 02:31:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E2VsEX005043; Sun, 14 Sep 2014 02:31:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201409140231.s8E2VsEX005043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 14 Sep 2014 02:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271567 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 02:31:54 -0000 Author: nwhitehorn Date: Sun Sep 14 02:31:53 2014 New Revision: 271567 URL: http://svnweb.freebsd.org/changeset/base/271567 Log: ZFS support isn't actually experimental anymore, so no need to scare people. Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Sun Sep 14 02:31:15 2014 (r271566) +++ head/usr.sbin/bsdinstall/scripts/auto Sun Sep 14 02:31:53 2014 (r271567) @@ -114,7 +114,7 @@ Shell \"Open a shell and partition by ha CURARCH=$( uname -m ) case $CURARCH in amd64|i386) # Booting ZFS Supported - PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS (Experimental)\"" + PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS\"" ;; *) # Booting ZFS Unspported ;; From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 02:55:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74E77A06; Sun, 14 Sep 2014 02:55:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4590B9DA; Sun, 14 Sep 2014 02:55:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E2tIo0016446; Sun, 14 Sep 2014 02:55:18 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E2tIZv016445; Sun, 14 Sep 2014 02:55:18 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201409140255.s8E2tIZv016445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 14 Sep 2014 02:55:18 +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: r271568 - stable/10/etc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 02:55:18 -0000 Author: wblock (doc committer) Date: Sun Sep 14 02:55:17 2014 New Revision: 271568 URL: http://svnweb.freebsd.org/changeset/base/271568 Log: MFC r271434: Update motd, clarifying the information and adding pointers to other resources. Approved by: re@ (marius@) Modified: stable/10/etc/motd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/motd ============================================================================== --- stable/10/etc/motd Sun Sep 14 02:31:53 2014 (r271567) +++ stable/10/etc/motd Sun Sep 14 02:55:17 2014 (r271568) @@ -1,25 +1,21 @@ FreeBSD ?.?.? (UNKNOWN) -Welcome to FreeBSD! +Welcome to FreeBSD! Handy technical support resources: -Before seeking technical support, please use the following resources: +Security advisories and errata: https://www.FreeBSD.org/releases/ +Handbook: https://www.FreeBSD.org/handbook/ +FAQ: https://www.FreeBSD.org/faq/ +Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ +Forums: https://forums.FreeBSD.org/ + +Documents installed with the system are in the /usr/local/share/doc/freebsd/ +directory, or can be installed later with: pkg install en-freebsd-doc +For other languages, replace "en" with a language code like de or fr. -o Security advisories and updated errata information for all releases are - at http://www.FreeBSD.org/releases/ - always consult the ERRATA section - for your release first as it's updated frequently. - -o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, - along with the mailing lists, can be searched by going to - http://www.FreeBSD.org/search/. If the doc package has been installed - (or fetched via pkg install lang-freebsd-doc, where lang is the - 2-letter language code, e.g. en), they are also available formatted - in /usr/local/share/doc/freebsd. - -If you still have a question or problem, please take the output of -`uname -a', along with any relevant error messages, and email it -as a question to the questions@FreeBSD.org mailing list. If you are -unfamiliar with FreeBSD's directory layout, please refer to the hier(7) -manual page. If you are not familiar with manual pages, type `man man'. +Show the version of FreeBSD installed: uname -a +Please include that output and any error messages when posting questions. -Edit /etc/motd to change this login announcement. +Introduction to manual pages: man man +FreeBSD directory layout: man hier +Edit /etc/motd to change this login announcement. From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 03:01:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D34D3C1E; Sun, 14 Sep 2014 03:01:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A546DA72; Sun, 14 Sep 2014 03:01:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E31IAE019531; Sun, 14 Sep 2014 03:01:18 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E31IMm019530; Sun, 14 Sep 2014 03:01:18 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201409140301.s8E31IMm019530@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 14 Sep 2014 03:01: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: r271569 - stable/9/etc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 03:01:19 -0000 Author: wblock (doc committer) Date: Sun Sep 14 03:01:18 2014 New Revision: 271569 URL: http://svnweb.freebsd.org/changeset/base/271569 Log: MFC r271434: Update motd, clarifying the information and adding pointers to other resources. Modified: stable/9/etc/motd Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/motd ============================================================================== --- stable/9/etc/motd Sun Sep 14 02:55:17 2014 (r271568) +++ stable/9/etc/motd Sun Sep 14 03:01:18 2014 (r271569) @@ -1,25 +1,21 @@ FreeBSD ?.?.? (UNKNOWN) -Welcome to FreeBSD! +Welcome to FreeBSD! Handy technical support resources: -Before seeking technical support, please use the following resources: +Security advisories and errata: https://www.FreeBSD.org/releases/ +Handbook: https://www.FreeBSD.org/handbook/ +FAQ: https://www.FreeBSD.org/faq/ +Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ +Forums: https://forums.FreeBSD.org/ + +Documents installed with the system are in the /usr/local/share/doc/freebsd/ +directory, or can be installed later with: pkg install en-freebsd-doc +For other languages, replace "en" with a language code like de or fr. -o Security advisories and updated errata information for all releases are - at http://www.FreeBSD.org/releases/ - always consult the ERRATA section - for your release first as it's updated frequently. - -o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, - along with the mailing lists, can be searched by going to - http://www.FreeBSD.org/search/. If the doc package has been installed - (or fetched via pkg_add -r lang-freebsd-doc, where lang is the - 2-letter language code, e.g. en), they are also available formatted - in /usr/local/share/doc/freebsd. - -If you still have a question or problem, please take the output of -`uname -a', along with any relevant error messages, and email it -as a question to the questions@FreeBSD.org mailing list. If you are -unfamiliar with FreeBSD's directory layout, please refer to the hier(7) -manual page. If you are not familiar with manual pages, type `man man'. +Show the version of FreeBSD installed: uname -a +Please include that output and any error messages when posting questions. -Edit /etc/motd to change this login announcement. +Introduction to manual pages: man man +FreeBSD directory layout: man hier +Edit /etc/motd to change this login announcement. From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 07:13:48 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED8D71E7; Sun, 14 Sep 2014 07:13:48 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id AA760F8D; Sun, 14 Sep 2014 07:13:47 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA22898; Sun, 14 Sep 2014 10:13:46 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XT40H-000ExY-VK; Sun, 14 Sep 2014 10:13:45 +0300 Message-ID: <54153FF2.7050105@FreeBSD.org> Date: Sun, 14 Sep 2014 10:12:50 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r271256 - head/lib/libpam/modules/pam_login_access References: <201409080919.s889J1QL050814@svn.freebsd.org> In-Reply-To: <201409080919.s889J1QL050814@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 07:13:49 -0000 On 08/09/2014 12:19, Dag-Erling Smørgrav wrote: > Author: des > Date: Mon Sep 8 09:19:01 2014 > New Revision: 271256 > URL: http://svnweb.freebsd.org/changeset/base/271256 > > Log: > Fail rather than segfault if neither PAM_TTY nor PAM_RHOST is set. > > PR: 83099 > MFC after: 3 days Thanks! But please see a line comment below. > Modified: > head/lib/libpam/modules/pam_login_access/pam_login_access.c > > Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c > ============================================================================== > --- head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 8 09:16:07 2014 (r271255) > +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 8 09:19:01 2014 (r271256) > @@ -79,7 +79,14 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int > > gethostname(hostname, sizeof hostname); > > - if (rhost == NULL || *(const char *)rhost == '\0') { > + if (rhost != NULL && *(const char *)rhost != '\0') { > + PAM_LOG("Checking login.access for user %s from host %s", > + (const char *)user, (const char *)rhost); > + if (login_access(user, rhost) != 0) > + return (PAM_SUCCESS); > + PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", > + user, rhost); > + } else if (tty != NULL || *(const char *)tty != '\0') { I think that the operator should be && here as well. > PAM_LOG("Checking login.access for user %s on tty %s", > (const char *)user, (const char *)tty); > if (login_access(user, tty) != 0) > @@ -87,12 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int > PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", > user, tty); > } else { > - PAM_LOG("Checking login.access for user %s from host %s", > - (const char *)user, (const char *)rhost); > - if (login_access(user, rhost) != 0) > - return (PAM_SUCCESS); > - PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", > - user, rhost); > + PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); > + return (PAM_AUTHINFO_UNAVAIL); > } > > return (PAM_AUTH_ERR); > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 08:35:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2DF4B90; Sun, 14 Sep 2014 08:35:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE50D828; Sun, 14 Sep 2014 08:35:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E8ZiHb072835; Sun, 14 Sep 2014 08:35:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E8ZicX072834; Sun, 14 Sep 2014 08:35:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409140835.s8E8ZicX072834@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 14 Sep 2014 08:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271571 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 08:35:45 -0000 Author: trasz Date: Sun Sep 14 08:35:44 2014 New Revision: 271571 URL: http://svnweb.freebsd.org/changeset/base/271571 Log: Fix two small nits in ctl.conf(5). MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Sun Sep 14 04:39:04 2014 (r271570) +++ head/usr.sbin/ctld/ctl.conf.5 Sun Sep 14 08:35:44 2014 (r271571) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2014 +.Dd September 14, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -93,6 +93,7 @@ The default is Create a .Sy portal-group configuration context, +defining a new portal-group, which can then be assigned to any number of targets. .It Ic target Ar name Create a @@ -282,7 +283,7 @@ The CTL-specific options passed to the k All CTL-specific options are documented in the .Sx OPTIONS section of -.Xr ctladm 8 +.Xr ctladm 8 . .It Ic path Ar path The path to the file or device node used to back the LUN. .It Ic serial Ar string From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 08:59:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D389322; Sun, 14 Sep 2014 08:59:41 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E4139F3; Sun, 14 Sep 2014 08:59:41 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 75C7E1FE027; Sun, 14 Sep 2014 10:59:38 +0200 (CEST) Message-ID: <541558EF.2090700@selasky.org> Date: Sun, 14 Sep 2014 10:59:27 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Rick Macklem Subject: Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4 References: <597691144.35887030.1410644742707.JavaMail.root@uoguelph.ca> In-Reply-To: <597691144.35887030.1410644742707.JavaMail.root@uoguelph.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Adrian Chadd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 08:59:41 -0000 On 09/13/14 23:45, Rick Macklem wrote: > Hans Petter Selasky wrote: >> On 09/13/14 18:54, Adrian Chadd wrote: >>> Hi, >>> >>> Just for the record: >>> >>> * I'm glad you're tackling the TSO config stuff; >>> * I'm not glad you're trying to pack it into a u_int rather than >>> creating a new structure and adding fields for it. >>> >>> I appreciate that you're trying to rush this in before 10.1, but >>> this >>> is exactly why things shouldn't be rushed in before release >>> deadlines. >>> :) >>> >>> I'd really like to see this be broken out as a structure and the >>> bit >>> shifting games for what really shouldn't be packed into a u_int >>> fixed. >>> Otherwise this is going to be deadweight that has to persist past >>> 11.0. >>> >> >> Hi Adrian, >> >> I can make that change for -current, making the new structure and >> such. >> This change was intended for 10 where there is only one u_int for >> this >> information. Or do you want me to change that in 10 too? >> >> --HPS >> >> >> > Btw, your patch calls sbsndptr() in tcp_output(), which advances > sb_sndptroff and sb_sndptr by the length. > Then it loops around and reduces the length for the case where > there are too many mbufs in the chain. > Right, though this patch would need to understand segment lengths too and not only count them. --HPS From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 09:26:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CD9598; Sun, 14 Sep 2014 09:26:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67B07C6C; Sun, 14 Sep 2014 09:26:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E9QYSF096507; Sun, 14 Sep 2014 09:26:34 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E9QYgQ096505; Sun, 14 Sep 2014 09:26:34 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409140926.s8E9QYgQ096505@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 14 Sep 2014 09:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271577 - head/contrib/openbsm/bin/auditdistd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 09:26:34 -0000 Author: pjd Date: Sun Sep 14 09:26:33 2014 New Revision: 271577 URL: http://svnweb.freebsd.org/changeset/base/271577 Log: Fix descriptors leak. PR: bin/191002 Reported by: Ryan Steinmetz Submitted by: mjg Modified: head/contrib/openbsm/bin/auditdistd/subr.c Modified: head/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/subr.c Sun Sep 14 09:20:01 2014 (r271576) +++ head/contrib/openbsm/bin/auditdistd/subr.c Sun Sep 14 09:26:33 2014 (r271577) @@ -228,6 +228,11 @@ wait_for_file_init(int fd) PJDLOG_ASSERT(fd != -1); #ifdef HAVE_KQUEUE + if (wait_for_file_kq != -1) { + close(wait_for_file_kq); + wait_for_file_kq = -1; + } + kq = kqueue(); if (kq == -1) { pjdlog_errno(LOG_WARNING, "kqueue() failed"); From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 09:27:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEA011F8; Sun, 14 Sep 2014 09:27:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99A79C7A; Sun, 14 Sep 2014 09:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E9RCQ0096664; Sun, 14 Sep 2014 09:27:12 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E9RCgp096663; Sun, 14 Sep 2014 09:27:12 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409140927.s8E9RCgp096663@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 14 Sep 2014 09:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271578 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 09:27:12 -0000 Author: pjd Date: Sun Sep 14 09:27:12 2014 New Revision: 271578 URL: http://svnweb.freebsd.org/changeset/base/271578 Log: Remove the limit on descriptors that can be send in one nvlist. Submitted by: Mariusz Zaborski Modified: head/lib/libnv/msgio.c Modified: head/lib/libnv/msgio.c ============================================================================== --- head/lib/libnv/msgio.c Sun Sep 14 09:26:33 2014 (r271577) +++ head/lib/libnv/msgio.c Sun Sep 14 09:27:12 2014 (r271578) @@ -31,7 +31,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #define PJDLOG_ABORT(...) abort() #endif +#define PKG_MAX_SIZE (MCLBYTES / CMSG_SPACE(sizeof(int)) - 1) + static int msghdr_add_fd(struct cmsghdr *cmsg, int fd) { @@ -234,22 +236,31 @@ cred_recv(int sock, struct cmsgcred *cre return (0); } -int -fd_send(int sock, const int *fds, size_t nfds) +static int +fd_package_send(int sock, const int *fds, size_t nfds) { struct msghdr msg; struct cmsghdr *cmsg; + struct iovec iov; unsigned int i; int serrno, ret; + uint8_t dummy; - if (nfds == 0 || fds == NULL) { - errno = EINVAL; - return (-1); - } + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(fds != NULL); + PJDLOG_ASSERT(nfds > 0); bzero(&msg, sizeof(msg)); - msg.msg_iov = NULL; - msg.msg_iovlen = 0; + + /* + * XXX: Look into cred_send function for more details. + */ + dummy = 0; + iov.iov_base = &dummy; + iov.iov_len = sizeof(dummy); + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; msg.msg_controllen = nfds * CMSG_SPACE(sizeof(int)); msg.msg_control = calloc(1, msg.msg_controllen); if (msg.msg_control == NULL) @@ -274,22 +285,32 @@ end: return (ret); } -int -fd_recv(int sock, int *fds, size_t nfds) +static int +fd_package_recv(int sock, int *fds, size_t nfds) { struct msghdr msg; struct cmsghdr *cmsg; unsigned int i; int serrno, ret; + struct iovec iov; + uint8_t dummy; - if (nfds == 0 || fds == NULL) { - errno = EINVAL; - return (-1); - } + PJDLOG_ASSERT(sock >= 0); + PJDLOG_ASSERT(nfds > 0); + PJDLOG_ASSERT(fds != NULL); + i = 0; bzero(&msg, sizeof(msg)); - msg.msg_iov = NULL; - msg.msg_iovlen = 0; + bzero(&iov, sizeof(iov)); + + /* + * XXX: Look into cred_send function for more details. + */ + iov.iov_base = &dummy; + iov.iov_len = sizeof(dummy); + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; msg.msg_controllen = nfds * CMSG_SPACE(sizeof(int)); msg.msg_control = calloc(1, msg.msg_controllen); if (msg.msg_control == NULL) @@ -333,6 +354,64 @@ end: } int +fd_recv(int sock, int *fds, size_t nfds) +{ + unsigned int i, step, j; + int ret, serrno; + + if (nfds == 0 || fds == NULL) { + errno = EINVAL; + return (-1); + } + + ret = i = step = 0; + while (i < nfds) { + if (PKG_MAX_SIZE < nfds - i) + step = PKG_MAX_SIZE; + else + step = nfds - i; + ret = fd_package_recv(sock, fds + i, step); + if (ret != 0) { + /* Close all received descriptors. */ + serrno = errno; + for (j = 0; j < i; j++) + close(fds[j]); + errno = serrno; + break; + } + i += step; + } + + return (ret); +} + +int +fd_send(int sock, const int *fds, size_t nfds) +{ + unsigned int i, step; + int ret; + + if (nfds == 0 || fds == NULL) { + errno = EINVAL; + return (-1); + } + + ret = i = step = 0; + while (i < nfds) { + if (PKG_MAX_SIZE < nfds - i) + step = PKG_MAX_SIZE; + else + step = nfds - i; + ret = fd_package_send(sock, fds + i, step); + if (ret != 0) + break; + i += step; + } + + return (ret); +} + +int buf_send(int sock, void *buf, size_t size) { ssize_t done; From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 09:30:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 777E743D; Sun, 14 Sep 2014 09:30:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61E39C91; Sun, 14 Sep 2014 09:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8E9UBOX097193; Sun, 14 Sep 2014 09:30:11 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8E9UAFd097184; Sun, 14 Sep 2014 09:30:10 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409140930.s8E9UAFd097184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 14 Sep 2014 09:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271579 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 09:30:11 -0000 Author: pjd Date: Sun Sep 14 09:30:09 2014 New Revision: 271579 URL: http://svnweb.freebsd.org/changeset/base/271579 Log: Use non-recursive algorithm for traversing nvlists. This also removes the limit on number of nested nvlists. Submitted by: Mariusz Zaborski Modified: head/lib/libnv/nv.h head/lib/libnv/nv_impl.h head/lib/libnv/nvlist.c head/lib/libnv/nvlist_impl.h head/lib/libnv/nvpair.c head/lib/libnv/nvpair_impl.h Modified: head/lib/libnv/nv.h ============================================================================== --- head/lib/libnv/nv.h Sun Sep 14 09:27:12 2014 (r271578) +++ head/lib/libnv/nv.h Sun Sep 14 09:30:09 2014 (r271579) @@ -83,6 +83,8 @@ nvlist_t *nvlist_xfer(int sock, nvlist_t const char *nvlist_next(const nvlist_t *nvl, int *typep, void **cookiep); +const nvlist_t *nvlist_get_parent(const nvlist_t *nvl); + /* * The nvlist_exists functions check if the given name (optionally of the given * type) exists on nvlist. Modified: head/lib/libnv/nv_impl.h ============================================================================== --- head/lib/libnv/nv_impl.h Sun Sep 14 09:27:12 2014 (r271578) +++ head/lib/libnv/nv_impl.h Sun Sep 14 09:30:09 2014 (r271579) @@ -39,6 +39,8 @@ struct nvpair; typedef struct nvpair nvpair_t; #endif +#define NV_TYPE_NVLIST_UP 255 + #define NV_TYPE_FIRST NV_TYPE_NULL #define NV_TYPE_LAST NV_TYPE_BINARY @@ -55,6 +57,8 @@ void nvlist_add_nvpair(nvlist_t *nvl, co void nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp); +void nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent); + const nvpair_t *nvlist_get_nvpair(const nvlist_t *nvl, const char *name); nvpair_t *nvlist_take_nvpair(nvlist_t *nvl, const char *name); Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Sun Sep 14 09:27:12 2014 (r271578) +++ head/lib/libnv/nvlist.c Sun Sep 14 09:30:09 2014 (r271579) @@ -73,10 +73,11 @@ __FBSDID("$FreeBSD$"); #define NVLIST_MAGIC 0x6e766c /* "nvl" */ struct nvlist { - int nvl_magic; - int nvl_error; - int nvl_flags; - struct nvl_head nvl_head; + int nvl_magic; + int nvl_error; + int nvl_flags; + nvpair_t *nvl_parent; + struct nvl_head nvl_head; }; #define NVLIST_ASSERT(nvl) do { \ @@ -106,6 +107,7 @@ nvlist_create(int flags) nvl = malloc(sizeof(*nvl)); nvl->nvl_error = 0; nvl->nvl_flags = flags; + nvl->nvl_parent = NULL; TAILQ_INIT(&nvl->nvl_head); nvl->nvl_magic = NVLIST_MAGIC; @@ -147,6 +149,36 @@ nvlist_error(const nvlist_t *nvl) return (nvl->nvl_error); } +nvpair_t * +nvlist_get_nvpair_parent(const nvlist_t *nvl) +{ + + NVLIST_ASSERT(nvl); + + return (nvl->nvl_parent); +} + +const nvlist_t * +nvlist_get_parent(const nvlist_t *nvl) +{ + + NVLIST_ASSERT(nvl); + + if (nvl->nvl_parent == NULL) + return (NULL); + + return (nvpair_nvlist(nvl->nvl_parent)); +} + +void +nvlist_set_parent(nvlist_t *nvl, nvpair_t *parent) +{ + + NVLIST_ASSERT(nvl); + + nvl->nvl_parent = parent; +} + bool nvlist_empty(const nvlist_t *nvl) { @@ -301,24 +333,34 @@ nvlist_clone(const nvlist_t *nvl) return (newnvl); } +static bool +nvlist_dump_error_check(const nvlist_t *nvl, int fd, int level) +{ + + if (nvlist_error(nvl) != 0) { + dprintf(fd, "%*serror: %d\n", level * 4, "", + nvlist_error(nvl)); + return (true); + } + + return (false); +} + /* * Dump content of nvlist. */ -static void -nvlist_xdump(const nvlist_t *nvl, int fd, int level) +void +nvlist_dump(const nvlist_t *nvl, int fd) { nvpair_t *nvp; + int level; - PJDLOG_ASSERT(level < 3); - - if (nvlist_error(nvl) != 0) { - dprintf(fd, "%*serror: %d\n", level * 4, "", - nvlist_error(nvl)); + level = 0; + if (nvlist_dump_error_check(nvl, fd, level)) return; - } - for (nvp = nvlist_first_nvpair(nvl); nvp != NULL; - nvp = nvlist_next_nvpair(nvl, nvp)) { + nvp = nvlist_first_nvpair(nvl); + while (nvp != NULL) { dprintf(fd, "%*s%s (%s):", level * 4, "", nvpair_name(nvp), nvpair_type_string(nvpair_type(nvp))); switch (nvpair_type(nvp)) { @@ -340,8 +382,14 @@ nvlist_xdump(const nvlist_t *nvl, int fd break; case NV_TYPE_NVLIST: dprintf(fd, "\n"); - nvlist_xdump(nvpair_get_nvlist(nvp), fd, level + 1); - break; + nvl = nvpair_get_nvlist(nvp); + if (nvlist_dump_error_check(nvl, fd, level + 1)) { + nvl = nvlist_get_parent(nvl); + break; + } + level += 1; + nvp = nvlist_first_nvpair(nvl); + continue; case NV_TYPE_DESCRIPTOR: dprintf(fd, " %d\n", nvpair_get_descriptor(nvp)); break; @@ -361,14 +409,15 @@ nvlist_xdump(const nvlist_t *nvl, int fd default: PJDLOG_ABORT("Unknown type: %d.", nvpair_type(nvp)); } - } -} - -void -nvlist_dump(const nvlist_t *nvl, int fd) -{ - nvlist_xdump(nvl, fd, 0); + while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { + nvp = nvlist_get_nvpair_parent(nvl); + if (nvp == NULL) + return; + nvl = nvlist_get_parent(nvl); + level --; + } + } } void @@ -381,41 +430,44 @@ nvlist_fdump(const nvlist_t *nvl, FILE * /* * The function obtains size of the nvlist after nvlist_pack(). - * Additional argument 'level' allows to track how deep are we as we obtain - * size of the NV_TYPE_NVLIST elements using recursion. We allow at most - * three levels of recursion. */ -static size_t -nvlist_xsize(const nvlist_t *nvl, int level) +size_t +nvlist_size(const nvlist_t *nvl) { const nvpair_t *nvp; size_t size; NVLIST_ASSERT(nvl); PJDLOG_ASSERT(nvl->nvl_error == 0); - PJDLOG_ASSERT(level < 3); size = sizeof(struct nvlist_header); - for (nvp = nvlist_first_nvpair(nvl); nvp != NULL; - nvp = nvlist_next_nvpair(nvl, nvp)) { + nvp = nvlist_first_nvpair(nvl); + while (nvp != NULL) { size += nvpair_header_size(); size += strlen(nvpair_name(nvp)) + 1; - if (nvpair_type(nvp) == NV_TYPE_NVLIST) - size += nvlist_xsize(nvpair_get_nvlist(nvp), level + 1); - else + if (nvpair_type(nvp) == NV_TYPE_NVLIST) { + size += sizeof(struct nvlist_header); + size += nvpair_header_size() + 1; + nvl = nvpair_get_nvlist(nvp); + PJDLOG_ASSERT(nvl->nvl_error == 0); + nvp = nvlist_first_nvpair(nvl); + continue; + } else { size += nvpair_size(nvp); + } + + while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { + nvp = nvlist_get_nvpair_parent(nvl); + if (nvp == NULL) + goto out; + nvl = nvlist_get_parent(nvl); + } } +out: return (size); } -size_t -nvlist_size(const nvlist_t *nvl) -{ - - return (nvlist_xsize(nvl, 0)); -} - static int * nvlist_xdescriptors(const nvlist_t *nvl, int *descs, int level) { @@ -541,15 +593,59 @@ nvlist_xpack(const nvlist_t *nvl, int64_ ptr = nvlist_pack_header(nvl, ptr, &left); - for (nvp = nvlist_first_nvpair(nvl); nvp != NULL; - nvp = nvlist_next_nvpair(nvl, nvp)) { - ptr = nvpair_pack(nvp, ptr, fdidxp, &left); + nvp = nvlist_first_nvpair(nvl); + while (nvp != NULL) { + NVPAIR_ASSERT(nvp); + + nvpair_init_datasize(nvp); + ptr = nvpair_pack_header(nvp, ptr, &left); + if (ptr == NULL) { + free(buf); + return (NULL); + } + switch (nvpair_type(nvp)) { + case NV_TYPE_NULL: + ptr = nvpair_pack_null(nvp, ptr, &left); + break; + case NV_TYPE_BOOL: + ptr = nvpair_pack_bool(nvp, ptr, &left); + break; + case NV_TYPE_NUMBER: + ptr = nvpair_pack_number(nvp, ptr, &left); + break; + case NV_TYPE_STRING: + ptr = nvpair_pack_string(nvp, ptr, &left); + break; + case NV_TYPE_NVLIST: + nvl = nvpair_get_nvlist(nvp); + nvp = nvlist_first_nvpair(nvl); + ptr = nvlist_pack_header(nvl, ptr, &left); + continue; + case NV_TYPE_DESCRIPTOR: + ptr = nvpair_pack_descriptor(nvp, ptr, fdidxp, &left); + break; + case NV_TYPE_BINARY: + ptr = nvpair_pack_binary(nvp, ptr, &left); + break; + default: + PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp)); + } if (ptr == NULL) { free(buf); return (NULL); } + while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { + nvp = nvlist_get_nvpair_parent(nvl); + if (nvp == NULL) + goto out; + ptr = nvpair_pack_nvlist_up(ptr, &left); + if (ptr == NULL) + goto out; + nvl = nvlist_get_parent(nvl); + } } +out: if (sizep != NULL) *sizep = size; return (buf); @@ -600,7 +696,7 @@ nvlist_check_header(struct nvlist_header return (true); } -static const unsigned char * +const unsigned char * nvlist_unpack_header(nvlist_t *nvl, const unsigned char *ptr, size_t nfds, int *flagsp, size_t *leftp) { @@ -642,7 +738,7 @@ nvlist_t * nvlist_xunpack(const void *buf, size_t size, const int *fds, size_t nfds) { const unsigned char *ptr; - nvlist_t *nvl; + nvlist_t *nvl, *retnvl, *tmpnvl; nvpair_t *nvp; size_t left; int flags; @@ -650,7 +746,8 @@ nvlist_xunpack(const void *buf, size_t s left = size; ptr = buf; - nvl = nvlist_create(0); + tmpnvl = NULL; + nvl = retnvl = nvlist_create(0); if (nvl == NULL) goto failed; @@ -659,15 +756,55 @@ nvlist_xunpack(const void *buf, size_t s goto failed; while (left > 0) { - ptr = nvpair_unpack(flags, ptr, &left, fds, nfds, &nvp); + ptr = nvpair_unpack(flags, ptr, &left, &nvp); + if (ptr == NULL) + goto failed; + switch (nvpair_type(nvp)) { + case NV_TYPE_NULL: + ptr = nvpair_unpack_null(flags, nvp, ptr, &left); + break; + case NV_TYPE_BOOL: + ptr = nvpair_unpack_bool(flags, nvp, ptr, &left); + break; + case NV_TYPE_NUMBER: + ptr = nvpair_unpack_number(flags, nvp, ptr, &left); + break; + case NV_TYPE_STRING: + ptr = nvpair_unpack_string(flags, nvp, ptr, &left); + break; + case NV_TYPE_NVLIST: + ptr = nvpair_unpack_nvlist(&flags, nvp, ptr, &left, + nfds, &tmpnvl); + nvlist_set_parent(tmpnvl, nvp); + break; + case NV_TYPE_DESCRIPTOR: + ptr = nvpair_unpack_descriptor(flags, nvp, ptr, &left, + fds, nfds); + break; + case NV_TYPE_BINARY: + ptr = nvpair_unpack_binary(flags, nvp, ptr, &left); + break; + case NV_TYPE_NVLIST_UP: + if (nvl->nvl_parent == NULL) + goto failed; + nvl = nvpair_nvlist(nvl->nvl_parent); + flags = nvl->nvl_flags; + continue; + default: + PJDLOG_ABORT("Invalid type (%d).", nvpair_type(nvp)); + } if (ptr == NULL) goto failed; nvlist_move_nvpair(nvl, nvp); + if (tmpnvl != NULL) { + nvl = tmpnvl; + tmpnvl = NULL; + } } - return (nvl); + return (retnvl); failed: - nvlist_destroy(nvl); + nvlist_destroy(retnvl); return (NULL); } @@ -1331,7 +1468,8 @@ nvlist_movev_nvlist(nvlist_t *nvl, nvlis nvpair_t *nvp; if (nvlist_error(nvl) != 0) { - nvlist_destroy(value); + if (value != NULL && nvlist_get_nvpair_parent(value) != NULL) + nvlist_destroy(value); errno = nvlist_error(nvl); return; } Modified: head/lib/libnv/nvlist_impl.h ============================================================================== --- head/lib/libnv/nvlist_impl.h Sun Sep 14 09:27:12 2014 (r271578) +++ head/lib/libnv/nvlist_impl.h Sun Sep 14 09:30:09 2014 (r271579) @@ -40,4 +40,8 @@ void *nvlist_xpack(const nvlist_t *nvl, nvlist_t *nvlist_xunpack(const void *buf, size_t size, const int *fds, size_t nfds); +nvpair_t *nvlist_get_nvpair_parent(const nvlist_t *nvl); +const unsigned char *nvlist_unpack_header(nvlist_t *nvl, + const unsigned char *ptr, size_t nfds, int *flagsp, size_t *leftp); + #endif /* !_NVLIST_IMPL_H_ */ Modified: head/lib/libnv/nvpair.c ============================================================================== --- head/lib/libnv/nvpair.c Sun Sep 14 09:27:12 2014 (r271578) +++ head/lib/libnv/nvpair.c Sun Sep 14 09:30:09 2014 (r271579) @@ -67,7 +67,7 @@ struct nvpair { int nvp_type; uint64_t nvp_data; size_t nvp_datasize; - nvlist_t *nvp_list; /* Used for sanity checks. */ + nvlist_t *nvp_list; TAILQ_ENTRY(nvpair) nvp_next; }; @@ -90,7 +90,7 @@ nvpair_assert(const nvpair_t *nvp) NVPAIR_ASSERT(nvp); } -const nvlist_t * +nvlist_t * nvpair_nvlist(const nvpair_t *nvp) { @@ -131,6 +131,17 @@ nvpair_insert(struct nvl_head *head, nvp nvp->nvp_list = nvl; } +static void +nvpair_remove_nvlist(nvpair_t *nvp) +{ + nvlist_t *nvl; + + /* XXX: DECONST is bad, mkay? */ + nvl = __DECONST(nvlist_t *, nvpair_get_nvlist(nvp)); + PJDLOG_ASSERT(nvl != NULL); + nvlist_set_parent(nvl, NULL); +} + void nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl) { @@ -138,6 +149,9 @@ nvpair_remove(struct nvl_head *head, nvp NVPAIR_ASSERT(nvp); PJDLOG_ASSERT(nvp->nvp_list == nvl); + if (nvpair_type(nvp) == NV_TYPE_NVLIST) + nvpair_remove_nvlist(nvp); + TAILQ_REMOVE(head, nvp, nvp_next); nvp->nvp_list = NULL; } @@ -201,7 +215,7 @@ nvpair_size(const nvpair_t *nvp) return (nvp->nvp_datasize); } -static unsigned char * +unsigned char * nvpair_pack_header(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { struct nvpair_header nvphdr; @@ -227,7 +241,7 @@ nvpair_pack_header(const nvpair_t *nvp, return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp __unused) { @@ -238,7 +252,7 @@ nvpair_pack_null(const nvpair_t *nvp, un return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_bool(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { uint8_t value; @@ -256,7 +270,7 @@ nvpair_pack_bool(const nvpair_t *nvp, un return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_number(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { uint64_t value; @@ -274,7 +288,7 @@ nvpair_pack_number(const nvpair_t *nvp, return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_string(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { @@ -289,37 +303,31 @@ nvpair_pack_string(const nvpair_t *nvp, return (ptr); } -static unsigned char * -nvpair_pack_nvlist(const nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp, - size_t *leftp) +unsigned char * +nvpair_pack_nvlist_up(unsigned char *ptr, size_t *leftp) { - unsigned char *data; - size_t size; - - NVPAIR_ASSERT(nvp); - PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NVLIST); - - if (nvp->nvp_datasize == 0) - return (ptr); - - data = nvlist_xpack((const nvlist_t *)(intptr_t)nvp->nvp_data, fdidxp, - &size); - if (data == NULL) - return (NULL); - - PJDLOG_ASSERT(size == nvp->nvp_datasize); - PJDLOG_ASSERT(*leftp >= nvp->nvp_datasize); + struct nvpair_header nvphdr; + size_t namesize; + const char *name = ""; - memcpy(ptr, data, nvp->nvp_datasize); - free(data); + namesize = 1; + nvphdr.nvph_type = NV_TYPE_NVLIST_UP; + nvphdr.nvph_namesize = namesize; + nvphdr.nvph_datasize = 0; + PJDLOG_ASSERT(*leftp >= sizeof(nvphdr)); + memcpy(ptr, &nvphdr, sizeof(nvphdr)); + ptr += sizeof(nvphdr); + *leftp -= sizeof(nvphdr); - ptr += nvp->nvp_datasize; - *leftp -= nvp->nvp_datasize; + PJDLOG_ASSERT(*leftp >= namesize); + memcpy(ptr, name, namesize); + ptr += namesize; + *leftp -= namesize; return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_descriptor(const nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp, size_t *leftp) { @@ -349,7 +357,7 @@ nvpair_pack_descriptor(const nvpair_t *n return (ptr); } -static unsigned char * +unsigned char * nvpair_pack_binary(const nvpair_t *nvp, unsigned char *ptr, size_t *leftp) { @@ -364,17 +372,12 @@ nvpair_pack_binary(const nvpair_t *nvp, return (ptr); } -unsigned char * -nvpair_pack(nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp, size_t *leftp) +void +nvpair_init_datasize(nvpair_t *nvp) { NVPAIR_ASSERT(nvp); - /* - * We have to update datasize for NV_TYPE_NVLIST on every pack, - * so that proper datasize is placed into nvpair_header - * during the nvpair_pack_header() call below. - */ if (nvp->nvp_type == NV_TYPE_NVLIST) { if (nvp->nvp_data == 0) { nvp->nvp_datasize = 0; @@ -383,41 +386,9 @@ nvpair_pack(nvpair_t *nvp, unsigned char nvlist_size((const nvlist_t *)(intptr_t)nvp->nvp_data); } } - - ptr = nvpair_pack_header(nvp, ptr, leftp); - if (ptr == NULL) - return (NULL); - - switch (nvp->nvp_type) { - case NV_TYPE_NULL: - ptr = nvpair_pack_null(nvp, ptr, leftp); - break; - case NV_TYPE_BOOL: - ptr = nvpair_pack_bool(nvp, ptr, leftp); - break; - case NV_TYPE_NUMBER: - ptr = nvpair_pack_number(nvp, ptr, leftp); - break; - case NV_TYPE_STRING: - ptr = nvpair_pack_string(nvp, ptr, leftp); - break; - case NV_TYPE_NVLIST: - ptr = nvpair_pack_nvlist(nvp, ptr, fdidxp, leftp); - break; - case NV_TYPE_DESCRIPTOR: - ptr = nvpair_pack_descriptor(nvp, ptr, fdidxp, leftp); - break; - case NV_TYPE_BINARY: - ptr = nvpair_pack_binary(nvp, ptr, leftp); - break; - default: - PJDLOG_ABORT("Invalid type (%d).", nvp->nvp_type); - } - - return (ptr); } -static const unsigned char * +const unsigned char * nvpair_unpack_header(int flags, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp) { @@ -434,8 +405,10 @@ nvpair_unpack_header(int flags, nvpair_t if (nvphdr.nvph_type < NV_TYPE_FIRST) goto failed; #endif - if (nvphdr.nvph_type > NV_TYPE_LAST) + if (nvphdr.nvph_type > NV_TYPE_LAST && + nvphdr.nvph_type != NV_TYPE_NVLIST_UP) { goto failed; + } #if BYTE_ORDER == BIG_ENDIAN if ((flags & NV_FLAG_BIG_ENDIAN) == 0) { @@ -477,7 +450,7 @@ failed: return (NULL); } -static const unsigned char * +const unsigned char * nvpair_unpack_null(int flags __unused, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp __unused) { @@ -492,7 +465,7 @@ nvpair_unpack_null(int flags __unused, n return (ptr); } -static const unsigned char * +const unsigned char * nvpair_unpack_bool(int flags __unused, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp) { @@ -523,9 +496,9 @@ nvpair_unpack_bool(int flags __unused, n return (ptr); } -static const unsigned char * +const unsigned char * nvpair_unpack_number(int flags, nvpair_t *nvp, const unsigned char *ptr, - size_t *leftp) + size_t *leftp) { PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NUMBER); @@ -549,7 +522,7 @@ nvpair_unpack_number(int flags, nvpair_t return (ptr); } -static const unsigned char * +const unsigned char * nvpair_unpack_string(int flags __unused, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp) { @@ -577,9 +550,9 @@ nvpair_unpack_string(int flags __unused, return (ptr); } -static const unsigned char * -nvpair_unpack_nvlist(int flags __unused, nvpair_t *nvp, - const unsigned char *ptr, size_t *leftp, const int *fds, size_t nfds) +const unsigned char * +nvpair_unpack_nvlist(int *flagsp, nvpair_t *nvp, const unsigned char *ptr, + size_t *leftp, size_t nfds, nvlist_t **child) { nvlist_t *value; @@ -590,19 +563,21 @@ nvpair_unpack_nvlist(int flags __unused, return (NULL); } - value = nvlist_xunpack(ptr, nvp->nvp_datasize, fds, nfds); + value = nvlist_create(0); if (value == NULL) return (NULL); - nvp->nvp_data = (uint64_t)(uintptr_t)value; + ptr = nvlist_unpack_header(value, ptr, nfds, flagsp, leftp); + if (ptr == NULL) + return (NULL); - ptr += nvp->nvp_datasize; - *leftp -= nvp->nvp_datasize; + nvp->nvp_data = (uint64_t)(uintptr_t)value; + *child = value; return (ptr); } -static const unsigned char * +const unsigned char * nvpair_unpack_descriptor(int flags, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp, const int *fds, size_t nfds) { @@ -642,7 +617,7 @@ nvpair_unpack_descriptor(int flags, nvpa return (ptr); } -static const unsigned char * +const unsigned char * nvpair_unpack_binary(int flags __unused, nvpair_t *nvp, const unsigned char *ptr, size_t *leftp) { @@ -670,7 +645,7 @@ nvpair_unpack_binary(int flags __unused, const unsigned char * nvpair_unpack(int flags, const unsigned char *ptr, size_t *leftp, - const int *fds, size_t nfds, nvpair_t **nvpp) + nvpair_t **nvpp) { nvpair_t *nvp, *tmp; @@ -686,40 +661,10 @@ nvpair_unpack(int flags, const unsigned if (tmp == NULL) goto failed; nvp = tmp; + /* Update nvp_name after realloc(). */ nvp->nvp_name = (char *)(nvp + 1); - - switch (nvp->nvp_type) { - case NV_TYPE_NULL: - ptr = nvpair_unpack_null(flags, nvp, ptr, leftp); - break; - case NV_TYPE_BOOL: - ptr = nvpair_unpack_bool(flags, nvp, ptr, leftp); - break; - case NV_TYPE_NUMBER: - ptr = nvpair_unpack_number(flags, nvp, ptr, leftp); - break; - case NV_TYPE_STRING: - ptr = nvpair_unpack_string(flags, nvp, ptr, leftp); - break; - case NV_TYPE_NVLIST: - ptr = nvpair_unpack_nvlist(flags, nvp, ptr, leftp, fds, - nfds); - break; - case NV_TYPE_DESCRIPTOR: - ptr = nvpair_unpack_descriptor(flags, nvp, ptr, leftp, fds, - nfds); - break; - case NV_TYPE_BINARY: - ptr = nvpair_unpack_binary(flags, nvp, ptr, leftp); - break; - default: - PJDLOG_ABORT("Invalid type (%d).", nvp->nvp_type); - } - - if (ptr == NULL) - goto failed; - + nvp->nvp_data = 0x00; nvp->nvp_magic = NVPAIR_MAGIC; *nvpp = nvp; return (ptr); @@ -1018,6 +963,7 @@ nvpair_createv_nvlist(const nvlist_t *va namefmt, nameap); if (nvp == NULL) nvlist_destroy(nvl); + nvlist_set_parent(nvl, nvp); return (nvp); } @@ -1172,7 +1118,7 @@ nvpair_movev_nvlist(nvlist_t *value, con { nvpair_t *nvp; - if (value == NULL) { + if (value == NULL || nvlist_get_nvpair_parent(value) != NULL) { errno = EINVAL; return (NULL); } @@ -1181,6 +1127,8 @@ nvpair_movev_nvlist(nvlist_t *value, con namefmt, nameap); if (nvp == NULL) nvlist_destroy(value); + else + nvlist_set_parent(value, nvp); return (nvp); } Modified: head/lib/libnv/nvpair_impl.h ============================================================================== --- head/lib/libnv/nvpair_impl.h Sun Sep 14 09:27:12 2014 (r271578) +++ head/lib/libnv/nvpair_impl.h Sun Sep 14 09:30:09 2014 (r271579) @@ -41,18 +41,52 @@ TAILQ_HEAD(nvl_head, nvpair); void nvpair_assert(const nvpair_t *nvp); -const nvlist_t *nvpair_nvlist(const nvpair_t *nvp); +nvlist_t *nvpair_nvlist(const nvpair_t *nvp); nvpair_t *nvpair_next(const nvpair_t *nvp); nvpair_t *nvpair_prev(const nvpair_t *nvp); void nvpair_insert(struct nvl_head *head, nvpair_t *nvp, nvlist_t *nvl); void nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl); size_t nvpair_header_size(void); size_t nvpair_size(const nvpair_t *nvp); -unsigned char *nvpair_pack(nvpair_t *nvp, unsigned char *ptr, int64_t *fdidxp, - size_t *leftp); const unsigned char *nvpair_unpack(int flags, const unsigned char *ptr, - size_t *leftp, const int *fds, size_t nfds, nvpair_t **nvpp); + size_t *leftp, nvpair_t **nvpp); void nvpair_free_structure(nvpair_t *nvp); +void nvpair_init_datasize(nvpair_t *nvp); const char *nvpair_type_string(int type); +/* Pack functions. */ +unsigned char *nvpair_pack_header(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_bool(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_number(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_string(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_descriptor(const nvpair_t *nvp, unsigned char *ptr, + int64_t *fdidxp, size_t *leftp); +unsigned char *nvpair_pack_binary(const nvpair_t *nvp, unsigned char *ptr, + size_t *leftp); +unsigned char *nvpair_pack_nvlist_up(unsigned char *ptr, size_t *leftp); + +/* Unpack data functions. */ +const unsigned char *nvpair_unpack_header(int flags, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_null(int flags, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_bool(int flags, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_number(int flags, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_string(int flags, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); +const unsigned char *nvpair_unpack_nvlist(int *flagsp, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp, size_t nvlist, nvlist_t **child); +const unsigned char *nvpair_unpack_descriptor(int flags, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp, const int *fds, size_t nfds); +const unsigned char *nvpair_unpack_binary(int flags, nvpair_t *nvp, + const unsigned char *ptr, size_t *leftp); + #endif /* !_NVPAIR_IMPL_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 10:27:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C246198A; Sun, 14 Sep 2014 10:27:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94129366; Sun, 14 Sep 2014 10:27:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EARaPS025614; Sun, 14 Sep 2014 10:27:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EARaCD025613; Sun, 14 Sep 2014 10:27:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409141027.s8EARaCD025613@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Sep 2014 10:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271586 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 10:27:36 -0000 Author: kib Date: Sun Sep 14 10:27:36 2014 New Revision: 271586 URL: http://svnweb.freebsd.org/changeset/base/271586 Log: Fix mis-spelling of bits and types names in the vnode_pager_putpages(). The changes should not modify the generated code. The pager->pgo_putpages() method takes int flags as its fourth argument, while vnode_pager_putpages() used boolean_t (which is typedef'ed to int). The flags are from VM_PAGER_* namespace, while vnode_pager_putpages() passed TRUE and OBJPC_SYNC to VOP_PUTPAGES(), which both are numerically equal to VM_PAGER_PUT_SYNC. Noted and reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Sep 14 10:07:12 2014 (r271585) +++ head/sys/vm/vnode_pager.c Sun Sep 14 10:27:36 2014 (r271586) @@ -83,7 +83,7 @@ static int vnode_pager_input_smlfs(vm_ob static int vnode_pager_input_old(vm_object_t object, vm_page_t m); static void vnode_pager_dealloc(vm_object_t); static int vnode_pager_getpages(vm_object_t, vm_page_t *, int, int); -static void vnode_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *); +static void vnode_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); static boolean_t vnode_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); static vm_object_t vnode_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t, struct ucred *cred); @@ -1008,7 +1008,7 @@ vnode_pager_generic_getpages(struct vnod */ static void vnode_pager_putpages(vm_object_t object, vm_page_t *m, int count, - boolean_t sync, int *rtvals) + int flags, int *rtvals) { int rtval; struct vnode *vp; @@ -1026,16 +1026,16 @@ vnode_pager_putpages(vm_object_t object, * daemon up. This should be probably be addressed XXX. */ - if ((vm_cnt.v_free_count + vm_cnt.v_cache_count) < + if (vm_cnt.v_free_count + vm_cnt.v_cache_count < vm_cnt.v_pageout_free_min) - sync |= OBJPC_SYNC; + flags |= VM_PAGER_PUT_SYNC; /* * Call device-specific putpages function */ vp = object->handle; VM_OBJECT_WUNLOCK(object); - rtval = VOP_PUTPAGES(vp, m, bytes, sync, rtvals); + rtval = VOP_PUTPAGES(vp, m, bytes, flags, rtvals); KASSERT(rtval != EOPNOTSUPP, ("vnode_pager: stale FS putpages\n")); VM_OBJECT_WLOCK(object); From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 11:59:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 801E8C73; Sun, 14 Sep 2014 11:59:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1A8D87; Sun, 14 Sep 2014 11:59:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EBxofP067766; Sun, 14 Sep 2014 11:59:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EBxn3T067759; Sun, 14 Sep 2014 11:59:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409141159.s8EBxn3T067759@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 14 Sep 2014 11:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271588 - in head: sbin/camcontrol 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 11:59:50 -0000 Author: mav Date: Sun Sep 14 11:59:49 2014 New Revision: 271588 URL: http://svnweb.freebsd.org/changeset/base/271588 Log: Update CAM CCB accounting for the new status quo. devq_openings counter lost its meaning after allocation queues has gone. held counter is still meaningful, but problematic to update due to separate locking of CCB allocation and queuing. To fix that replace devq_openings counter with allocated counter. held is now calculated on request as difference between number of allocated, queued and active CCBs. MFC after: 1 month Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_ccb.h head/sys/cam/cam_queue.c head/sys/cam/cam_queue.h head/sys/cam/cam_xpt.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sun Sep 14 11:00:44 2014 (r271587) +++ head/sbin/camcontrol/camcontrol.c Sun Sep 14 11:59:49 2014 (r271588) @@ -4469,9 +4469,9 @@ tagcontrol(struct cam_device *device, in fprintf(stdout, "%s", pathstr); fprintf(stdout, "dev_active %d\n", ccb->cgds.dev_active); fprintf(stdout, "%s", pathstr); - fprintf(stdout, "devq_openings %d\n", ccb->cgds.devq_openings); + fprintf(stdout, "allocated %d\n", ccb->cgds.allocated); fprintf(stdout, "%s", pathstr); - fprintf(stdout, "devq_queued %d\n", ccb->cgds.devq_queued); + fprintf(stdout, "queued %d\n", ccb->cgds.queued); fprintf(stdout, "%s", pathstr); fprintf(stdout, "held %d\n", ccb->cgds.held); fprintf(stdout, "%s", pathstr); Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sun Sep 14 11:00:44 2014 (r271587) +++ head/sys/cam/cam_ccb.h Sun Sep 14 11:59:49 2014 (r271588) @@ -347,8 +347,8 @@ struct ccb_getdevstats { struct ccb_hdr ccb_h; int dev_openings; /* Space left for more work on device*/ int dev_active; /* Transactions running on the device */ - int devq_openings; /* Space left for more queued work */ - int devq_queued; /* Transactions queued to be sent */ + int allocated; /* CCBs allocated for the device */ + int queued; /* CCBs queued to be sent to the device */ int held; /* * CCBs held by peripheral drivers * for this device Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Sun Sep 14 11:00:44 2014 (r271587) +++ head/sys/cam/cam_queue.c Sun Sep 14 11:59:49 2014 (r271588) @@ -290,7 +290,6 @@ cam_ccbq_resize(struct cam_ccbq *ccbq, i delta = new_size - (ccbq->dev_active + ccbq->dev_openings); ccbq->total_openings += delta; - ccbq->devq_openings += delta; ccbq->dev_openings += delta; new_size = imax(64, 1 << fls(new_size + new_size / 2)); @@ -308,7 +307,6 @@ cam_ccbq_init(struct cam_ccbq *ccbq, int imax(64, 1 << fls(openings + openings / 2))) != 0) return (1); ccbq->total_openings = openings; - ccbq->devq_openings = openings; ccbq->dev_openings = openings; return (0); } Modified: head/sys/cam/cam_queue.h ============================================================================== --- head/sys/cam/cam_queue.h Sun Sep 14 11:00:44 2014 (r271587) +++ head/sys/cam/cam_queue.h Sun Sep 14 11:59:49 2014 (r271588) @@ -62,10 +62,9 @@ struct cam_ccbq { struct ccb_hdr_tailq queue_extra_head; int queue_extra_entries; int total_openings; - int devq_openings; + int allocated; int dev_openings; int dev_active; - int held; }; struct cam_ed; @@ -188,8 +187,8 @@ cam_ccbq_pending_ccb_count(struct cam_cc static __inline void cam_ccbq_take_opening(struct cam_ccbq *ccbq) { - ccbq->devq_openings--; - ccbq->held++; + + ccbq->allocated++; } static __inline void @@ -198,8 +197,6 @@ cam_ccbq_insert_ccb(struct cam_ccbq *ccb struct ccb_hdr *old_ccb; struct camq *queue = &ccbq->queue; - ccbq->held--; - /* * If queue is already full, try to resize. * If resize fail, push CCB with lowest priority out to the TAILQ. @@ -264,7 +261,7 @@ cam_ccbq_send_ccb(struct cam_ccbq *ccbq, send_ccb->ccb_h.pinfo.index = CAM_ACTIVE_INDEX; ccbq->dev_active++; - ccbq->dev_openings--; + ccbq->dev_openings--; } static __inline void @@ -272,15 +269,14 @@ cam_ccbq_ccb_done(struct cam_ccbq *ccbq, { ccbq->dev_active--; - ccbq->dev_openings++; - ccbq->held++; + ccbq->dev_openings++; } static __inline void cam_ccbq_release_opening(struct cam_ccbq *ccbq) { - ccbq->held--; - ccbq->devq_openings++; + + ccbq->allocated--; } #endif /* _KERNEL */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Sep 14 11:00:44 2014 (r271587) +++ head/sys/cam/cam_xpt.c Sun Sep 14 11:59:49 2014 (r271588) @@ -2648,20 +2648,25 @@ call_sim: struct ccb_getdevstats *cgds; struct cam_eb *bus; struct cam_et *tar; + struct cam_devq *devq; cgds = &start_ccb->cgds; bus = path->bus; tar = path->target; + devq = bus->sim->devq; + mtx_lock(&devq->send_mtx); cgds->dev_openings = dev->ccbq.dev_openings; cgds->dev_active = dev->ccbq.dev_active; - cgds->devq_openings = dev->ccbq.devq_openings; - cgds->devq_queued = cam_ccbq_pending_ccb_count(&dev->ccbq); - cgds->held = dev->ccbq.held; + cgds->allocated = dev->ccbq.allocated; + cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq); + cgds->held = cgds->allocated - cgds->dev_active - + cgds->queued; cgds->last_reset = tar->last_reset; cgds->maxtags = dev->maxtags; cgds->mintags = dev->mintags; if (timevalcmp(&tar->last_reset, &bus->last_reset, <)) cgds->last_reset = bus->last_reset; + mtx_unlock(&devq->send_mtx); cgds->ccb_h.status = CAM_REQ_CMP; } break; @@ -3004,7 +3009,6 @@ xpt_polled_action(union ccb *start_ccb) * can get it before us while we simulate interrupts. */ mtx_lock(&devq->send_mtx); - dev->ccbq.devq_openings--; dev->ccbq.dev_openings--; while((devq->send_openings <= 0 || dev->ccbq.dev_openings < 0) && (--timeout > 0)) { @@ -3016,7 +3020,6 @@ xpt_polled_action(union ccb *start_ccb) camisr_runqueue(); mtx_lock(&devq->send_mtx); } - dev->ccbq.devq_openings++; dev->ccbq.dev_openings++; mtx_unlock(&devq->send_mtx); From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 12:23:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1823666; Sun, 14 Sep 2014 12:23:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC6E2FEB; Sun, 14 Sep 2014 12:23:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ECN09j081124; Sun, 14 Sep 2014 12:23:00 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ECN0W1081122; Sun, 14 Sep 2014 12:23:00 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409141223.s8ECN0W1081122@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sun, 14 Sep 2014 12:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271589 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 12:23:01 -0000 Author: smh Date: Sun Sep 14 12:23:00 2014 New Revision: 271589 URL: http://svnweb.freebsd.org/changeset/base/271589 Log: Added missing ZFS sysctls * vfs.zfs.vdev.async_write_active_min_dirty_percent * vfs.zfs.vdev.async_write_active_max_dirty_percent Added validation of min / max for ZFS sysctl * vfs.zfs.dirty_data_max_percent MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sun Sep 14 11:59:49 2014 (r271588) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sun Sep 14 12:23:00 2014 (r271589) @@ -145,8 +145,10 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_d &zfs_dirty_data_max_max, 0, "The absolute cap on dirty_data_max when auto calculating"); -SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN, - &zfs_dirty_data_max_percent, 0, +static int sysctl_zfs_dirty_data_max_percent(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vfs_zfs, OID_AUTO, dirty_data_max_percent, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), + sysctl_zfs_dirty_data_max_percent, "I", "The percent of physical memory used to auto calculate dirty_data_max"); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN, @@ -168,6 +170,24 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, delay_sc "Controls how quickly the delay approaches infinity"); static int +sysctl_zfs_dirty_data_max_percent(SYSCTL_HANDLER_ARGS) +{ + int val, err; + + val = zfs_dirty_data_max_percent; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val < 0 || val > 100) + return (EINVAL); + + zfs_dirty_data_max_percent = val; + + return (0); +} + +static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_HANDLER_ARGS) { int val, err; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sun Sep 14 11:59:49 2014 (r271588) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sun Sep 14 12:23:00 2014 (r271589) @@ -176,6 +176,21 @@ int zfs_vdev_write_gap_limit = 4 << 10; #ifdef __FreeBSD__ SYSCTL_DECL(_vfs_zfs_vdev); + +static int sysctl_zfs_async_write_active_min_dirty_percent(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vfs_zfs_vdev, OID_AUTO, async_write_active_min_dirty_percent, + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), + sysctl_zfs_async_write_active_min_dirty_percent, "I", + "Percentage of async write dirty data below which " + "async_write_min_active is used."); + +static int sysctl_zfs_async_write_active_max_dirty_percent(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vfs_zfs_vdev, OID_AUTO, async_write_active_max_dirty_percent, + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), + sysctl_zfs_async_write_active_max_dirty_percent, "I", + "Percentage of async write dirty data above which " + "async_write_max_active is used."); + SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RWTUN, &zfs_vdev_max_active, 0, "The maximum number of I/Os of all types active for each device."); @@ -216,6 +231,44 @@ SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, read SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, write_gap_limit, CTLFLAG_RWTUN, &zfs_vdev_write_gap_limit, 0, "Acceptable gap between two writes being aggregated"); + +static int +sysctl_zfs_async_write_active_min_dirty_percent(SYSCTL_HANDLER_ARGS) +{ + int val, err; + + val = zfs_vdev_async_write_active_min_dirty_percent; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val < 0 || val > 100 || + val >= zfs_vdev_async_write_active_max_dirty_percent) + return (EINVAL); + + zfs_vdev_async_write_active_min_dirty_percent = val; + + return (0); +} + +static int +sysctl_zfs_async_write_active_max_dirty_percent(SYSCTL_HANDLER_ARGS) +{ + int val, err; + + val = zfs_vdev_async_write_active_max_dirty_percent; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val < 0 || val > 100 || + val <= zfs_vdev_async_write_active_min_dirty_percent) + return (EINVAL); + + zfs_vdev_async_write_active_max_dirty_percent = val; + + return (0); +} #endif int From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 15:59:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A461DF7; Sun, 14 Sep 2014 15:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 132566CB; Sun, 14 Sep 2014 15:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EFxFuc081041; Sun, 14 Sep 2014 15:59:15 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EFxFYY081038; Sun, 14 Sep 2014 15:59:15 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201409141559.s8EFxFYY081038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 Sep 2014 15:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271590 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 15:59:16 -0000 Author: jilles Date: Sun Sep 14 15:59:15 2014 New Revision: 271590 URL: http://svnweb.freebsd.org/changeset/base/271590 Log: sh: Add some const keywords. Modified: head/bin/sh/input.c head/bin/sh/input.h head/bin/sh/parser.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sun Sep 14 12:23:00 2014 (r271589) +++ head/bin/sh/input.c Sun Sep 14 15:59:15 2014 (r271590) @@ -338,7 +338,7 @@ pungetc(void) * We handle aliases this way. */ void -pushstring(char *s, int len, struct alias *ap) +pushstring(const char *s, int len, struct alias *ap) { struct strpush *sp; Modified: head/bin/sh/input.h ============================================================================== --- head/bin/sh/input.h Sun Sep 14 12:23:00 2014 (r271589) +++ head/bin/sh/input.h Sun Sep 14 15:59:15 2014 (r271590) @@ -53,7 +53,7 @@ int pgetc(void); int preadbuffer(void); int preadateof(void); void pungetc(void); -void pushstring(char *, int, struct alias *); +void pushstring(const char *, int, struct alias *); void setinputfile(const char *, int); void setinputfd(int, int); void setinputstring(const char *, int); Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Sep 14 12:23:00 2014 (r271589) +++ head/bin/sh/parser.c Sun Sep 14 15:59:15 2014 (r271590) @@ -1915,7 +1915,7 @@ char * getprompt(void *unused __unused) { static char ps[PROMPTLEN]; - char *fmt; + const char *fmt; const char *pwd; int i, trim; static char internal_error[] = "??"; From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 16:12:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D4A61D6; Sun, 14 Sep 2014 16:12:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F907898; Sun, 14 Sep 2014 16:12:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EGCi1c089799; Sun, 14 Sep 2014 16:12:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EGCi4E089798; Sun, 14 Sep 2014 16:12:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409141612.s8EGCi4E089798@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 14 Sep 2014 16:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271591 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 16:12:44 -0000 Author: ian Date: Sun Sep 14 16:12:43 2014 New Revision: 271591 URL: http://svnweb.freebsd.org/changeset/base/271591 Log: Add a comment giving an overview of the driver. Remove leftover debugging. Modified: head/sys/arm/freescale/imx/imx_iomux.c Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Sun Sep 14 15:59:15 2014 (r271590) +++ head/sys/arm/freescale/imx/imx_iomux.c Sun Sep 14 16:12:43 2014 (r271591) @@ -26,6 +26,29 @@ * $FreeBSD$ */ +/* + * Pin mux and pad control driver for imx5 and imx6. + * + * This driver implements the fdt_pinctrl interface for configuring the gpio and + * peripheral pins based on fdt configuration data. + * + * When the driver attaches, it walks the entire fdt tree and automatically + * configures the pins for each device which has a pinctrl-0 property and whose + * status is "okay". In addition it implements the fdt_pinctrl_configure() + * method which any other driver can call at any time to reconfigure its pins. + * + * The nature of the fsl,pins property in fdt data makes this driver's job very + * easy. Instead of representing each pin and pad configuration using symbolic + * properties such as pullup-enable="true" and so on, the data simply contains + * the addresses of the registers that control the pins, and the raw values to + * store in those registers. + * + * The imx5 and imx6 SoCs also have a small number of "general purpose + * registers" in the iomuxc device which are used to control an assortment + * of completely unrelated aspects of SoC behavior. This driver provides other + * drivers with direct access to those registers via simple accessor functions. + */ + #include #include #include @@ -102,13 +125,6 @@ iomux_configure_pins(device_t dev, phand cfgnode = OF_node_from_xref(cfgxref); ntuples = OF_getencprop_alloc(cfgnode, "fsl,pins", sizeof(*cfgtuples), (void **)&cfgtuples); -#ifdef DEBUG - { - char name[32]; - OF_getprop(cfgnode, "name", &name, sizeof(name)); - printf("found %d tuples in fsl,pins for %s\n", ntuples, name); - } -#endif if (ntuples < 0) return (ENOENT); if (ntuples == 0) From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 16:27:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FCE44F1; Sun, 14 Sep 2014 16:27:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00B91995; Sun, 14 Sep 2014 16:27:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EGRn8q095031; Sun, 14 Sep 2014 16:27:49 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EGRnNo095030; Sun, 14 Sep 2014 16:27:49 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201409141627.s8EGRnNo095030@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 Sep 2014 16:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271592 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 16:27:50 -0000 Author: jilles Date: Sun Sep 14 16:27:49 2014 New Revision: 271592 URL: http://svnweb.freebsd.org/changeset/base/271592 Log: sh: Make checkend() a real function instead of an emulated nested function. No functional change is intended, but the generated code is slightly different. Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Sep 14 16:12:43 2014 (r271591) +++ head/bin/sh/parser.c Sun Sep 14 16:27:49 2014 (r271592) @@ -946,6 +946,42 @@ struct tokenstate /* + * Check to see whether we are at the end of the here document. When this + * is called, c is set to the first character of the next input line. If + * we are at the end of the here document, this routine sets the c to PEOF. + * The new value of c is returned. + */ + +static int +checkend(int c, const char *eofmark, char *line, size_t sizeof_line, + int striptabs) +{ + if (striptabs) { + while (c == '\t') + c = pgetc(); + } + if (c == *eofmark) { + if (pfgets(line, sizeof_line) != NULL) { + const char *p, *q; + + p = line; + for (q = eofmark + 1 ; *q && *p == *q ; p++, q++); + if ((*p == '\0' || *p == '\n') && *q == '\0') { + c = PEOF; + if (*p == '\n') { + plinno++; + needprompt = doprompt; + } + } else { + pushstring(line, strlen(line), NULL); + } + } + } + return (c); +} + + +/* * Called to parse command substitutions. */ @@ -1269,7 +1305,6 @@ readcstyleesc(char *out) * will run code that appears at the end of readtoken1. */ -#define CHECKEND() {goto checkend; checkend_return:;} #define PARSEREDIR() {goto parseredir; parseredir_return:;} #define PARSESUB() {goto parsesub; parsesub_return:;} #define PARSEARITH() {goto parsearith; parsearith_return:;} @@ -1303,7 +1338,9 @@ readtoken1(int firstc, char const *initi STARTSTACKSTR(out); loop: { /* for each line, until end of word */ - CHECKEND(); /* set c to PEOF if at end of here document */ + if (eofmark) + /* set c to PEOF if at end of here document */ + c = checkend(c, eofmark, line, sizeof(line), striptabs); for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(4, out); /* permit 4 calls to USTPUTC */ @@ -1484,40 +1521,6 @@ endword: /* - * Check to see whether we are at the end of the here document. When this - * is called, c is set to the first character of the next input line. If - * we are at the end of the here document, this routine sets the c to PEOF. - */ - -checkend: { - if (eofmark) { - if (striptabs) { - while (c == '\t') - c = pgetc(); - } - if (c == *eofmark) { - if (pfgets(line, sizeof line) != NULL) { - const char *p, *q; - - p = line; - for (q = eofmark + 1 ; *q && *p == *q ; p++, q++); - if ((*p == '\0' || *p == '\n') && *q == '\0') { - c = PEOF; - if (*p == '\n') { - plinno++; - needprompt = doprompt; - } - } else { - pushstring(line, strlen(line), NULL); - } - } - } - } - goto checkend_return; -} - - -/* * Parse a redirection operator. The variable "out" points to a string * specifying the fd to be redirected. The variable "c" contains the * first character of the redirection operator. From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 16:46:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 084CBB47; Sun, 14 Sep 2014 16:46:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBFD6B57; Sun, 14 Sep 2014 16:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EGkVVV004435; Sun, 14 Sep 2014 16:46:31 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EGkUHg004428; Sun, 14 Sep 2014 16:46:30 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201409141646.s8EGkUHg004428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 14 Sep 2014 16:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271593 - in head/bin/sh: . tests/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 16:46:32 -0000 Author: jilles Date: Sun Sep 14 16:46:30 2014 New Revision: 271593 URL: http://svnweb.freebsd.org/changeset/base/271593 Log: sh: Remove arbitrary length limit on << EOF markers. This also simplifies the code. Added: head/bin/sh/tests/parser/heredoc12.0 (contents, props changed) Modified: head/bin/sh/input.c head/bin/sh/input.h head/bin/sh/parser.c head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sun Sep 14 16:27:49 2014 (r271592) +++ head/bin/sh/input.c Sun Sep 14 16:46:30 2014 (r271593) @@ -116,33 +116,6 @@ resetinput(void) } -/* - * Read a line from the script. - */ - -char * -pfgets(char *line, int len) -{ - char *p = line; - int nleft = len; - int c; - - while (--nleft > 0) { - c = pgetc_macro(); - if (c == PEOF) { - if (p == line) - return NULL; - break; - } - *p++ = c; - if (c == '\n') - break; - } - *p = '\0'; - return line; -} - - /* * Read a character from the script, returning PEOF on end of file. Modified: head/bin/sh/input.h ============================================================================== --- head/bin/sh/input.h Sun Sep 14 16:27:49 2014 (r271592) +++ head/bin/sh/input.h Sun Sep 14 16:46:30 2014 (r271593) @@ -48,7 +48,6 @@ struct alias; struct parsefile; void resetinput(void); -char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); int preadateof(void); Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Sep 14 16:27:49 2014 (r271592) +++ head/bin/sh/parser.c Sun Sep 14 16:46:30 2014 (r271593) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); * Shell command parser. */ -#define EOFMARKLEN 79 #define PROMPTLEN 128 /* values of checkkwd variable */ @@ -718,7 +717,6 @@ parsefname(void) if (n->type == NHERE) { struct heredoc *here = heredoc; struct heredoc *p; - int i; if (quoteflag == 0) n->type = NXHERE; @@ -727,7 +725,7 @@ parsefname(void) while (*wordtext == '\t') wordtext++; } - if (! noexpand(wordtext) || (i = strlen(wordtext)) == 0 || i > EOFMARKLEN) + if (! noexpand(wordtext)) synerror("Illegal eof marker for << redirection"); rmescapes(wordtext); here->eofmark = wordtext; @@ -953,28 +951,27 @@ struct tokenstate */ static int -checkend(int c, const char *eofmark, char *line, size_t sizeof_line, - int striptabs) +checkend(int c, const char *eofmark, int striptabs) { if (striptabs) { while (c == '\t') c = pgetc(); } if (c == *eofmark) { - if (pfgets(line, sizeof_line) != NULL) { - const char *p, *q; + int c2; + const char *q; - p = line; - for (q = eofmark + 1 ; *q && *p == *q ; p++, q++); - if ((*p == '\0' || *p == '\n') && *q == '\0') { - c = PEOF; - if (*p == '\n') { - plinno++; - needprompt = doprompt; - } - } else { - pushstring(line, strlen(line), NULL); + for (q = eofmark + 1; c2 = pgetc(), *q != '\0' && c2 == *q; q++) + ; + if ((c2 == PEOF || c2 == '\n') && *q == '\0') { + c = PEOF; + if (c2 == '\n') { + plinno++; + needprompt = doprompt; } + } else { + pungetc(); + pushstring(eofmark + 1, q - (eofmark + 1), NULL); } } return (c); @@ -1316,7 +1313,6 @@ readtoken1(int firstc, char const *initi int c = firstc; char *out; int len; - char line[EOFMARKLEN + 1]; struct nodelist *bqlist; int quotef; int newvarnest; @@ -1340,7 +1336,7 @@ readtoken1(int firstc, char const *initi loop: { /* for each line, until end of word */ if (eofmark) /* set c to PEOF if at end of here document */ - c = checkend(c, eofmark, line, sizeof(line), striptabs); + c = checkend(c, eofmark, striptabs); for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(4, out); /* permit 4 calls to USTPUTC */ @@ -2032,7 +2028,7 @@ expandstr(const char *ps) parser_temp = NULL; setinputstring(ps, 1); doprompt = 0; - readtoken1(pgetc(), DQSYNTAX, "\n\n", 0); + readtoken1(pgetc(), DQSYNTAX, "", 0); if (backquotelist != NULL) error("Command substitution not allowed here"); Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Sun Sep 14 16:27:49 2014 (r271592) +++ head/bin/sh/tests/parser/Makefile Sun Sep 14 16:46:30 2014 (r271593) @@ -54,6 +54,7 @@ FILES+= heredoc8.0 FILES+= heredoc9.0 FILES+= heredoc10.0 FILES+= heredoc11.0 +FILES+= heredoc12.0 FILES+= no-space1.0 FILES+= no-space2.0 FILES+= only-redir1.0 Added: head/bin/sh/tests/parser/heredoc12.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/heredoc12.0 Sun Sep 14 16:46:30 2014 (r271593) @@ -0,0 +1,47 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +longmark=`printf %01000d 4` +longmarkstripped=`printf %0999d 0` + +check '"$(cat <<'"$longmark +$longmark"' +echo yes)" = "yes"' + +check '"$(cat <<\'"$longmark +$longmark"' +echo yes)" = "yes"' + +check '"$(cat <<'"$longmark +yes +$longmark"' +)" = "yes"' + +check '"$(cat <<\'"$longmark +yes +$longmark"' +)" = "yes"' + +check '"$(cat <<'"$longmark +$longmarkstripped +$longmark. +$longmark"' +)" = "'"$longmarkstripped +$longmark."'"' + +check '"$(cat <<\'"$longmark +$longmarkstripped +$longmark. +$longmark"' +)" = "'"$longmarkstripped +$longmark."'"' + +exit $((failures != 0)) From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 17:36:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A71E6D98; Sun, 14 Sep 2014 17:36:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B9AFB5; Sun, 14 Sep 2014 17:36:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EHavrs029026; Sun, 14 Sep 2014 17:36:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EHavBY029025; Sun, 14 Sep 2014 17:36:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409141736.s8EHavBY029025@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 14 Sep 2014 17:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271594 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 17:36:57 -0000 Author: ian Date: Sun Sep 14 17:36:57 2014 New Revision: 271594 URL: http://svnweb.freebsd.org/changeset/base/271594 Log: Fix an undefined variable that was accidentally not causing an error. The code had references to both intr_offset and intr_parent variable names as referring to the parent interrupt node. The intr_parent variable wasn't actually defined anywhere, but the only references to it were as an argument to a macro that didn't use that argument in expansion, so the undefined variable accidentally didn't cause an error. The intr_parent name makes more sense in context, so change all occurrances of intr_offset to intr_parent. Modified: head/sys/arm/arm/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Sun Sep 14 16:46:30 2014 (r271593) +++ head/sys/arm/arm/nexus.c Sun Sep 14 17:36:57 2014 (r271594) @@ -356,16 +356,16 @@ nexus_ofw_map_intr(device_t dev, device_ pcell_t *intr) { fdt_pic_decode_t intr_decode; - phandle_t intr_offset; + phandle_t intr_parent; int i, rv, interrupt, trig, pol; - intr_offset = OF_node_from_xref(iparent); + intr_parent = OF_node_from_xref(iparent); for (i = 0; i < icells; i++) intr[i] = cpu_to_fdt32(intr[i]); for (i = 0; fdt_pic_table[i] != NULL; i++) { intr_decode = fdt_pic_table[i]; - rv = intr_decode(intr_offset, intr, &interrupt, &trig, &pol); + rv = intr_decode(intr_parent, intr, &interrupt, &trig, &pol); if (rv == 0) { /* This was recognized as our PIC and decoded. */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 17:47:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 343FC28A; Sun, 14 Sep 2014 17:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F762122; Sun, 14 Sep 2014 17:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EHl4vM034407; Sun, 14 Sep 2014 17:47:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EHl4KX034406; Sun, 14 Sep 2014 17:47:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409141747.s8EHl4KX034406@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 14 Sep 2014 17:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271595 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 17:47:05 -0000 Author: ian Date: Sun Sep 14 17:47:04 2014 New Revision: 271595 URL: http://svnweb.freebsd.org/changeset/base/271595 Log: Add compat strings for all the flavors of GIC this driver should support. Also allow the driver to attach to ofwbus as well as simplebus, some FDT data puts the root interrupt controller on the root bus. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Sun Sep 14 17:36:57 2014 (r271594) +++ head/sys/arm/arm/gic.c Sun Sep 14 17:47:04 2014 (r271595) @@ -127,6 +127,17 @@ static int gic_config_irq(int irq, enum enum intr_polarity pol); static void gic_post_filter(void *); +static struct ofw_compat_data compat_data[] = { + {"arm,gic", true}, /* Non-standard, used in FreeBSD dts. */ + {"arm,gic-400", true}, + {"arm,cortex-a15-gic", true}, + {"arm,cortex-a9-gic", true}, + {"arm,cortex-a7-gic", true}, + {"arm,arm11mp-gic", true}, + {"brcm,brahma-b15-gic", true}, + {NULL, false} +}; + static int arm_gic_probe(device_t dev) { @@ -134,7 +145,7 @@ arm_gic_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "arm,gic")) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "ARM Generic Interrupt Controller"); return (BUS_PROBE_DEFAULT); @@ -269,6 +280,8 @@ static devclass_t arm_gic_devclass; EARLY_DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(gic, ofwbus, arm_gic_driver, arm_gic_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); static void gic_post_filter(void *arg) From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 18:07:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E08E91F; Sun, 14 Sep 2014 18:07:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58DD22DE; Sun, 14 Sep 2014 18:07:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EI7vgB044524; Sun, 14 Sep 2014 18:07:57 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EI7uNV044519; Sun, 14 Sep 2014 18:07:56 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201409141807.s8EI7uNV044519@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 14 Sep 2014 18:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271596 - in head/sys: fs/nfsclient nfsclient vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 18:07:57 -0000 Author: alc Date: Sun Sep 14 18:07:55 2014 New Revision: 271596 URL: http://svnweb.freebsd.org/changeset/base/271596 Log: Avoid an exclusive acquisition of the object lock on the expected execution path through the NFS clients' getpages functions. Introduce vm_pager_free_nonreq(). This function can be used to eliminate code that is duplicated in many getpages functions. Also, in contrast to the code that currently appears in those getpages functions, vm_pager_free_nonreq() avoids acquiring an exclusive object lock in one case. Reviewed by: kib MFC after: 6 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/nfsclient/nfs_bio.c head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h head/sys/vm/vnode_pager.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Sun Sep 14 17:47:04 2014 (r271595) +++ head/sys/fs/nfsclient/nfs_clbio.c Sun Sep 14 18:07:55 2014 (r271596) @@ -129,23 +129,20 @@ ncl_getpages(struct vop_getpages_args *a npages = btoc(count); /* + * Since the caller has busied the requested page, that page's valid + * field will not be changed by other threads. + */ + vm_page_assert_xbusied(pages[ap->a_reqpage]); + + /* * If the requested page is partially valid, just return it and * allow the pager to zero-out the blanks. Partially valid pages * can only occur at the file EOF. */ - VM_OBJECT_WLOCK(object); if (pages[ap->a_reqpage]->valid != 0) { - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) { - vm_page_lock(pages[i]); - vm_page_free(pages[i]); - vm_page_unlock(pages[i]); - } - } - VM_OBJECT_WUNLOCK(object); - return (0); + vm_pager_free_nonreq(object, pages, ap->a_reqpage, npages); + return (VM_PAGER_OK); } - VM_OBJECT_WUNLOCK(object); /* * We use only the kva address for the buffer, but this is extremely @@ -175,15 +172,7 @@ ncl_getpages(struct vop_getpages_args *a if (error && (uio.uio_resid == count)) { ncl_printf("nfs_getpages: error %d\n", error); - VM_OBJECT_WLOCK(object); - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) { - vm_page_lock(pages[i]); - vm_page_free(pages[i]); - vm_page_unlock(pages[i]); - } - } - VM_OBJECT_WUNLOCK(object); + vm_pager_free_nonreq(object, pages, ap->a_reqpage, npages); return (VM_PAGER_ERROR); } Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Sun Sep 14 17:47:04 2014 (r271595) +++ head/sys/nfsclient/nfs_bio.c Sun Sep 14 18:07:55 2014 (r271596) @@ -123,23 +123,20 @@ nfs_getpages(struct vop_getpages_args *a npages = btoc(count); /* + * Since the caller has busied the requested page, that page's valid + * field will not be changed by other threads. + */ + vm_page_assert_xbusied(pages[ap->a_reqpage]); + + /* * If the requested page is partially valid, just return it and * allow the pager to zero-out the blanks. Partially valid pages * can only occur at the file EOF. */ - VM_OBJECT_WLOCK(object); if (pages[ap->a_reqpage]->valid != 0) { - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) { - vm_page_lock(pages[i]); - vm_page_free(pages[i]); - vm_page_unlock(pages[i]); - } - } - VM_OBJECT_WUNLOCK(object); - return (0); + vm_pager_free_nonreq(object, pages, ap->a_reqpage, npages); + return (VM_PAGER_OK); } - VM_OBJECT_WUNLOCK(object); /* * We use only the kva address for the buffer, but this is extremely @@ -169,15 +166,7 @@ nfs_getpages(struct vop_getpages_args *a if (error && (uio.uio_resid == count)) { nfs_printf("nfs_getpages: error %d\n", error); - VM_OBJECT_WLOCK(object); - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) { - vm_page_lock(pages[i]); - vm_page_free(pages[i]); - vm_page_unlock(pages[i]); - } - } - VM_OBJECT_WUNLOCK(object); + vm_pager_free_nonreq(object, pages, ap->a_reqpage, npages); return (VM_PAGER_ERROR); } Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Sun Sep 14 17:47:04 2014 (r271595) +++ head/sys/vm/vm_pager.c Sun Sep 14 18:07:55 2014 (r271596) @@ -282,6 +282,33 @@ vm_pager_object_lookup(struct pagerlst * } /* + * Free the non-requested pages from the given array. + */ +void +vm_pager_free_nonreq(vm_object_t object, vm_page_t ma[], int reqpage, + int npages) +{ + int i; + boolean_t object_locked; + + VM_OBJECT_ASSERT_UNLOCKED(object); + object_locked = FALSE; + for (i = 0; i < npages; ++i) { + if (i != reqpage) { + if (!object_locked) { + VM_OBJECT_WLOCK(object); + object_locked = TRUE; + } + vm_page_lock(ma[i]); + vm_page_free(ma[i]); + vm_page_unlock(ma[i]); + } + } + if (object_locked) + VM_OBJECT_WUNLOCK(object); +} + +/* * initialize a physical buffer */ Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Sun Sep 14 17:47:04 2014 (r271595) +++ head/sys/vm/vm_pager.h Sun Sep 14 18:07:55 2014 (r271596) @@ -106,6 +106,8 @@ static __inline int vm_pager_get_pages(v static __inline boolean_t vm_pager_has_page(vm_object_t, vm_pindex_t, int *, int *); void vm_pager_init(void); vm_object_t vm_pager_object_lookup(struct pagerlst *, void *); +void vm_pager_free_nonreq(vm_object_t object, vm_page_t ma[], int reqpage, + int npages); /* * vm_page_get_pages: Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Sep 14 17:47:04 2014 (r271595) +++ head/sys/vm/vnode_pager.c Sun Sep 14 18:07:55 2014 (r271596) @@ -722,14 +722,7 @@ vnode_pager_generic_getpages(struct vnod VM_OBJECT_WUNLOCK(object); return (error); } else if (error != 0) { - VM_OBJECT_WLOCK(object); - for (i = 0; i < count; i++) - if (i != reqpage) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - VM_OBJECT_WUNLOCK(object); + vm_pager_free_nonreq(object, m, reqpage, count); return (VM_PAGER_ERROR); /* @@ -739,14 +732,7 @@ vnode_pager_generic_getpages(struct vnod */ } else if ((PAGE_SIZE / bsize) > 1 && (vp->v_mount->mnt_stat.f_type != nfs_mount_type)) { - VM_OBJECT_WLOCK(object); - for (i = 0; i < count; i++) - if (i != reqpage) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - VM_OBJECT_WUNLOCK(object); + vm_pager_free_nonreq(object, m, reqpage, count); PCPU_INC(cnt.v_vnodein); PCPU_INC(cnt.v_vnodepgsin); return vnode_pager_input_smlfs(object, m[reqpage]); From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 18:50:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53F176BA; Sun, 14 Sep 2014 18:50:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2596A8E5; Sun, 14 Sep 2014 18:50:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EIodQ7064178; Sun, 14 Sep 2014 18:50:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EIoc4V064176; Sun, 14 Sep 2014 18:50:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409141850.s8EIoc4V064176@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 14 Sep 2014 18:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271597 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 18:50:39 -0000 Author: dim Date: Sun Sep 14 18:50:38 2014 New Revision: 271597 URL: http://svnweb.freebsd.org/changeset/base/271597 Log: Pull in r217410 from upstream llvm trunk (by Bob Wilson): Set trunc store action to Expand for all X86 targets. When compiling without SSE2, isTruncStoreLegal(F64, F32) would return Legal, whereas with SSE2 it would return Expand. And since the Target doesn't seem to actually handle a truncstore for double -> float, it would just output a store of a full double in the space for a float hence overwriting other bits on the stack. Patch by Luqman Aden! This should fix clang -O0 on i386 assigning garbage to floats, in certain scenarios. PR: 187437 Submitted by: cebd@gmail.com Obtained from: http://llvm.org/viewvc/llvm-project?rev=217410&view=rev MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Sep 14 18:07:55 2014 (r271596) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Sep 14 18:50:38 2014 (r271597) @@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc setTruncStoreAction(MVT::i32, MVT::i8 , Expand); setTruncStoreAction(MVT::i16, MVT::i8, Expand); + setTruncStoreAction(MVT::f64, MVT::f32, Expand); + // SETOEQ and SETUNE require checking two conditions. setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand); setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand); @@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc AddPromotedToType (ISD::SELECT, VT, MVT::v2i64); } - setTruncStoreAction(MVT::f64, MVT::f32, Expand); - // Custom lower v2i64 and v2f64 selects. setOperationAction(ISD::LOAD, MVT::v2f64, Legal); setOperationAction(ISD::LOAD, MVT::v2i64, Legal); From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 21:21:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A75021F1; Sun, 14 Sep 2014 21:21:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8578090D; Sun, 14 Sep 2014 21:21:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ELL41F038613; Sun, 14 Sep 2014 21:21:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ELL4ff038610; Sun, 14 Sep 2014 21:21:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409142121.s8ELL4ff038610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 14 Sep 2014 21:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271601 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 21:21:04 -0000 Author: ian Date: Sun Sep 14 21:21:03 2014 New Revision: 271601 URL: http://svnweb.freebsd.org/changeset/base/271601 Log: Add a common routine for parsing FDT data describing an ARM GIC interrupt. In the fdt data we've written for ourselves, the interrupt properties for GIC interrupts have just been a bare interrupt number. In standard data that conforms to the published bindings, GIC interrupt properties contain 3-tuples that describe the interrupt as shared vs private, the interrupt number within the shared/private address space, and configuration info such as level vs edge triggered. The new gic_decode_fdt() function parses both types of data, based on the #interrupt-cells property. Previously, each platform implemented a decode routine and put a pointer to it into fdt_pic_table. Now they can just list this function in their table instead if they use arm/gic.c. Modified: head/sys/arm/arm/gic.c head/sys/arm/include/intr.h Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Sun Sep 14 20:13:07 2014 (r271600) +++ head/sys/arm/arm/gic.c Sun Sep 14 21:21:03 2014 (r271601) @@ -185,6 +185,51 @@ gic_init_secondary(void) gic_d_write_4(GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F))); } +int +gic_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt, + int *trig, int *pol) +{ + static u_int num_intr_cells; + + if (num_intr_cells == 0) { + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &num_intr_cells, + sizeof(num_intr_cells)) == -1) { + num_intr_cells = 1; + } + } + + if (num_intr_cells == 1) { + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } else { + if (intr[0] == 0) + *interrupt = fdt32_to_cpu(intr[1]) + 32; + else + *interrupt = fdt32_to_cpu(intr[1]); + /* + * In intr[2], bits[3:0] are trigger type and level flags. + * 1 = low-to-high edge triggered + * 2 = high-to-low edge triggered + * 4 = active high level-sensitive + * 8 = active low level-sensitive + * The hardware only supports active-high-level or rising-edge. + */ + if (intr[2] & 0x0a) { + printf("unsupported trigger/polarity configuration " + "0x%2x\n", intr[2] & 0x0f); + return (ENOTSUP); + } + *pol = INTR_POLARITY_CONFORM; + if (intr[2] & 0x01) + *trig = INTR_TRIGGER_EDGE; + else + *trig = INTR_TRIGGER_LEVEL; + } + return (0); +} + static int arm_gic_attach(device_t dev) { Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sun Sep 14 20:13:07 2014 (r271600) +++ head/sys/arm/include/intr.h Sun Sep 14 21:21:03 2014 (r271601) @@ -82,5 +82,7 @@ extern int (*arm_config_irq)(int irq, en void arm_irq_memory_barrier(uintptr_t); void gic_init_secondary(void); +int gic_decode_fdt(uint32_t iparentnode, uint32_t *intrcells, int *interrupt, + int *trig, int *pol); #endif /* _MACHINE_INTR_H */ From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 22:03:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40E60787; Sun, 14 Sep 2014 22:03:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 121A1CC9; Sun, 14 Sep 2014 22:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EM3fSv060210; Sun, 14 Sep 2014 22:03:41 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EM3fo5060209; Sun, 14 Sep 2014 22:03:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201409142203.s8EM3fo5060209@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 14 Sep 2014 22:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271602 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 22:03:42 -0000 Author: jhibbits Date: Sun Sep 14 22:03:41 2014 New Revision: 271602 URL: http://svnweb.freebsd.org/changeset/base/271602 Log: Fix PowerPC backtraces. Since kernel and user have completely separate address spaces, rather than a split address, we actually can't check for being within the kernel's address range. Instead, do what other backtraces do, and use trapexit()/asttrapexit() as the stack sentinel. MFC after: 3 weeks Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_powerpc.c Sun Sep 14 21:21:03 2014 (r271601) +++ head/sys/dev/hwpmc/hwpmc_powerpc.c Sun Sep 14 22:03:41 2014 (r271602) @@ -40,14 +40,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* For VM_MIN_KERNEL_ADDRESS/VM_MAX_KERNEL_ADDRESS */ +#include #include "hwpmc_powerpc.h" -#define INKERNEL(x) (((vm_offset_t)(x)) <= VM_MAX_KERNEL_ADDRESS && \ - ((vm_offset_t)(x)) >= VM_MIN_KERNEL_ADDRESS) -#define INUSER(x) (((vm_offset_t)(x)) <= VM_MAXUSER_ADDRESS && \ - ((vm_offset_t)(x)) >= VM_MIN_ADDRESS) +#ifdef __powerpc64__ +#define OFFSET 4 /* Account for the TOC reload slot */ +#else +#define OFFSET 0 +#endif struct powerpc_cpu **powerpc_pcpu; @@ -56,20 +57,33 @@ pmc_save_kernel_callchain(uintptr_t *cc, struct trapframe *tf) { uintptr_t *osp, *sp; + uintptr_t pc; int frames = 0; cc[frames++] = PMC_TRAPFRAME_TO_PC(tf); sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf); - osp = NULL; + osp = (uintptr_t *)PAGE_SIZE; for (; frames < maxsamples; frames++) { - if (!INKERNEL(sp) || sp <= osp) + if (sp <= osp) break; -#ifdef __powerpc64__ - cc[frames] = sp[2]; -#else - cc[frames] = sp[1]; -#endif + #ifdef __powerpc64__ + pc = sp[2]; + #else + pc = sp[1]; + #endif + if ((pc & 3) || (pc < 0x100)) + break; + + /* + * trapexit() and asttrapexit() are sentinels + * for kernel stack tracing. + * */ + if (pc + OFFSET == (uintptr_t) &trapexit || + pc + OFFSET == (uintptr_t) &asttrapexit) + break; + + cc[frames] = pc; osp = sp; sp = (uintptr_t *)*sp; } @@ -194,7 +208,7 @@ pmc_save_user_callchain(uintptr_t *cc, i osp = NULL; for (; frames < maxsamples; frames++) { - if (!INUSER(sp) || sp <= osp) + if (sp <= osp) break; osp = sp; #ifdef __powerpc64__ From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 22:10:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D25990E; Sun, 14 Sep 2014 22:10:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC5D4CF5; Sun, 14 Sep 2014 22:10:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EMAZjx061816; Sun, 14 Sep 2014 22:10:35 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EMAZkf061814; Sun, 14 Sep 2014 22:10:35 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201409142210.s8EMAZkf061814@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sun, 14 Sep 2014 22:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271603 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 22:10:36 -0000 Author: bryanv Date: Sun Sep 14 22:10:35 2014 New Revision: 271603 URL: http://svnweb.freebsd.org/changeset/base/271603 Log: Add DEF_CLONE_CMD_ARG2 This will be used in the forthcoming vxlan import. Reviewed by: gnn Phabric: https://reviews.freebsd.org/D382 Modified: head/sbin/ifconfig/ifconfig.h Modified: head/sbin/ifconfig/ifconfig.h ============================================================================== --- head/sbin/ifconfig/ifconfig.h Sun Sep 14 22:03:41 2014 (r271602) +++ head/sbin/ifconfig/ifconfig.h Sun Sep 14 22:10:35 2014 (r271603) @@ -74,6 +74,7 @@ void callback_register(callback_func *, #define DEF_CMD_ARG2(name, func) { name, NEXTARG2, { .c_func2 = func }, 0, NULL } #define DEF_CLONE_CMD(name, param, func) { name, param, { .c_func = func }, 1, NULL } #define DEF_CLONE_CMD_ARG(name, func) { name, NEXTARG, { .c_func = func }, 1, NULL } +#define DEF_CLONE_CMD_ARG2(name, func) { name, NEXTARG2, { .c_func2 = func }, 1, NULL } struct ifaddrs; struct addrinfo; From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 22:13:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96A9DB58; Sun, 14 Sep 2014 22:13:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 824DCD89; Sun, 14 Sep 2014 22:13:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8EMDJPH065052; Sun, 14 Sep 2014 22:13:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8EMDJdM065051; Sun, 14 Sep 2014 22:13:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409142213.s8EMDJdM065051@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 14 Sep 2014 22:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271604 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 22:13:19 -0000 Author: mav Date: Sun Sep 14 22:13:19 2014 New Revision: 271604 URL: http://svnweb.freebsd.org/changeset/base/271604 Log: Add couple memory barries to serialize tdq_cpu_idle and tdq_load accesses. This change fixes transient performance drops in some of my benchmarks, vanishing as soon as I am trying to collect any stats from the scheduler. It looks like reordered access to those variables sometimes caused loss of IPI_PREEMPT, that delayed thread execution until some later interrupt. MFC after: 3 days Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Sep 14 22:10:35 2014 (r271603) +++ head/sys/kern/sched_ule.c Sun Sep 14 22:13:19 2014 (r271604) @@ -1037,6 +1037,7 @@ tdq_notify(struct tdq *tdq, struct threa ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; + mb(); if (TD_IS_IDLETHREAD(ctd)) { /* * If the MD code has an idle wakeup routine try that before @@ -2640,6 +2641,7 @@ sched_idletd(void *dummy) /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + mb(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 23:25:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00753F95; Sun, 14 Sep 2014 23:25:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF7C2692; Sun, 14 Sep 2014 23:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ENPAw9097770; Sun, 14 Sep 2014 23:25:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ENPA76097769; Sun, 14 Sep 2014 23:25:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409142325.s8ENPA76097769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 14 Sep 2014 23:25: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: r271605 - stable/10/etc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 23:25:11 -0000 Author: gjb Date: Sun Sep 14 23:25:10 2014 New Revision: 271605 URL: http://svnweb.freebsd.org/changeset/base/271605 Log: Define NO_TESTS instead of WITHOUT_TESTS for the etc/ 'distribute' target to fix the WITH_TESTS=1 build. This is a direct commit to stable/10. Submitted by: ngie Approved by: re (rodrigc) Sponsored by: The FreeBSD Foundation Modified: stable/10/etc/Makefile Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Sun Sep 14 22:13:19 2014 (r271604) +++ stable/10/etc/Makefile Sun Sep 14 23:25:10 2014 (r271605) @@ -177,7 +177,7 @@ afterinstall: distribute: # Avoid installing tests here; "make distribution" will do this and # correctly place them in the right location. - ${_+_}cd ${.CURDIR} ; ${MAKE} WITHOUT_TESTS=1 install \ + ${_+_}cd ${.CURDIR} ; ${MAKE} -DNO_TESTS install \ DESTDIR=${DISTDIR}/${DISTRIBUTION} ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION} From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 23:39:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12CF1260; Sun, 14 Sep 2014 23:39:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2C137C2; Sun, 14 Sep 2014 23:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ENdDD4003084; Sun, 14 Sep 2014 23:39:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ENdDjJ003083; Sun, 14 Sep 2014 23:39:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409142339.s8ENdDjJ003083@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 14 Sep 2014 23:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271606 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 23:39:14 -0000 Author: mav Date: Sun Sep 14 23:39:13 2014 New Revision: 271606 URL: http://svnweb.freebsd.org/changeset/base/271606 Log: Always report that we support REPORT TARGET PORT GROUPS command. Without clustering support we any way have only one group of permanently active ports, but that gives us one more supported VMWare feature. ;) Solaris' Comstar also reports it even when only one port is present. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Sep 14 23:25:10 2014 (r271605) +++ head/sys/cam/ctl/ctl.c Sun Sep 14 23:39:13 2014 (r271606) @@ -10584,9 +10584,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("additional_length = %d\n", inq_ptr->additional_length)); - inq_ptr->spc3_flags = SPC3_SID_3PC; - if (!ctl_is_single) - inq_ptr->spc3_flags |= SPC3_SID_TPGS_IMPLICIT; + inq_ptr->spc3_flags = SPC3_SID_3PC | SPC3_SID_TPGS_IMPLICIT; /* 16 bit addressing */ if (port_type == CTL_PORT_SCSI) inq_ptr->spc2_flags = SPC2_SID_ADDR16; From owner-svn-src-all@FreeBSD.ORG Sun Sep 14 23:48:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB64A3F4; Sun, 14 Sep 2014 23:48:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6E3E86E; Sun, 14 Sep 2014 23:48:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ENmIrb007587; Sun, 14 Sep 2014 23:48:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ENmI3D007585; Sun, 14 Sep 2014 23:48:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409142348.s8ENmI3D007585@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 14 Sep 2014 23:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271607 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 14 Sep 2014 23:48:19 -0000 Author: ian Date: Sun Sep 14 23:48:18 2014 New Revision: 271607 URL: http://svnweb.freebsd.org/changeset/base/271607 Log: Use gic_decode_fdt() rather than a local routine to parse fdt interrupt properties. Move fdt_pic_table and fdt_fixup_table into imx6_machdep.c, which means imx6 doesn't need imx_common.c anymore. Modified: head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Sun Sep 14 23:39:13 2014 (r271606) +++ head/sys/arm/freescale/imx/files.imx6 Sun Sep 14 23:48:18 2014 (r271607) @@ -23,7 +23,6 @@ arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard -arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_iomux.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Sep 14 23:39:13 2014 (r271606) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Sep 14 23:48:18 2014 (r271607) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -46,6 +47,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +fdt_pic_decode_t fdt_pic_table[] = { + &gic_decode_fdt, + NULL +}; + vm_offset_t platform_lastaddr(void) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 02:21:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7C62D21; Mon, 15 Sep 2014 02:21:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92ADC84E; Mon, 15 Sep 2014 02:21:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F2LYEf082143; Mon, 15 Sep 2014 02:21:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F2LYd4082142; Mon, 15 Sep 2014 02:21:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409150221.s8F2LYd4082142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 15 Sep 2014 02:21: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: r271608 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 02:21:34 -0000 Author: gjb Date: Mon Sep 15 02:21:34 2014 New Revision: 271608 URL: http://svnweb.freebsd.org/changeset/base/271608 Log: MFC r271480, r271483, r271491: r271480: Set PKG_CACHEDIR to an 'All/' directory one level lower to fix 'pkg repo' generating repository metadata for the on-disc packages. r271483: Fix duplicate PKG_ABI in the PKG_CACHEDIR path. r271491: Simplify dvd package population with pkg-1.3. Approved by: re (rodrigc) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/scripts/pkg-stage.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/scripts/pkg-stage.sh ============================================================================== --- stable/10/release/scripts/pkg-stage.sh Sun Sep 14 23:48:18 2014 (r271607) +++ stable/10/release/scripts/pkg-stage.sh Mon Sep 15 02:21:34 2014 (r271608) @@ -40,20 +40,17 @@ if [ ! -x /usr/local/sbin/pkg ]; then /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi -PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') -PKG_ABI="${PKG_ABI%\";}" -PKG_ABI="${PKG_ABI#\"}" -export PKG_ABI -export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" +export PKG_ABI=$(pkg config ABI) +export PKG_REPODIR="dvd/packages/${PKG_ABI}" -/bin/mkdir -p ${PKG_CACHEDIR} +/bin/mkdir -p ${PKG_REPODIR} # Print pkg(8) information to make debugging easier. ${PKGCMD} -vv ${PKGCMD} update -f -${PKGCMD} fetch -d ${DVD_PACKAGES} +${PKGCMD} fetch -o ${PKG_REPODIR} -d ${DVD_PACKAGES} -${PKGCMD} repo ${PKG_CACHEDIR} +${PKGCMD} repo ${PKG_REPODIR} # Always exit '0', even if pkg(8) complains about conflicts. exit 0 From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 04:25:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 52F0E77; Mon, 15 Sep 2014 04:25:50 +0000 (UTC) Date: Mon, 15 Sep 2014 04:25:50 +0000 From: Alexey Dokuchaev To: Alexander Motin Subject: Re: svn commit: r271514 - stable/8/sys/dev/sound/pcm Message-ID: <20140915042550.GA15180@FreeBSD.org> References: <201409131522.s8DFM9dT079692@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409131522.s8DFM9dT079692@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 04:25:50 -0000 On Sat, Sep 13, 2014 at 03:22:09PM +0000, Alexander Motin wrote: > New Revision: 271514 > URL: http://svnweb.freebsd.org/changeset/base/271514 > > Log: > MFC r269228: > Add support for SOUND_MIXER_INFO IOCTL, used by gstreamer. Thank you! ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 05:01:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76A1B526; Mon, 15 Sep 2014 05:01:36 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 458ED653CD; Mon, 15 Sep 2014 05:01:35 +0000 (UTC) Message-ID: <54167255.5090806@FreeBSD.org> Date: Mon, 15 Sep 2014 09:00:05 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David C Somayajulu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce References: <201405081940.s48Jebh5041824@svn.freebsd.org> In-Reply-To: <201405081940.s48Jebh5041824@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 05:01:36 -0000 On 08.05.2014 23:40, David C Somayajulu wrote: > Author: davidcs > Date: Thu May 8 19:40:37 2014 > New Revision: 265703 > URL: http://svnweb.freebsd.org/changeset/base/265703 > Modified: head/sys/modules/bce/Makefile > ============================================================================== > --- head/sys/modules/bce/Makefile Thu May 8 19:35:29 2014 (r265702) > +++ head/sys/modules/bce/Makefile Thu May 8 19:40:37 2014 (r265703) > @@ -5,4 +5,9 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii > > #CFLAGS += -DBCE_DEBUG=0 > > +clean: > + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms > + rm -f *.o *.kld *.ko > + rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h > + > .include Hi, why did you override 'clean' target? It works well by default, but now some files don't deleted, e.g. when you build modules with DEBUG_FLAGS. Also the same problem with if_bxe(4) module. -- WBR, Andrey V. Elsukov From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 06:21:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7C0C246; Mon, 15 Sep 2014 06:21:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C25EAF17; Mon, 15 Sep 2014 06:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F6LTWY092197; Mon, 15 Sep 2014 06:21:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F6LSBe092189; Mon, 15 Sep 2014 06:21:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201409150621.s8F6LSBe092189@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Sep 2014 06:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271609 - in head/sys/boot: common i386/gptzfsboot i386/zfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 06:21:30 -0000 Author: avg Date: Mon Sep 15 06:21:28 2014 New Revision: 271609 URL: http://svnweb.freebsd.org/changeset/base/271609 Log: add gptzfsboot.8, zfsboot.8 and zfsloader.8 manual pages Many thanks to Warren Block for his reviews, corrections and additions. Reviewed by: Warren Block MFC after: 1 week Added: head/sys/boot/common/zfsloader.8 (contents, props changed) head/sys/boot/i386/gptzfsboot/gptzfsboot.8 (contents, props changed) head/sys/boot/i386/zfsboot/zfsboot.8 (contents, props changed) Modified: head/sys/boot/common/Makefile.inc head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Mon Sep 15 02:21:34 2014 (r271608) +++ head/sys/boot/common/Makefile.inc Mon Sep 15 06:21:28 2014 (r271609) @@ -78,3 +78,6 @@ CFLAGS+=-I${.CURDIR}/../../../../lib/lib .endif MAN+= loader.8 +.if ${MK_ZFS} != "no" +MAN+= zfsloader.8 +.endif Added: head/sys/boot/common/zfsloader.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/zfsloader.8 Mon Sep 15 06:21:28 2014 (r271609) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2014 Andriy Gapon +.\" 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 September 15, 2014 +.Dt ZFSLOADER 8 +.Os +.Sh NAME +.Nm zfsloader +.Nd kernel bootstrapping final stage +.Sh DESCRIPTION +.Nm +is an extended variant of +.Xr loader 8 +with added support for booting from ZFS. +This document describes only differences from +.Xr loader 8 . +.Sh ZFS FEATURES +.Nm +supports the following format for specifying ZFS filesystems which +can be used wherever +.Xr loader 8 +refers to a device specification: +.Pp +.Ar zfs:pool/filesystem: +.Pp +where +.Pa pool/filesystem +is a ZFS filesystem name as described in +.Xr zfs 8 . +.Pp +If +.Pa /etc/fstab +does not have an entry for the root filesystem and +.Va vfs.root.mountfrom +is not set, but +.Va currdev +refers to a ZFS filesystem, then +.Nm +will instruct kernel to use that filesystem as the root filesystem. +.Sh ZFS COMMAND EXTENSIONS +.Bl -tag -width Ds -compact +.Pp +.It Ic lsdev Op Fl v +Lists ZFS pools in addition to disks and partitions. +Adding +.Fl v +shows more ZFS pool details in a format that resembles +.Nm zpool Cm status +output. +.Pp +.It Ic lszfs Ar filesystem +A ZFS extended command that can be used to explore the ZFS filesystem +hierarchy in a pool. +Lists the immediate children of the +.Ar filesystem . +The filesystem hierarchy is rooted at a filesystem with the same name +as the pool. +.El +.Sh FILES +.Bl -tag -width /boot/zfsloader -compact +.It Pa /boot/zfsloader +.Nm +itself. +.El +.Sh EXAMPLES +Set the default device used for loading a kernel from a ZFS filesystem: +.Pp +.Bd -literal -offset indent +set currdev=zfs:tank/ROOT/knowngood: +.Ed +.Pp +.Sh SEE ALSO +.Xr gptzfsboot 8 , +.Xr loader 8 , +.Xr zfs 8 , +.Xr zfsboot 8 , +.Xr zfsloader 8 , +.Xr zpool 8 +.Sh HISTORY +The +.Nm +first appeared in +.Fx 7.3 . +.Sh AUTHORS +This manual page was written by +.An Andriy Gapon Aq avg@FreeBSD.org . Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Mon Sep 15 02:21:34 2014 (r271608) +++ head/sys/boot/i386/gptzfsboot/Makefile Mon Sep 15 06:21:28 2014 (r271609) @@ -5,6 +5,7 @@ ${.CURDIR}/../../common FILES= gptzfsboot +MAN= gptzfsboot.8 NM?= nm Added: head/sys/boot/i386/gptzfsboot/gptzfsboot.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/gptzfsboot/gptzfsboot.8 Mon Sep 15 06:21:28 2014 (r271609) @@ -0,0 +1,193 @@ +.\" Copyright (c) 2014 Andriy Gapon +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 15, 2014 +.Dt GPTZFSBOOT 8 +.Os +.Sh NAME +.Nm gptzfsboot +.Nd GPT bootcode for ZFS on BIOS-based computers +.Sh DESCRIPTION +.Nm +is used on BIOS-based computers to boot from a filesystem in +a ZFS pool. +.Nm +is installed in a +.Cm freebsd-boot +partition of a GPT-partitioned disk with +.Xr gpart 8 . +.Sh IMPLEMENTATION NOTES +The GPT standard allows a variable number of partitions, but +.Nm +only boots from tables with 128 partitions or less. +.Sh BOOTING +.Nm +tries to find all ZFS pools that are composed of BIOS-visible +hard disks or partitions on them. +.Nm +looks for ZFS device labels on all visible disks and in discovered +supported partitions for all supported partition scheme types. +The search starts with the disk from which +.Nm +itself was loaded. +Other disks are probed in BIOS defined order. +After a disk is probed and +.Nm +determines that the whole disk is not a ZFS pool member, then +individual partitions are probed in their partition table order. +Currently GPT and MBR partition schemes are supported. +With the GPT scheme, only partitions of type +.Cm freebsd-zfs +are probed. +The first pool seen during probing is used as a default boot pool. +.Pp +The filesystem specified by the +.Cm bootfs +property of the pool is used as a default boot filesystem. +If the +.Cm bootfs +property is not set, then the root filesystem of the pool is used as +the default. +.Xr zfsloader 8 +is loaded from the boot filesystem. +If +.Pa /boot.config +or +.Pa /boot/config +is present in the boot filesystem, boot options are read from it +in the same way as +.Xr boot 8 . +.Pp +The ZFS GUIDs of the first successfully probed device and the first +detected pool are made available to +.Xr zfsloader 8 +in the +.Cm vfs.zfs.boot.primary_vdev +and +.Cm vfs.zfs.boot.primary_pool +variables. +.Sh USAGE +Normally +.Nm +will boot in fully automatic mode. +However, like +.Xr boot 8 , +it is possible to interrupt the automatic boot process and interact with +.Nm +through a prompt. +.Nm +accepts all the options that +.Xr boot 8 +supports. +.Pp +Filesystem specification and the path to +.Xr zfsloader 8 +is different from +.Xr boot 8 . +The format is +.Pp +.Sm off +.Oo zfs:pool/filesystem: Oc Oo /path/to/loader Oc +.Sm on +.Pp +Both the filesystem and the path can be specified. +If only a path is specified, then the default filesystem is used. +If only a pool and filesystem are specified, then +.Pa /boot/zfsloader +is used as a path. +.Pp +Additionally, the +.Ic status +command can be used to query information about discovered pools. +The output format is similar to that of +.Cm zpool status +.Pq see Xr zpool 8 . +.Pp +The configured or automatically determined ZFS boot filesystem is +stored in the +.Xr zfsloader 8 +.Cm loaddev +variable, and also set as the initial value of the +.Cm currdev +variable. +.Sh FILES +.Bl -tag -width /boot/gptzfsboot -compact +.It Pa /boot/gptzfsboot +boot code binary +.It Pa /boot.config +parameters for the boot block +.Pq optional +.It Pa /boot/config +alternative parameters for the boot block +.Pq optional +.El +.Sh EXAMPLES +.Nm +is typically installed in combination with a +.Dq protective MBR +.Po +see +.Xr gpart 8 +.Pc . +To install +.Nm +on the +.Pa ada0 +drive: +.Bd -literal -offset indent +gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 +.Ed +.Pp +.Nm +can also be installed without the PMBR: +.Bd -literal -offset indent +gpart bootcode -p /boot/gptzfsboot -i 1 ada0 +.Ed +.Sh SEE ALSO +.Xr boot.config 5 , +.Xr boot 8 , +.Xr gpart 8 , +.Xr loader 8 , +.Xr zfsloader 8 , +.Xr zpool 8 +.Sh HISTORY +.Nm +appeared in FreeBSD 7.3. +.Sh BUGS +.Nm +looks for ZFS meta-data only in MBR partitions +.Pq known on FreeBSD as slices . +It does not look into BSD +.Xr disklabel 8 +partitions that are traditionally called partitions. +If a disklabel partition happens to be placed so that ZFS meta-data can be +found at the fixed offsets relative to a slice, then +.Nm +will recognize the partition as a part of a ZFS pool, +but this is not guaranteed to happen. +.Sh AUTHORS +This manual page was written by +.An Andriy Gapon Aq avg@FreeBSD.org . Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Sep 15 02:21:34 2014 (r271608) +++ head/sys/boot/i386/zfsboot/Makefile Mon Sep 15 06:21:28 2014 (r271609) @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common FILES= zfsboot +MAN= zfsboot.8 NM?= nm Added: head/sys/boot/i386/zfsboot/zfsboot.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/i386/zfsboot/zfsboot.8 Mon Sep 15 06:21:28 2014 (r271609) @@ -0,0 +1,133 @@ +.\" Copyright (c) 2014 Andriy Gapon +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 15, 2014 +.Dt ZFSBOOT 8 +.Os +.Sh NAME +.Nm zfsboot +.Nd bootcode for ZFS on BIOS-based computers +.Sh DESCRIPTION +.Nm +is used on BIOS-based computers to boot from a filesystem in +a ZFS pool. +.Nm +is installed in two parts on a disk or a partition used by a ZFS pool. +The first part, a single-sector starter boot block, is installed +at the beginning of the disk or partition. +The second part, a main boot block, is installed at a special offset +within the disk or partition. +Both areas are reserved by the ZFS on-disk specification for boot use. +If +.Nm +is installed in a partition, then that partition should be made +bootable using appropriate configuration and boot blocks described in +.Xr boot 8 . +.Sh BOOTING +The +.Nm +boot process is very similar to that of +.Xr gptzfsboot 8 . +One significant difference is that +.Nm +does not currently support the GPT partitioning scheme. +Thus only whole disks and MBR partitions, traditionally referred to as +slices, are probed for ZFS disk labels. +See the BUGS section in +.Xr gptzfsboot 8 +for some limitations of the MBR scheme support. +.Sh USAGE +.Nm +supports all the same prompt and configuration file arguments as +.Xr gptzfsboot 8 . +.Sh FILES +.Bl -tag -width /boot/zfsboot -compact +.It Pa /boot/zfsboot +boot code binary +.It Pa /boot.config +parameters for the boot block +.Pq optional +.It Pa /boot/config +alternative parameters for the boot block +.Pq optional +.El +.Sh EXAMPLES +.Nm +is typically installed using +.Xr dd 1 . +To install +.Nm +on the +.Pa ada0 +drive: +.Bd -literal -offset indent +dd if=/boot/zfsboot of=/dev/ada0 count=1 +dd if=/boot/zfsboot of=/dev/ada0 iseek=1 oseek=1024 +.Ed +.Pp +If the drive is currently in use, the GEOM safety will prevent writes +and must be disabled before running the above commands: +.Bd -literal -offset indent +sysctl kern.geom.debugflags=0x10 +.Ed +.Pp +.Nm +can also be installed in an MBR slice: +.Bd -literal -offset indent +gpart create -s mbr ada0 +gpart add -t freebsd ada0 +gpart create -s BSD ada0s1 +gpart bootcode -b /boot/boot0 ada0 +gpart set -a active -i 1 ada0 +dd if=/boot/zfsboot of=/dev/ada0s1 count=1 +dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024 +.Ed +.Pp +Note that commands to create and populate a pool are not shown +in the example above. +.Sh SEE ALSO +.Xr dd 1 , +.Xr boot.config 5 , +.Xr boot 8 , +.Xr gptzfsboot 8 , +.Xr loader 8 , +.Xr zfsloader 8 , +.Xr zpool 8 +.Sh HISTORY +.Nm +appeared in FreeBSD 7.3. +.Sh AUTHORS +This manual page was written by +.An Andriy Gapon Aq avg@FreeBSD.org . +.Sh BUGS +Installing +.Nm +with +.Xr dd 1 +is a hack. +ZFS needs a command to properly install +.Nm +onto a ZFS-controlled disk or partition. From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 07:20:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 794B1E7B; Mon, 15 Sep 2014 07:20:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59BE26BF; Mon, 15 Sep 2014 07:20:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F7Kfj2018303; Mon, 15 Sep 2014 07:20:41 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F7KeJW018298; Mon, 15 Sep 2014 07:20:40 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409150720.s8F7KeJW018298@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 15 Sep 2014 07:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271610 - in head: etc/rc.d 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 07:20:41 -0000 Author: hrs Date: Mon Sep 15 07:20:40 2014 New Revision: 271610 URL: http://svnweb.freebsd.org/changeset/base/271610 Log: Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and net.inet.ip.process_options vnet-aware. Revert changes in r271545. Suggested by: bz Modified: head/etc/rc.d/routing head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_options.c head/sys/netinet/ip_options.h Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Mon Sep 15 06:21:28 2014 (r271609) +++ head/etc/rc.d/routing Mon Sep 15 07:20:40 2014 (r271610) @@ -326,22 +326,20 @@ options_inet() ${SYSCTL} net.inet.ip.forwarding=0 > /dev/null fi - if ! check_jail vnet; then - if checkyesno forward_sourceroute; then - ropts_init inet - echo -n ' do source routing=YES' - ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null - else - ${SYSCTL} net.inet.ip.sourceroute=0 > /dev/null - fi - - if checkyesno accept_sourceroute; then - ropts_init inet - echo -n ' accept source routing=YES' - ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null - else - ${SYSCTL} net.inet.ip.accept_sourceroute=0 > /dev/null - fi + if checkyesno forward_sourceroute; then + ropts_init inet + echo -n ' do source routing=YES' + ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null + else + ${SYSCTL} net.inet.ip.sourceroute=0 > /dev/null + fi + + if checkyesno accept_sourceroute; then + ropts_init inet + echo -n ' accept source routing=YES' + ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null + else + ${SYSCTL} net.inet.ip.accept_sourceroute=0 > /dev/null fi if checkyesno arpproxy_all; then Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Mon Sep 15 06:21:28 2014 (r271609) +++ head/sys/netinet/ip_fastfwd.c Mon Sep 15 07:20:40 2014 (r271610) @@ -296,9 +296,9 @@ ip_fastforward(struct mbuf *m) * Only IP packets without options */ if (ip->ip_hl != (sizeof(struct ip) >> 2)) { - if (ip_doopts == 1) + if (V_ip_doopts == 1) return m; - else if (ip_doopts == 2) { + else if (V_ip_doopts == 2) { icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_FILTER_PROHIB, 0, 0); return NULL; /* mbuf already free'd */ Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Mon Sep 15 06:21:28 2014 (r271609) +++ head/sys/netinet/ip_options.c Mon Sep 15 07:20:40 2014 (r271610) @@ -65,18 +65,21 @@ __FBSDID("$FreeBSD$"); #include -static int ip_dosourceroute = 0; -SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, - &ip_dosourceroute, 0, "Enable forwarding source routed IP packets"); - -static int ip_acceptsourceroute = 0; -SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, - CTLFLAG_RW, &ip_acceptsourceroute, 0, +static VNET_DEFINE(int, ip_dosourceroute); +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, + &VNET_NAME(ip_dosourceroute), 0, + "Enable forwarding source routed IP packets"); +#define V_ip_dosourceroute VNET(ip_dosourceroute) + +static VNET_DEFINE(int, ip_acceptsourceroute); +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, + CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, "Enable accepting source routed IP packets"); +#define V_ip_acceptsourceroute VNET(ip_acceptsourceroute) -int ip_doopts = 1; /* 0 = ignore, 1 = process, 2 = reject */ -SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW, - &ip_doopts, 0, "Enable IP options processing ([LS]SRR, RR, TS)"); +VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject */ +SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW, + &VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, RR, TS)"); static void save_rte(struct mbuf *m, u_char *, struct in_addr); @@ -104,9 +107,9 @@ ip_dooptions(struct mbuf *m, int pass) struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; /* Ignore or reject packets with IP options. */ - if (ip_doopts == 0) + if (V_ip_doopts == 0) return 0; - else if (ip_doopts == 2) { + else if (V_ip_doopts == 2) { type = ICMP_UNREACH; code = ICMP_UNREACH_FILTER_PROHIB; goto bad; @@ -167,7 +170,7 @@ ip_dooptions(struct mbuf *m, int pass) code = ICMP_UNREACH_SRCFAIL; goto bad; } - if (!ip_dosourceroute) + if (!V_ip_dosourceroute) goto nosourcerouting; /* * Loose routing, and not at next destination @@ -180,7 +183,7 @@ ip_dooptions(struct mbuf *m, int pass) /* * End of source route. Should be for us. */ - if (!ip_acceptsourceroute) + if (!V_ip_acceptsourceroute) goto nosourcerouting; save_rte(m, cp, ip->ip_src); break; @@ -189,7 +192,7 @@ ip_dooptions(struct mbuf *m, int pass) if (V_ipstealth) goto dropit; #endif - if (!ip_dosourceroute) { + if (!V_ip_dosourceroute) { if (V_ipforwarding) { char buf[16]; /* aaa.bbb.ccc.ddd\0 */ /* Modified: head/sys/netinet/ip_options.h ============================================================================== --- head/sys/netinet/ip_options.h Mon Sep 15 06:21:28 2014 (r271609) +++ head/sys/netinet/ip_options.h Mon Sep 15 07:20:40 2014 (r271610) @@ -47,7 +47,8 @@ struct ipopt_tag { struct ipoptrt ip_srcrt; }; -extern int ip_doopts; /* process or ignore IP options */ +VNET_DECLARE(int, ip_doopts); /* process or ignore IP options */ +#define V_ip_doopts VNET(ip_doopts) int ip_checkrouteralert(struct mbuf *); int ip_dooptions(struct mbuf *, int); From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 07:48:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73DFAA7F; Mon, 15 Sep 2014 07:48:51 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 58335A0A; Mon, 15 Sep 2014 07:48:51 +0000 (UTC) Received: from bender (unknown [94.5.79.253]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id E3DDB5CBF4; Mon, 15 Sep 2014 07:48:48 +0000 (UTC) Date: Mon, 15 Sep 2014 08:48:38 +0100 From: Andrew Turner To: Ian Lepore Subject: Re: svn commit: r271601 - in head/sys/arm: arm include Message-ID: <20140915084838.7c00e41e@bender> In-Reply-To: <201409142121.s8ELL4ff038610@svn.freebsd.org> References: <201409142121.s8ELL4ff038610@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 07:48:51 -0000 On Sun, 14 Sep 2014 21:21:04 +0000 (UTC) Ian Lepore wrote: ... > Modified: head/sys/arm/arm/gic.c > ============================================================================== > --- head/sys/arm/arm/gic.c Sun Sep 14 20:13:07 2014 > (r271600) +++ head/sys/arm/arm/gic.c Sun Sep 14 21:21:03 > 2014 (r271601) @@ -185,6 +185,51 @@ gic_init_secondary(void) > gic_d_write_4(GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F))); > } > > +int > +gic_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt, > + int *trig, int *pol) > +{ > + static u_int num_intr_cells; > + > + if (num_intr_cells == 0) { > + if (OF_searchencprop(OF_node_from_xref(iparent), > + "#interrupt-cells", &num_intr_cells, > + sizeof(num_intr_cells)) == -1) { > + num_intr_cells = 1; > + } > + } > + > + if (num_intr_cells == 1) { > + *interrupt = fdt32_to_cpu(intr[0]); > + *trig = INTR_TRIGGER_CONFORM; > + *pol = INTR_POLARITY_CONFORM; > + } else { > + if (intr[0] == 0) > + *interrupt = fdt32_to_cpu(intr[1]) + 32; > + else > + *interrupt = fdt32_to_cpu(intr[1]); Shouldn't the PPI case have a +16? The PPI interrupts start from 16 with 0-15 being used for software-generated interrupts. My copy of the binding document state the values for the PPI interrupts should be in the range 0 to 15 meaning they will be assigned an SGI value here. Andrew From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 08:51:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2C0FDAA; Mon, 15 Sep 2014 08:51:28 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 691CE12E; Mon, 15 Sep 2014 08:51:28 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8F8pMin002947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Sep 2014 11:51:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8F8pMin002947 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8F8pMXL002946; Mon, 15 Sep 2014 11:51:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Sep 2014 11:51:22 +0300 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r271604 - head/sys/kern Message-ID: <20140915085122.GF2737@kib.kiev.ua> References: <201409142213.s8EMDJdM065051@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="is+cnpcw8PTJCzZO" Content-Disposition: inline In-Reply-To: <201409142213.s8EMDJdM065051@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 08:51:29 -0000 --is+cnpcw8PTJCzZO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 14, 2014 at 10:13:19PM +0000, Alexander Motin wrote: > Author: mav > Date: Sun Sep 14 22:13:19 2014 > New Revision: 271604 > URL: http://svnweb.freebsd.org/changeset/base/271604 >=20 > Log: > Add couple memory barries to serialize tdq_cpu_idle and tdq_load access= es. Serialize what against what ? It seems what you do is just ensuring that the write to tdq_cpu_idle in sched_idletd() become visible faster than it was before your patch. Memory barrier after the assignment of dq->tdq_cpu_idle =3D 1 flushes write buffers, which makes the tdq_notify() to see the write immediately. Am I right ? If true, this must be commented to explain the stray barriers appearing in the code. > =20 > This change fixes transient performance drops in some of my benchmarks, > vanishing as soon as I am trying to collect any stats from the schedule= r. > It looks like reordered access to those variables sometimes caused loss= of > IPI_PREEMPT, that delayed thread execution until some later interrupt. > =20 > MFC after: 3 days >=20 > Modified: > head/sys/kern/sched_ule.c >=20 > Modified: head/sys/kern/sched_ule.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/sched_ule.c Sun Sep 14 22:10:35 2014 (r271603) > +++ head/sys/kern/sched_ule.c Sun Sep 14 22:13:19 2014 (r271604) > @@ -1037,6 +1037,7 @@ tdq_notify(struct tdq *tdq, struct threa > ctd =3D pcpu_find(cpu)->pc_curthread; > if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) > return; > + mb(); > if (TD_IS_IDLETHREAD(ctd)) { > /* > * If the MD code has an idle wakeup routine try that before > @@ -2640,6 +2641,7 @@ sched_idletd(void *dummy) > =20 > /* Run main MD idle handler. */ > tdq->tdq_cpu_idle =3D 1; > + mb(); > cpu_idle(switchcnt * 4 > sched_idlespinthresh); > tdq->tdq_cpu_idle =3D 0; > =20 I suspect that what you are trying to do could be achieved by using the FreeBSD API, instead of compat shims, in the following way. diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 0a63c01..1ffac22 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1042,7 +1042,8 @@ tdq_notify(struct tdq *tdq, struct thread *td) * If the MD code has an idle wakeup routine try that before * falling back to IPI. */ - if (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) + if (!atomic_load_acq_int(&tdq->tdq_cpu_idle) || + cpu_idle_wakeup(cpu)) return; } tdq->tdq_ipipending =3D 1; @@ -2639,7 +2640,7 @@ sched_idletd(void *dummy) continue; =20 /* Run main MD idle handler. */ - tdq->tdq_cpu_idle =3D 1; + atomic_add_rel_int(&tdq->tdq_cpu_idle, 1); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle =3D 0; =20 --is+cnpcw8PTJCzZO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUFqiKAAoJEJDCuSvBvK1BqaIP+wfjWn7DvvXs98lob6RNVXz7 5Qa5RTnhpVzG8Yw9E3MQ+igbi03ZRkZqcQSjHS62AMyzkFDaWu5u1+awy6Q8puzj jKq3DbVTTidNn5C4Hs4DtmsaAjNdPKL8ieyEwb59nWzTD0lUxu8Khldz5afHiCUS IjwBWZMyKQCWUeLWT15P+5XANOTiN6l4AzfU5DRqJGFIztpzXlP8RZI6OtbvswFh c4Zp7yhyLYMNBakyELxgRa+fvkTRklyd1rZ6OEmGtWcawI42l8LqqlSOoHTXS2k0 6Qt0a5Eb0/qtZWrn4CiIUnCRTzv7rIJv6qt13FVb/MuAFAWGNJPaMxINOqvBSQc8 4Z9ctaQ3PdXD2uLgR1m1N4Ci8enrK83FACiw1dWaZcVCKU5b8Z8ZqNF1vdhNlAnx ZofjwE6kebnuDe3+a6VU/2zfn9nps7prayr7eZE+CaB+SK6T/SPqCrOvRpfKQWlc aKKpiSR3Bui6NNYf9iQWpz5h9SNg50MIas3o7TCaSBMGcUz91M5TLQ+pYKh69TKA dfvakdl2uTk29i/jtq7FeH3/CBQYqghSJFpm+sDHDFAAL3/Q9zbUXXhCsbmRqoBx u3RhklLQaoI58qgqCXNUg9Xl8GPLIXPsNQX/4xer+hHrDWzEwsSJXnSslh0HlAea oAiZWoGfeEmWj5/3fdD7 =MXLW -----END PGP SIGNATURE----- --is+cnpcw8PTJCzZO-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 08:58:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 633DF1CE; Mon, 15 Sep 2014 08:58:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 342DD187; Mon, 15 Sep 2014 08:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F8wIXj064528; Mon, 15 Sep 2014 08:58:18 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F8wIpI064527; Mon, 15 Sep 2014 08:58:18 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409150858.s8F8wIpI064527@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Mon, 15 Sep 2014 08:58:18 +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: r271611 - stable/10/sys/dev/xen/blkfront 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 08:58:18 -0000 Author: royger Date: Mon Sep 15 08:58:17 2014 New Revision: 271611 URL: http://svnweb.freebsd.org/changeset/base/271611 Log: MFC r271099: revert r269814: blkfront: add support for unmapped IO Current busdma code for unmapped bios will not properly align the segment size, causing corruption on blkfront devices. Revert the commit until busdma code is fixed. Reported by: mav Approved by: re Modified: stable/10/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/10/sys/dev/xen/blkfront/blkfront.c Mon Sep 15 07:20:40 2014 (r271610) +++ stable/10/sys/dev/xen/blkfront/blkfront.c Mon Sep 15 08:58:17 2014 (r271611) @@ -272,12 +272,8 @@ xbd_queue_request(struct xbd_softc *sc, { int error; - if (cm->cm_bp != NULL) - error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map, - cm->cm_bp, xbd_queue_cb, cm, 0); - else - error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, - cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0); + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, + cm->cm_datalen, xbd_queue_cb, cm, 0); if (error == EINPROGRESS) { /* * Maintain queuing order by freezing the queue. The next @@ -337,6 +333,8 @@ xbd_bio_command(struct xbd_softc *sc) } cm->cm_bp = bp; + cm->cm_data = bp->bio_data; + cm->cm_datalen = bp->bio_bcount; cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; switch (bp->bio_cmd) { @@ -995,7 +993,7 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; + sc->xbd_disk->d_flags = 0; if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; device_printf(sc->xbd_dev, From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 08:58:19 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B68E1CF; Mon, 15 Sep 2014 08:58:19 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 127AE186; Mon, 15 Sep 2014 08:58:17 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA15369; Mon, 15 Sep 2014 11:58:09 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XTS6r-000JXo-Iv; Mon, 15 Sep 2014 11:58:09 +0300 Message-ID: <5416A9E8.2080403@FreeBSD.org> Date: Mon, 15 Sep 2014 11:57:12 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201409111621.s8BGLpYJ019867@svn.freebsd.org> In-Reply-To: <201409111621.s8BGLpYJ019867@svn.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 08:58:19 -0000 On 11/09/2014 19:21, Steven Hartland wrote: > Author: smh > Date: Thu Sep 11 16:21:51 2014 > New Revision: 271429 > URL: http://svnweb.freebsd.org/changeset/base/271429 > > Log: > Persist vdev_resilver_txg changes to avoid panic caused by validation > vs a vdev_resilver_txg value from a previous resilver. Looks that this change is a prime candidate for a discussion with OpenZFS folks. I know that it is a pain to go through all hoops for submitting a change to illumos, but at the very least we should let them know of the problem. > MFC after: 1 week > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Sep 11 15:36:36 2014 (r271428) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Sep 11 16:21:51 2014 (r271429) > @@ -1951,12 +1951,15 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t > > /* > * If the vdev was resilvering and no longer has any > - * DTLs then reset its resilvering flag. > + * DTLs then reset its resilvering flag and dirty > + * the top level so that we persist the change. > */ > if (vd->vdev_resilver_txg != 0 && > range_tree_space(vd->vdev_dtl[DTL_MISSING]) == 0 && > - range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) > + range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) { > vd->vdev_resilver_txg = 0; > + vdev_config_dirty(vd->vdev_top); > + } > > mutex_exit(&vd->vdev_dtl_lock); > > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 09:04:40 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F103168F; Mon, 15 Sep 2014 09:04:39 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id B2B2E25D; Mon, 15 Sep 2014 09:04:39 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id BDE4120E7088D; Mon, 15 Sep 2014 09:04:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: * X-Spam-Status: No, score=1.3 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id 241E120E70886; Mon, 15 Sep 2014 09:04:30 +0000 (UTC) Message-ID: <1B0D590AE4FF45DFAA7328244352D33F@multiplay.co.uk> From: "Steven Hartland" To: "Andriy Gapon" , , , References: <201409111621.s8BGLpYJ019867@svn.freebsd.org> <5416A9E8.2080403@FreeBSD.org> Subject: Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Mon, 15 Sep 2014 10:04:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 09:04:40 -0000 ----- Original Message ----- From: "Andriy Gapon" > On 11/09/2014 19:21, Steven Hartland wrote: >> Author: smh >> Date: Thu Sep 11 16:21:51 2014 >> New Revision: 271429 >> URL: http://svnweb.freebsd.org/changeset/base/271429 >> >> Log: >> Persist vdev_resilver_txg changes to avoid panic caused by validation >> vs a vdev_resilver_txg value from a previous resilver. > > Looks that this change is a prime candidate for a discussion with OpenZFS folks. > I know that it is a pain to go through all hoops for submitting a change to > illumos, but at the very least we should let them know of the problem. Yep I already raised the bug: https://www.illumos.org/issues/5154 ;-) If I could actually send emails to their mailing list I would have discused but the OpenZFS list has been broken for weeks. I've raised it with Matt, who directed me at Luke but had no response from him :( Regards Steve From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 09:05:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C6147D4; Mon, 15 Sep 2014 09:05:02 +0000 (UTC) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com [IPv6:2a00:1450:4010:c04::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB943261; Mon, 15 Sep 2014 09:05:01 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id c11so4022041lbj.37 for ; Mon, 15 Sep 2014 02:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=gkEzwT+1EI88nn609ONKH3PKrud5hTDZluh6NOwOrIc=; b=nIEAP3zcEWhiV6WrSv2V7md34JakYmdVzjR3i6O+Tg4wIYQ+QvV+0LSBNBKq+PYfu7 4Mi27Buerfd/iwbj1fm8bWDDe9V3eOcWGP86FXQZpjgTKXmQFuwThvC7yYUTx4pr1nyl SnUWNoHnTtegyWnFwKQee16JaG+Q+NnAl3bjF711rB9IDOdqW84JjgWYS2vQTc4SiJxw YpECW2CnLIZ0WbOtta+cvdNQARbJAVwr61zeAnc5r7MW0MH5HY50/V5oAbJe5i8vg9CF 58K5OkjS2EKCuGbqw5Zfb1F0Ju9l0yaLpkpCqxaTidHTznz7e7GmHxleIJ6McerGddLQ nkmg== X-Received: by 10.152.18.130 with SMTP id w2mr1590238lad.89.1410771899309; Mon, 15 Sep 2014 02:04:59 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id pr7sm4029047lbc.18.2014.09.15.02.04.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Sep 2014 02:04:58 -0700 (PDT) Sender: Alexander Motin Message-ID: <5416ABB3.50808@FreeBSD.org> Date: Mon, 15 Sep 2014 12:04:51 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r271604 - head/sys/kern References: <201409142213.s8EMDJdM065051@svn.freebsd.org> <20140915085122.GF2737@kib.kiev.ua> In-Reply-To: <20140915085122.GF2737@kib.kiev.ua> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 09:05:02 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 15.09.2014 11:51, Konstantin Belousov wrote: > On Sun, Sep 14, 2014 at 10:13:19PM +0000, Alexander Motin wrote: >> Author: mav Date: Sun Sep 14 22:13:19 2014 New Revision: 271604 >> URL: http://svnweb.freebsd.org/changeset/base/271604 >> >> Log: Add couple memory barries to serialize tdq_cpu_idle and >> tdq_load accesses. > Serialize what against what ? > > It seems what you do is just ensuring that the write to > tdq_cpu_idle in sched_idletd() become visible faster than it was > before your patch. Memory barrier after the assignment of > dq->tdq_cpu_idle = 1 flushes write buffers, which makes the > tdq_notify() to see the write immediately. Am I right ? Right. My understanding of the problem is that tdq_notify() does not see updated tdq_cpu_idle in time, while cpu_idle() does not see updated tdq_load in time. From my experiments any one of those two barriers appear enough to fix the problem, but I tried to be safe. > If true, this must be commented to explain the stray barriers > appearing in the code. > >> >> This change fixes transient performance drops in some of my >> benchmarks, vanishing as soon as I am trying to collect any stats >> from the scheduler. It looks like reordered access to those >> variables sometimes caused loss of IPI_PREEMPT, that delayed >> thread execution until some later interrupt. >> >> MFC after: 3 days >> >> Modified: head/sys/kern/sched_ule.c >> >> Modified: head/sys/kern/sched_ule.c >> ============================================================================== >> >> - --- head/sys/kern/sched_ule.c Sun Sep 14 22:10:35 2014 (r271603) >> +++ head/sys/kern/sched_ule.c Sun Sep 14 22:13:19 2014 (r271604) >> @@ -1037,6 +1037,7 @@ tdq_notify(struct tdq *tdq, struct threa >> ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, >> ctd->td_priority, 1)) return; + mb(); if (TD_IS_IDLETHREAD(ctd)) >> { /* * If the MD code has an idle wakeup routine try that before >> @@ -2640,6 +2641,7 @@ sched_idletd(void *dummy) >> >> /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + mb(); >> cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle >> = 0; >> > I suspect that what you are trying to do could be achieved by > using the FreeBSD API, instead of compat shims, in the following > way. I was really trying to do it native way originally, but haven't found how. If I understand semantics right, I would need atomic_load_rel() and atomic_store_acq(), but there is no such ones. Second one you successfully replaced by atomic_add_rel(). But I am not sure about the first -- on x86 your idea should work since uses LOCK CMPXCHG, but on other platforms barrier is provided after the load, not before. > diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index > 0a63c01..1ffac22 100644 --- a/sys/kern/sched_ule.c +++ > b/sys/kern/sched_ule.c @@ -1042,7 +1042,8 @@ tdq_notify(struct tdq > *tdq, struct thread *td) * If the MD code has an idle wakeup > routine try that before * falling back to IPI. */ - if > (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) + if > (!atomic_load_acq_int(&tdq->tdq_cpu_idle) || + > cpu_idle_wakeup(cpu)) return; } tdq->tdq_ipipending = 1; @@ -2639,7 > +2640,7 @@ sched_idletd(void *dummy) continue; > > /* Run main MD idle handler. */ - tdq->tdq_cpu_idle = 1; + > atomic_add_rel_int(&tdq->tdq_cpu_idle, 1); cpu_idle(switchcnt * 4 > > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; > > - -- Alexander Motin -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQF8BAEBCgBmBQJUFquzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFOThDRjNDNEU2OUNDM0NEMEU1NzlENTU4 MzE4QzM5NTVCQUIyMjdGAAoJEIMYw5VbqyJ/3LUIAMizmXrjgfoQBLhD25fKhP0w XulDxS4L0xGE17xDW0MTL7BJ8A/xz/nolY8SQFbHe5/7jlueqqG2PoSokrQMHpYw IZ0aYy5rQw+ZgR40zRFbTY1iNdZ7K9QsB6qweWQztSnBvLvlQ0Nx+/YgeDNuHNe1 jWfJjmJLp3gz+/VQOUnHIBdslPS6YplOc5vQmc4NqFGhMplnhzWARJbLqxmYu7JK HmeIP1uVxDEiG82TU+x4n21HehUi2POXAnygLrv0B4xqN4n8pYNyEtknesJiQO0t lyrcXE2vWsDrLMrqCsaZc6pZEXqk8PJ4Og/v6S/XztV/FtrI5Ilqjz/i6e45b8Y= =tfah -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 09:25:36 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C727B2B; Mon, 15 Sep 2014 09:25:36 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF5C65C; Mon, 15 Sep 2014 09:25:34 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA15768; Mon, 15 Sep 2014 12:25:33 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XTSXN-000Ja7-0n; Mon, 15 Sep 2014 12:25:33 +0300 Message-ID: <5416B069.2080708@FreeBSD.org> Date: Mon, 15 Sep 2014 12:24:57 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201409111621.s8BGLpYJ019867@svn.freebsd.org> <5416A9E8.2080403@FreeBSD.org> <1B0D590AE4FF45DFAA7328244352D33F@multiplay.co.uk> In-Reply-To: <1B0D590AE4FF45DFAA7328244352D33F@multiplay.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 09:25:36 -0000 On 15/09/2014 12:04, Steven Hartland wrote: > ----- Original Message ----- From: "Andriy Gapon" > > >> On 11/09/2014 19:21, Steven Hartland wrote: >>> Author: smh >>> Date: Thu Sep 11 16:21:51 2014 >>> New Revision: 271429 >>> URL: http://svnweb.freebsd.org/changeset/base/271429 >>> >>> Log: >>> Persist vdev_resilver_txg changes to avoid panic caused by validation >>> vs a vdev_resilver_txg value from a previous resilver. >> >> Looks that this change is a prime candidate for a discussion with OpenZFS folks. >> I know that it is a pain to go through all hoops for submitting a change to >> illumos, but at the very least we should let them know of the problem. > > Yep I already raised the bug: https://www.illumos.org/issues/5154 ;-) Cool! > If I could actually send emails to their mailing list I would have discused but the > OpenZFS list has been broken for weeks. I've raised it with Matt, who directed > me at Luke but had no response from him :( I haven't try to post to the list for quite a while but I occasionally see posts on it. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 09:34:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AA74D8D; Mon, 15 Sep 2014 09:34:43 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6FD77A9; Mon, 15 Sep 2014 09:34:42 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8F9YXD8012168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Sep 2014 12:34:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8F9YXD8012168 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8F9YXC8012167; Mon, 15 Sep 2014 12:34:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Sep 2014 12:34:33 +0300 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r271604 - head/sys/kern Message-ID: <20140915093433.GI2737@kib.kiev.ua> References: <201409142213.s8EMDJdM065051@svn.freebsd.org> <20140915085122.GF2737@kib.kiev.ua> <5416ABB3.50808@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3j/5DwRpO0pwQS5+" Content-Disposition: inline In-Reply-To: <5416ABB3.50808@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 09:34:43 -0000 --3j/5DwRpO0pwQS5+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 15, 2014 at 12:04:51PM +0300, Alexander Motin wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 >=20 > On 15.09.2014 11:51, Konstantin Belousov wrote: > > On Sun, Sep 14, 2014 at 10:13:19PM +0000, Alexander Motin wrote: > >> Author: mav Date: Sun Sep 14 22:13:19 2014 New Revision: 271604=20 > >> URL: http://svnweb.freebsd.org/changeset/base/271604 > >>=20 > >> Log: Add couple memory barries to serialize tdq_cpu_idle and > >> tdq_load accesses. > > Serialize what against what ? > >=20 > > It seems what you do is just ensuring that the write to > > tdq_cpu_idle in sched_idletd() become visible faster than it was > > before your patch. Memory barrier after the assignment of > > dq->tdq_cpu_idle =3D 1 flushes write buffers, which makes the > > tdq_notify() to see the write immediately. Am I right ? >=20 > Right. My understanding of the problem is that tdq_notify() does not > see updated tdq_cpu_idle in time, while cpu_idle() does not see > updated tdq_load in time. From my experiments any one of those two > barriers appear enough to fix the problem, but I tried to be safe. >=20 > > If true, this must be commented to explain the stray barriers > > appearing in the code. > >=20 > >>=20 > >> This change fixes transient performance drops in some of my > >> benchmarks, vanishing as soon as I am trying to collect any stats > >> from the scheduler. It looks like reordered access to those > >> variables sometimes caused loss of IPI_PREEMPT, that delayed > >> thread execution until some later interrupt. > >>=20 > >> MFC after: 3 days > >>=20 > >> Modified: head/sys/kern/sched_ule.c > >>=20 > >> Modified: head/sys/kern/sched_ule.c=20 > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> > >>=20 > - --- head/sys/kern/sched_ule.c Sun Sep 14 22:10:35 2014 (r271603) > >> +++ head/sys/kern/sched_ule.c Sun Sep 14 22:13:19 2014 (r271604)=20 > >> @@ -1037,6 +1037,7 @@ tdq_notify(struct tdq *tdq, struct threa=20 > >> ctd =3D pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, > >> ctd->td_priority, 1)) return; + mb(); if (TD_IS_IDLETHREAD(ctd)) > >> { /* * If the MD code has an idle wakeup routine try that before=20 > >> @@ -2640,6 +2641,7 @@ sched_idletd(void *dummy) > >>=20 > >> /* Run main MD idle handler. */ tdq->tdq_cpu_idle =3D 1; + mb();=20 > >> cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle > >> =3D 0; > >>=20 > > I suspect that what you are trying to do could be achieved by > > using the FreeBSD API, instead of compat shims, in the following > > way. >=20 > I was really trying to do it native way originally, but haven't found > how. If I understand semantics right, I would need atomic_load_rel() > and atomic_store_acq(), but there is no such ones. Second one you > successfully replaced by atomic_add_rel(). But I am not sure about the > first -- on x86 your idea should work since uses LOCK CMPXCHG, but on > other platforms barrier is provided after the load, not before. No, neither _acq/_rel, nor mb() do not provide formal semantic that you want. The write buffers (on x86), or read/write buffers on other arches are the implementation detail. The API of barriers guarantees the visibility ordering of operations on other cores, and is completely silent about visibility timing. I.e., either your use of mb(), or store_rel() (it uses add_rel() since store_rel() is without lock prefix due to TSO+ on x86) rely on implementation details for x86. This is why I do not see an advantage of using alien API of mb(), and why I said that comment is required to explain what is going on. >=20 > > diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index > > 0a63c01..1ffac22 100644 --- a/sys/kern/sched_ule.c +++ > > b/sys/kern/sched_ule.c @@ -1042,7 +1042,8 @@ tdq_notify(struct tdq > > *tdq, struct thread *td) * If the MD code has an idle wakeup > > routine try that before * falling back to IPI. */ - if > > (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) + if > > (!atomic_load_acq_int(&tdq->tdq_cpu_idle) || + > > cpu_idle_wakeup(cpu)) return; } tdq->tdq_ipipending =3D 1; @@ -2639,7 > > +2640,7 @@ sched_idletd(void *dummy) continue; > >=20 > > /* Run main MD idle handler. */ - tdq->tdq_cpu_idle =3D 1; + > > atomic_add_rel_int(&tdq->tdq_cpu_idle, 1); cpu_idle(switchcnt * 4 > > > sched_idlespinthresh); tdq->tdq_cpu_idle =3D 0; > >=20 > >=20 >=20 >=20 > - --=20 > Alexander Motin > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ >=20 > iQF8BAEBCgBmBQJUFquzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFOThDRjNDNEU2OUNDM0NEMEU1NzlENTU4 > MzE4QzM5NTVCQUIyMjdGAAoJEIMYw5VbqyJ/3LUIAMizmXrjgfoQBLhD25fKhP0w > XulDxS4L0xGE17xDW0MTL7BJ8A/xz/nolY8SQFbHe5/7jlueqqG2PoSokrQMHpYw > IZ0aYy5rQw+ZgR40zRFbTY1iNdZ7K9QsB6qweWQztSnBvLvlQ0Nx+/YgeDNuHNe1 > jWfJjmJLp3gz+/VQOUnHIBdslPS6YplOc5vQmc4NqFGhMplnhzWARJbLqxmYu7JK > HmeIP1uVxDEiG82TU+x4n21HehUi2POXAnygLrv0B4xqN4n8pYNyEtknesJiQO0t > lyrcXE2vWsDrLMrqCsaZc6pZEXqk8PJ4Og/v6S/XztV/FtrI5Ilqjz/i6e45b8Y=3D > =3Dtfah > -----END PGP SIGNATURE----- --3j/5DwRpO0pwQS5+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUFrKpAAoJEJDCuSvBvK1BaMkP/RgRgf+3v0NQ0h/nbZsiSAoP kxBs01szunp8iJoECeKW/ARt/saMeykSMNs5LBs+R87pf3Q/jobSHTNADwdVfjAD 293e8AcA27IBk2B/Zkzb+4KkXE72xSpqsyhfNyCBVNq41u7VX+q86DfQ+KNjS5C3 fhOv84luFzqTnXjTyz7YyxUO1y0uiTz+BaYwR9t6Xu7Cf9mTIwlGO8Im70EeIaAW IQ+ChJDYa9eyP+b//QKiB7fGHqfP1pfZ2ldvtDur12Thi1nNkWrI6+dEXbJ/8yK3 xNNfIoR8DZO97CwgKAfqr1Sxja43AkqRls5erU4/KPX8A+BdhHiiOBkwfK0At40X qv5B2/dkBmWd1KBKZB2hn8pjDrnU6ba6B6CY2iL/xPMI/5AMpcg4KY+gujdy1TK7 ohzTQ5kaY+QBVY7fPEGQnmZuLGQ2wwS/L1AQWfulRjxDjLWBy0hZ+A/0+ZPoZbqx tOkrOckAxEPyWJUQHKM9Ebek5I1w31SKIQAWYUQhUZ5bsUcj15jW1v17WZDwnG1X 18OtW+UBePPGnGforSVHGtk2y01/ceYxo0Htc6qKhSy7OQwIQ7SsjBXRVq3n9E0i XtRi7PwOA5v8LbevbAsS5FiPMgeevx+RRN/MGzi77DHS4WOWdpQtZ4DNHwirqsv/ 5YusJmUFcXhlnvd4TpwS =nNOH -----END PGP SIGNATURE----- --3j/5DwRpO0pwQS5+-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 09:40:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2540EF89; Mon, 15 Sep 2014 09:40:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CD8E7EF; Mon, 15 Sep 2014 09:40:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F9eXQ8084324; Mon, 15 Sep 2014 09:40:33 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F9eVB8084310; Mon, 15 Sep 2014 09:40:31 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409150940.s8F9eVB8084310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 15 Sep 2014 09:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271612 - in vendor/openpam/dist: . bin bin/openpam_dump_policy bin/pamtest bin/su doc doc/man include include/security lib lib/libpam m4 modules modules/pam_deny modules/pam_permit mod... 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 09:40:33 -0000 Author: des Date: Mon Sep 15 09:40:30 2014 New Revision: 271612 URL: http://svnweb.freebsd.org/changeset/base/271612 Log: Vendor import of OpenPAM Ourouparia. Added: vendor/openpam/dist/lib/libpam/openpam_strlset.c vendor/openpam/dist/lib/libpam/openpam_strlset.h Deleted: vendor/openpam/dist/m4/ Modified: vendor/openpam/dist/CREDITS vendor/openpam/dist/HISTORY vendor/openpam/dist/INSTALL vendor/openpam/dist/LICENSE vendor/openpam/dist/Makefile.am vendor/openpam/dist/Makefile.in vendor/openpam/dist/README vendor/openpam/dist/RELNOTES vendor/openpam/dist/TODO vendor/openpam/dist/aclocal.m4 vendor/openpam/dist/autogen.sh vendor/openpam/dist/bin/Makefile.in vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in vendor/openpam/dist/bin/openpam_dump_policy/openpam_dump_policy.c vendor/openpam/dist/bin/pamtest/Makefile.in vendor/openpam/dist/bin/pamtest/pamtest.1 vendor/openpam/dist/bin/su/Makefile.in vendor/openpam/dist/bin/su/su.1 vendor/openpam/dist/config.h.in vendor/openpam/dist/configure vendor/openpam/dist/configure.ac vendor/openpam/dist/doc/Makefile.in vendor/openpam/dist/doc/man/Makefile.in vendor/openpam/dist/doc/man/openpam.3 vendor/openpam/dist/doc/man/openpam_borrow_cred.3 vendor/openpam/dist/doc/man/openpam_free_data.3 vendor/openpam/dist/doc/man/openpam_free_envlist.3 vendor/openpam/dist/doc/man/openpam_get_feature.3 vendor/openpam/dist/doc/man/openpam_get_option.3 vendor/openpam/dist/doc/man/openpam_log.3 vendor/openpam/dist/doc/man/openpam_nullconv.3 vendor/openpam/dist/doc/man/openpam_readline.3 vendor/openpam/dist/doc/man/openpam_readlinev.3 vendor/openpam/dist/doc/man/openpam_readword.3 vendor/openpam/dist/doc/man/openpam_restore_cred.3 vendor/openpam/dist/doc/man/openpam_set_feature.3 vendor/openpam/dist/doc/man/openpam_set_option.3 vendor/openpam/dist/doc/man/openpam_straddch.3 vendor/openpam/dist/doc/man/openpam_subst.3 vendor/openpam/dist/doc/man/openpam_ttyconv.3 vendor/openpam/dist/doc/man/pam.3 vendor/openpam/dist/doc/man/pam.conf.5 vendor/openpam/dist/doc/man/pam_acct_mgmt.3 vendor/openpam/dist/doc/man/pam_authenticate.3 vendor/openpam/dist/doc/man/pam_chauthtok.3 vendor/openpam/dist/doc/man/pam_close_session.3 vendor/openpam/dist/doc/man/pam_conv.3 vendor/openpam/dist/doc/man/pam_end.3 vendor/openpam/dist/doc/man/pam_error.3 vendor/openpam/dist/doc/man/pam_get_authtok.3 vendor/openpam/dist/doc/man/pam_get_data.3 vendor/openpam/dist/doc/man/pam_get_item.3 vendor/openpam/dist/doc/man/pam_get_user.3 vendor/openpam/dist/doc/man/pam_getenv.3 vendor/openpam/dist/doc/man/pam_getenvlist.3 vendor/openpam/dist/doc/man/pam_info.3 vendor/openpam/dist/doc/man/pam_open_session.3 vendor/openpam/dist/doc/man/pam_prompt.3 vendor/openpam/dist/doc/man/pam_putenv.3 vendor/openpam/dist/doc/man/pam_set_data.3 vendor/openpam/dist/doc/man/pam_set_item.3 vendor/openpam/dist/doc/man/pam_setcred.3 vendor/openpam/dist/doc/man/pam_setenv.3 vendor/openpam/dist/doc/man/pam_sm_acct_mgmt.3 vendor/openpam/dist/doc/man/pam_sm_authenticate.3 vendor/openpam/dist/doc/man/pam_sm_chauthtok.3 vendor/openpam/dist/doc/man/pam_sm_close_session.3 vendor/openpam/dist/doc/man/pam_sm_open_session.3 vendor/openpam/dist/doc/man/pam_sm_setcred.3 vendor/openpam/dist/doc/man/pam_start.3 vendor/openpam/dist/doc/man/pam_strerror.3 vendor/openpam/dist/doc/man/pam_verror.3 vendor/openpam/dist/doc/man/pam_vinfo.3 vendor/openpam/dist/doc/man/pam_vprompt.3 vendor/openpam/dist/include/Makefile.in vendor/openpam/dist/include/security/Makefile.in vendor/openpam/dist/include/security/openpam_version.h vendor/openpam/dist/lib/Makefile.am vendor/openpam/dist/lib/Makefile.in vendor/openpam/dist/lib/libpam/Makefile.am vendor/openpam/dist/lib/libpam/Makefile.in vendor/openpam/dist/lib/libpam/openpam_configure.c vendor/openpam/dist/lib/libpam/openpam_ctype.h vendor/openpam/dist/lib/libpam/openpam_dispatch.c vendor/openpam/dist/lib/libpam/openpam_ttyconv.c vendor/openpam/dist/lib/libpam/pam_get_authtok.c vendor/openpam/dist/ltmain.sh vendor/openpam/dist/mkpkgng.in vendor/openpam/dist/modules/Makefile.in vendor/openpam/dist/modules/pam_deny/Makefile.in vendor/openpam/dist/modules/pam_permit/Makefile.in vendor/openpam/dist/modules/pam_unix/Makefile.in vendor/openpam/dist/pamgdb.in vendor/openpam/dist/t/Makefile.am vendor/openpam/dist/t/Makefile.in Modified: vendor/openpam/dist/CREDITS ============================================================================== --- vendor/openpam/dist/CREDITS Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/CREDITS Mon Sep 15 09:40:30 2014 (r271612) @@ -15,6 +15,8 @@ directly or indirectly, with patches, cr ideas: Andrew Morgan + Ankita Pal + Baptiste Daroussin Brian Fundakowski Feldman Christos Zoulas Daniel Richard G. @@ -25,6 +27,7 @@ ideas: Eric Melville Espen Grøndahl Gary Winiger + Gavin Atkinson Gleb Smirnoff Hubert Feyrer Jason Evans @@ -46,5 +49,3 @@ ideas: Takanori Saneto Wojciech A. Koszek Yar Tikhiy - -$Id: CREDITS 648 2013-03-05 17:54:27Z des $ Modified: vendor/openpam/dist/HISTORY ============================================================================== --- vendor/openpam/dist/HISTORY Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/HISTORY Mon Sep 15 09:40:30 2014 (r271612) @@ -1,3 +1,24 @@ +OpenPAM Ourouparia 2014-09-12 + + - ENHANCE: When executing a chain, require at least one service + function to succeed. This mitigates fail-open scenarios caused by + misconfigurations or missing modules. + + - ENHANCE: Make sure to overwrite buffers which may have contained an + authentication token when they're no longer needed. + + - BUGFIX: Under certain circumstances, specifying a non-existent + module (or misspelling the name of a module) in a policy could + result in a fail-open scenario. (CVE-2014-3879) + + - FEATURE: Add a search path for modules. This was implemented in + Nummularia but inadvertently left out of the release notes. + + - BUGFIX: The is_upper() predicate only accepted the letter A as an + upper-case character instead of the entire A-Z range. As a result, + service and module names containing upper-case letters other than A + would be rejected. +============================================================================ OpenPAM Nummularia 2013-09-07 - ENHANCE: Rewrite the dynamic loader to improve readability and @@ -97,7 +118,7 @@ OpenPAM Lycopsida 2011-12-18 module before loading it. - ENHANCE: added / improved input validation in many cases, including - the policy file and some function arguments. + the policy file and some function arguments. (CVE-2011-4122) ============================================================================ OpenPAM Hydrangea 2007-12-21 @@ -427,5 +448,3 @@ Fixed a number of bugs in the previous r OpenPAM Calamite 2002-02-09 First (beta) release. -============================================================================ -$Id: HISTORY 737 2013-09-07 12:53:55Z des $ Modified: vendor/openpam/dist/INSTALL ============================================================================== --- vendor/openpam/dist/INSTALL Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/INSTALL Mon Sep 15 09:40:30 2014 (r271612) @@ -54,5 +54,3 @@ directory: # make install - -$Id: INSTALL 648 2013-03-05 17:54:27Z des $ Modified: vendor/openpam/dist/LICENSE ============================================================================== --- vendor/openpam/dist/LICENSE Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/LICENSE Mon Sep 15 09:40:30 2014 (r271612) @@ -31,5 +31,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIAB 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. - -$Id: LICENSE 648 2013-03-05 17:54:27Z des $ Modified: vendor/openpam/dist/Makefile.am ============================================================================== --- vendor/openpam/dist/Makefile.am Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/Makefile.am Mon Sep 15 09:40:30 2014 (r271612) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 623 2013-02-25 07:24:51Z des $ +# $Id: Makefile.am 816 2014-09-12 07:50:22Z des $ ACLOCAL_AMFLAGS = -I m4 Modified: vendor/openpam/dist/Makefile.in ============================================================================== --- vendor/openpam/dist/Makefile.in Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/Makefile.in Mon Sep 15 09:40:30 2014 (r271612) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 623 2013-02-25 07:24:51Z des $ +# $Id: Makefile.am 816 2014-09-12 07:50:22Z des $ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -84,13 +84,10 @@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in $(srcdir)/pamgdb.in $(srcdir)/mkpkgng.in \ - INSTALL README TODO compile config.guess config.sub depcomp \ - install-sh missing ltmain.sh + INSTALL README TODO compile config.guess config.sub install-sh \ + missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ Modified: vendor/openpam/dist/README ============================================================================== --- vendor/openpam/dist/README Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/README Mon Sep 15 09:40:30 2014 (r271612) @@ -23,5 +23,3 @@ These are some of OpenPAM's features: this will be made configurable in a future release. Please direct bug reports and inquiries to . - -$Id: README 648 2013-03-05 17:54:27Z des $ Modified: vendor/openpam/dist/RELNOTES ============================================================================== --- vendor/openpam/dist/RELNOTES Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/RELNOTES Mon Sep 15 09:40:30 2014 (r271612) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Nummularia - ==================================== + Release notes for OpenPAM Ourouparia + ==================================== This release corresponds to the code used in FreeBSD HEAD as of the release date, and is also expected to work on almost any POSIX-like @@ -20,5 +20,3 @@ The distribution consists of the followi - Unit tests for limited portions of the libraries. Please direct bug reports and inquiries to . - -$Id: RELNOTES 741 2013-09-07 13:34:02Z des $ Modified: vendor/openpam/dist/TODO ============================================================================== --- vendor/openpam/dist/TODO Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/TODO Mon Sep 15 09:40:30 2014 (r271612) @@ -13,5 +13,3 @@ Before the next release: wrapper for) openpam_log() which respects the PAM_SILENT flag and the no_warn module option. This would eliminate the need for FreeBSD's _pam_verbose_error(). - -$Id: TODO 736 2013-09-07 12:52:42Z des $ Modified: vendor/openpam/dist/aclocal.m4 ============================================================================== --- vendor/openpam/dist/aclocal.m4 Mon Sep 15 08:58:17 2014 (r271611) +++ vendor/openpam/dist/aclocal.m4 Mon Sep 15 09:40:30 2014 (r271612) @@ -20,6 +20,8593 @@ You have another version of autoconf. I If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 09:41:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E09613F; Mon, 15 Sep 2014 09:41:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE3487A; Mon, 15 Sep 2014 09:41:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F9fSj4086752; Mon, 15 Sep 2014 09:41:28 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F9fRW8086751; Mon, 15 Sep 2014 09:41:27 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409150941.s8F9fRW8086751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 15 Sep 2014 09:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271613 - vendor/openpam/OUROUPARIA 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 09:41:28 -0000 Author: des Date: Mon Sep 15 09:41:27 2014 New Revision: 271613 URL: http://svnweb.freebsd.org/changeset/base/271613 Log: Tag OpenPAM Ourouparia Added: vendor/openpam/OUROUPARIA/ - copied from r271612, vendor/openpam/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 09:45:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA55B2ED; Mon, 15 Sep 2014 09:45:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B322C8A5; Mon, 15 Sep 2014 09:45:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8F9jB48087786; Mon, 15 Sep 2014 09:45:11 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8F9jBkQ087785; Mon, 15 Sep 2014 09:45:11 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409150945.s8F9jBkQ087785@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 15 Sep 2014 09:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271614 - in head/contrib/openpam: . bin bin/su doc doc/man include include/security misc modules modules/pam_deny modules/pam_permit modules/pam_unix X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 09:45:11 -0000 Author: des Date: Mon Sep 15 09:45:10 2014 New Revision: 271614 URL: http://svnweb.freebsd.org/changeset/base/271614 Log: Remove incorrect props Modified: Directory Properties: head/contrib/openpam/CREDITS (props changed) head/contrib/openpam/HISTORY (props changed) head/contrib/openpam/INSTALL (props changed) head/contrib/openpam/LICENSE (props changed) head/contrib/openpam/Makefile.am (props changed) head/contrib/openpam/Makefile.in (props changed) head/contrib/openpam/README (props changed) head/contrib/openpam/RELNOTES (props changed) head/contrib/openpam/aclocal.m4 (props changed) head/contrib/openpam/autogen.sh (props changed) head/contrib/openpam/bin/Makefile.am (props changed) head/contrib/openpam/bin/Makefile.in (props changed) head/contrib/openpam/bin/su/Makefile.am (props changed) head/contrib/openpam/bin/su/Makefile.in (props changed) head/contrib/openpam/bin/su/su.c (props changed) head/contrib/openpam/compile (props changed) head/contrib/openpam/config.guess (props changed) head/contrib/openpam/config.h.in (props changed) head/contrib/openpam/config.sub (props changed) head/contrib/openpam/configure (props changed) head/contrib/openpam/configure.ac (props changed) head/contrib/openpam/depcomp (props changed) head/contrib/openpam/doc/Makefile.am (props changed) head/contrib/openpam/doc/Makefile.in (props changed) head/contrib/openpam/doc/man/Makefile.am (props changed) head/contrib/openpam/doc/man/Makefile.in (props changed) head/contrib/openpam/doc/man/openpam.3 (props changed) head/contrib/openpam/doc/man/openpam.man (props changed) head/contrib/openpam/doc/man/openpam_borrow_cred.3 (props changed) head/contrib/openpam/doc/man/openpam_free_data.3 (props changed) head/contrib/openpam/doc/man/openpam_free_envlist.3 (props changed) head/contrib/openpam/doc/man/openpam_get_option.3 (props changed) head/contrib/openpam/doc/man/openpam_log.3 (props changed) head/contrib/openpam/doc/man/openpam_nullconv.3 (props changed) head/contrib/openpam/doc/man/openpam_readline.3 (props changed) head/contrib/openpam/doc/man/openpam_restore_cred.3 (props changed) head/contrib/openpam/doc/man/openpam_set_option.3 (props changed) head/contrib/openpam/doc/man/openpam_ttyconv.3 (props changed) head/contrib/openpam/doc/man/pam.3 (props changed) head/contrib/openpam/doc/man/pam.conf.5 (props changed) head/contrib/openpam/doc/man/pam.man (props changed) head/contrib/openpam/doc/man/pam_acct_mgmt.3 (props changed) head/contrib/openpam/doc/man/pam_authenticate.3 (props changed) head/contrib/openpam/doc/man/pam_chauthtok.3 (props changed) head/contrib/openpam/doc/man/pam_close_session.3 (props changed) head/contrib/openpam/doc/man/pam_conv.3 (props changed) head/contrib/openpam/doc/man/pam_end.3 (props changed) head/contrib/openpam/doc/man/pam_error.3 (props changed) head/contrib/openpam/doc/man/pam_get_authtok.3 (props changed) head/contrib/openpam/doc/man/pam_get_data.3 (props changed) head/contrib/openpam/doc/man/pam_get_item.3 (props changed) head/contrib/openpam/doc/man/pam_get_user.3 (props changed) head/contrib/openpam/doc/man/pam_getenv.3 (props changed) head/contrib/openpam/doc/man/pam_getenvlist.3 (props changed) head/contrib/openpam/doc/man/pam_info.3 (props changed) head/contrib/openpam/doc/man/pam_open_session.3 (props changed) head/contrib/openpam/doc/man/pam_prompt.3 (props changed) head/contrib/openpam/doc/man/pam_putenv.3 (props changed) head/contrib/openpam/doc/man/pam_set_data.3 (props changed) head/contrib/openpam/doc/man/pam_set_item.3 (props changed) head/contrib/openpam/doc/man/pam_setcred.3 (props changed) head/contrib/openpam/doc/man/pam_setenv.3 (props changed) head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 (props changed) head/contrib/openpam/doc/man/pam_sm_authenticate.3 (props changed) head/contrib/openpam/doc/man/pam_sm_chauthtok.3 (props changed) head/contrib/openpam/doc/man/pam_sm_close_session.3 (props changed) head/contrib/openpam/doc/man/pam_sm_open_session.3 (props changed) head/contrib/openpam/doc/man/pam_sm_setcred.3 (props changed) head/contrib/openpam/doc/man/pam_start.3 (props changed) head/contrib/openpam/doc/man/pam_strerror.3 (props changed) head/contrib/openpam/doc/man/pam_verror.3 (props changed) head/contrib/openpam/doc/man/pam_vinfo.3 (props changed) head/contrib/openpam/doc/man/pam_vprompt.3 (props changed) head/contrib/openpam/include/Makefile.am (props changed) head/contrib/openpam/include/Makefile.in (props changed) head/contrib/openpam/include/security/Makefile.am (props changed) head/contrib/openpam/include/security/Makefile.in (props changed) head/contrib/openpam/include/security/openpam.h (props changed) head/contrib/openpam/include/security/openpam_attr.h (props changed) head/contrib/openpam/include/security/openpam_version.h (props changed) head/contrib/openpam/include/security/pam_appl.h (props changed) head/contrib/openpam/include/security/pam_constants.h (props changed) head/contrib/openpam/include/security/pam_modules.h (props changed) head/contrib/openpam/include/security/pam_types.h (props changed) head/contrib/openpam/install-sh (props changed) head/contrib/openpam/ltmain.sh (props changed) head/contrib/openpam/misc/gendoc.pl (props changed) head/contrib/openpam/missing (props changed) head/contrib/openpam/modules/Makefile.am (props changed) head/contrib/openpam/modules/Makefile.in (props changed) head/contrib/openpam/modules/pam_deny/Makefile.am (props changed) head/contrib/openpam/modules/pam_deny/Makefile.in (props changed) head/contrib/openpam/modules/pam_deny/pam_deny.c (props changed) head/contrib/openpam/modules/pam_permit/Makefile.am (props changed) head/contrib/openpam/modules/pam_permit/Makefile.in (props changed) head/contrib/openpam/modules/pam_permit/pam_permit.c (props changed) head/contrib/openpam/modules/pam_unix/Makefile.am (props changed) head/contrib/openpam/modules/pam_unix/Makefile.in (props changed) head/contrib/openpam/modules/pam_unix/pam_unix.c (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 10:50:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9216EEA; Mon, 15 Sep 2014 10:50:06 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BB31EEF; Mon, 15 Sep 2014 10:50:05 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8FAo2O1076655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Sep 2014 14:50:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8FAo24Z076654; Mon, 15 Sep 2014 14:50:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 15 Sep 2014 14:50:02 +0400 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r271504 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront net netinet ofed/drivers/net/mlx4 Message-ID: <20140915105002.GQ60617@FreeBSD.org> References: <201409130826.s8D8Q9Wx078339@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409130826.s8D8Q9Wx078339@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 10:50:07 -0000 Hans, I second on Adrians suggestions. Also, this chunk: H> Modified: head/sys/netinet/tcp_output.c H> ============================================================================== H> --- head/sys/netinet/tcp_output.c Sat Sep 13 07:45:03 2014 (r271503) H> +++ head/sys/netinet/tcp_output.c Sat Sep 13 08:26:09 2014 (r271504) H> @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); H> #include H> H> #include H> +#include H> #include H> #include Is it possible to avoid this inclusion? I'd even suggest to push all TSO (or all TCP hardware assistance stuff) into a separate header, that is shared between TCP and drivers, w/o polluting TCP with all ifnet knowledge. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 10:56:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1373015D; Mon, 15 Sep 2014 10:56:57 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AF25FA7; Mon, 15 Sep 2014 10:56:55 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8FAurtl076682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Sep 2014 14:56:53 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8FAurI8076681; Mon, 15 Sep 2014 14:56:53 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 15 Sep 2014 14:56:53 +0400 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r271538 - head/sys/net Message-ID: <20140915105653.GR60617@FreeBSD.org> References: <201409131813.s8DID8vR061538@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409131813.s8DID8vR061538@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 10:56:57 -0000 On Sat, Sep 13, 2014 at 06:13:08PM +0000, Alexander V. Chernikov wrote: A> @@ -1099,15 +1117,39 @@ vlan_transmit(struct ifnet *ifp, struct A> * Send it, precisely as ether_output() would have. A> */ A> error = (p->if_transmit)(p, m); A> - if (!error) { A> - ifp->if_opackets++; A> - ifp->if_omcasts += mcast; A> - ifp->if_obytes += len; A> + if (error == 0) { A> + counter_u64_add(ifv->ifv_opackets, 1); A> + counter_u64_add(ifv->ifv_obytes, len); A> + counter_u64_add(ifv->ifv_omcasts, 1); A> } else A> ifp->if_oerrors++; A> return (error); A> } This looks like counting all packets as multicasts. Strange that compiler didn't warn you about write only variable. P.S. Why did you decide to keep if_oerrors old style? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 11:11:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DC2C502; Mon, 15 Sep 2014 11:11:05 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CCDB1C6; Mon, 15 Sep 2014 11:11:04 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8FBB2AT076733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Sep 2014 15:11:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8FBB2Xe076732; Mon, 15 Sep 2014 15:11:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 15 Sep 2014 15:11:02 +0400 From: Gleb Smirnoff To: Hiroki Sato Subject: Re: svn commit: r271610 - in head: etc/rc.d sys/netinet Message-ID: <20140915111102.GS60617@FreeBSD.org> References: <201409150720.s8F7KeJW018298@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409150720.s8F7KeJW018298@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 11:11:05 -0000 Hiroki, On Mon, Sep 15, 2014 at 07:20:40AM +0000, Hiroki Sato wrote: H> Modified: head/sys/netinet/ip_options.c H> ============================================================================== H> --- head/sys/netinet/ip_options.c Mon Sep 15 06:21:28 2014 (r271609) H> +++ head/sys/netinet/ip_options.c Mon Sep 15 07:20:40 2014 (r271610) H> @@ -65,18 +65,21 @@ __FBSDID("$FreeBSD$"); H> H> #include H> H> -static int ip_dosourceroute = 0; H> -SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, H> - &ip_dosourceroute, 0, "Enable forwarding source routed IP packets"); H> - H> -static int ip_acceptsourceroute = 0; H> -SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, H> - CTLFLAG_RW, &ip_acceptsourceroute, 0, H> +static VNET_DEFINE(int, ip_dosourceroute); H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, H> + &VNET_NAME(ip_dosourceroute), 0, H> + "Enable forwarding source routed IP packets"); H> +#define V_ip_dosourceroute VNET(ip_dosourceroute) H> + H> +static VNET_DEFINE(int, ip_acceptsourceroute); H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, H> + CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, H> "Enable accepting source routed IP packets"); H> +#define V_ip_acceptsourceroute VNET(ip_acceptsourceroute) H> H> -int ip_doopts = 1; /* 0 = ignore, 1 = process, 2 = reject */ H> -SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW, H> - &ip_doopts, 0, "Enable IP options processing ([LS]SRR, RR, TS)"); H> +VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject */ H> +SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW, H> + &VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, RR, TS)"); Since r261590 one doesn't need SYSCTL_VNET_* macros. You can simply add CTLFLAG_VNET to the generic SYSCTL_* macro. I kept old macros due to big amount of code using it, and I was lazy to convert it. But new code shouldn't be added. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 11:14:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED48779C; Mon, 15 Sep 2014 11:14:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D90B51F1; Mon, 15 Sep 2014 11:14:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FBENO3029493; Mon, 15 Sep 2014 11:14:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FBENbn029492; Mon, 15 Sep 2014 11:14:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409151114.s8FBENbn029492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 15 Sep 2014 11:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271615 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 11:14:24 -0000 Author: glebius Date: Mon Sep 15 11:14:23 2014 New Revision: 271615 URL: http://svnweb.freebsd.org/changeset/base/271615 Log: Add a brief description of CTLFLAG_VNET flag. Since the VIMAGE is absolutely not documented, I see no reason in long descriptions here. Modified: head/share/man/man9/sysctl.9 Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Mon Sep 15 09:45:10 2014 (r271614) +++ head/share/man/man9/sysctl.9 Mon Sep 15 11:14:23 2014 (r271615) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2014 +.Dd September 15, 2014 .Dt SYSCTL 9 .Os .Sh NAME @@ -504,6 +504,8 @@ The initial sysctl value is tried fetche enviroment early during module load or system boot. .It Dv CTLFLAG_DYN Dynamically created OIDs automatically get this flag set. +.It Dv CTLFLAG_VNET +OID references a VIMAGE-enabled variable. .El .Sh EXAMPLES Sample use of From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 11:17:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEB5F966; Mon, 15 Sep 2014 11:17:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAE3A21C; Mon, 15 Sep 2014 11:17:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FBHart029968; Mon, 15 Sep 2014 11:17:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FBHatX029967; Mon, 15 Sep 2014 11:17:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409151117.s8FBHatX029967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 15 Sep 2014 11:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271616 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 11:17:36 -0000 Author: mav Date: Mon Sep 15 11:17:36 2014 New Revision: 271616 URL: http://svnweb.freebsd.org/changeset/base/271616 Log: Add comments describing r271604 change. MFC after: 3 days Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Mon Sep 15 11:14:23 2014 (r271615) +++ head/sys/kern/sched_ule.c Mon Sep 15 11:17:36 2014 (r271616) @@ -1037,7 +1037,14 @@ tdq_notify(struct tdq *tdq, struct threa ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; + + /* + * Make sure that tdq_load updated before calling this function + * is globally visible before we read tdq_cpu_idle. Idle thread + * accesses both of them without locks, and the order is important. + */ mb(); + if (TD_IS_IDLETHREAD(ctd)) { /* * If the MD code has an idle wakeup routine try that before @@ -2641,6 +2648,11 @@ sched_idletd(void *dummy) /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + /* + * Make sure that tdq_cpu_idle update is globally visible + * before cpu_idle() read tdq_load. The order is important + * to avoid race with tdq_notify. + */ mb(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 11:32:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C84FBCC0; Mon, 15 Sep 2014 11:32:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B41615FD; Mon, 15 Sep 2014 11:32:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FBW8DU038472; Mon, 15 Sep 2014 11:32:08 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FBW8Zv038471; Mon, 15 Sep 2014 11:32:08 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409151132.s8FBW8Zv038471@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 15 Sep 2014 11:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271617 - head/lib/libpam/modules/pam_login_access X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 11:32:08 -0000 Author: des Date: Mon Sep 15 11:32:08 2014 New Revision: 271617 URL: http://svnweb.freebsd.org/changeset/base/271617 Log: r271256 fixed one segfault condition but introduced another due to the wrong operator being used in the tty check. Reported by: avg@ MFH: 3 days Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c Modified: head/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 15 11:17:36 2014 (r271616) +++ head/lib/libpam/modules/pam_login_access/pam_login_access.c Mon Sep 15 11:32:08 2014 (r271617) @@ -86,7 +86,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int return (PAM_SUCCESS); PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", user, rhost); - } else if (tty != NULL || *(const char *)tty != '\0') { + } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 11:35:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD475F46; Mon, 15 Sep 2014 11:35:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A883263B; Mon, 15 Sep 2014 11:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FBZEiv039070; Mon, 15 Sep 2014 11:35:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FBZEc0039069; Mon, 15 Sep 2014 11:35:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151135.s8FBZEc0039069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 11:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271618 - stable/10/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 11:35:14 -0000 Author: trasz Date: Mon Sep 15 11:35:14 2014 New Revision: 271618 URL: http://svnweb.freebsd.org/changeset/base/271618 Log: MFC r271393: Make it possible to disable NOP-In PDUs by the iSCSI initiator by setting kern.cam.ctl.iscsi.ping_timeout to 0. This fixes interoperability with some initiators that don't properly support NOP-Ins, namely iPXE/gPXE. Approved by: re (kib) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Mon Sep 15 11:32:08 2014 (r271617) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Mon Sep 15 11:35:14 2014 (r271618) @@ -1006,6 +1006,19 @@ cfiscsi_callout(void *context) } #endif + if (ping_timeout <= 0) { + /* + * Pings are disabled. Don't send NOP-In in this case; + * user might have disabled pings to work around problems + * with certain initiators that can't properly handle + * NOP-In, such as iPXE. Reset the timeout, to avoid + * triggering reconnection, should the user decide to + * reenable them. + */ + cs->cs_timeout = 0; + return; + } + if (cs->cs_timeout >= ping_timeout) { CFISCSI_SESSION_WARN(cs, "no ping reply (NOP-Out) after %d seconds; " "dropping connection", ping_timeout); From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 12:28:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 960CDB01; Mon, 15 Sep 2014 12:28:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8097CB76; Mon, 15 Sep 2014 12:28:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FCSU0H062885; Mon, 15 Sep 2014 12:28:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FCSTKg062879; Mon, 15 Sep 2014 12:28:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409151228.s8FCSTKg062879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Sep 2014 12:28:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271619 - in head/sys: fs/ext2fs ufs/ffs vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 12:28:30 -0000 Author: kib Date: Mon Sep 15 12:28:29 2014 New Revision: 271619 URL: http://svnweb.freebsd.org/changeset/base/271619 Log: Provide the unique implementation for the VOP_GETPAGES() method used by ffs and ext2fs. Remove duplicated call to vm_page_zero_invalid(), done by VOP and by vm_pager_getpages(). Use vm_pager_free_nonreq(). Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation MFC after: 6 weeks (after r271596) Modified: head/sys/fs/ext2fs/ext2_vnops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/vm/vnode_pager.c head/sys/vm/vnode_pager.h Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Sep 15 11:35:14 2014 (r271618) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Sep 15 12:28:29 2014 (r271619) @@ -97,7 +97,6 @@ static int ext2_chown(struct vnode *, ui static vop_close_t ext2_close; static vop_create_t ext2_create; static vop_fsync_t ext2_fsync; -static vop_getpages_t ext2_getpages; static vop_getattr_t ext2_getattr; static vop_ioctl_t ext2_ioctl; static vop_link_t ext2_link; @@ -128,7 +127,7 @@ struct vop_vector ext2_vnodeops = { .vop_close = ext2_close, .vop_create = ext2_create, .vop_fsync = ext2_fsync, - .vop_getpages = ext2_getpages, + .vop_getpages = vnode_pager_local_getpages, .vop_getattr = ext2_getattr, .vop_inactive = ext2_inactive, .vop_ioctl = ext2_ioctl, @@ -2063,48 +2062,3 @@ ext2_write(struct vop_write_args *ap) } return (error); } - -/* - * get page routine - */ -static int -ext2_getpages(struct vop_getpages_args *ap) -{ - int i; - vm_page_t mreq; - int pcount; - - mreq = ap->a_m[ap->a_reqpage]; - - /* - * Since the caller has busied the requested page, that page's valid - * field will not be changed by other threads. - */ - vm_page_assert_xbusied(mreq); - - /* - * if ANY DEV_BSIZE blocks are valid on a large filesystem block, - * then the entire page is valid. Since the page may be mapped, - * user programs might reference data beyond the actual end of file - * occuring within the page. We have to zero that data. - */ - if (mreq->valid) { - VM_OBJECT_WLOCK(mreq->object); - if (mreq->valid != VM_PAGE_BITS_ALL) - vm_page_zero_invalid(mreq, TRUE); - pcount = round_page(ap->a_count) / PAGE_SIZE; - for (i = 0; i < pcount; i++) { - if (i != ap->a_reqpage) { - vm_page_lock(ap->a_m[i]); - vm_page_free(ap->a_m[i]); - vm_page_unlock(ap->a_m[i]); - } - } - VM_OBJECT_WUNLOCK(mreq->object); - return VM_PAGER_OK; - } - - return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, - ap->a_count, - ap->a_reqpage); -} Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Mon Sep 15 11:35:14 2014 (r271618) +++ head/sys/ufs/ffs/ffs_vnops.c Mon Sep 15 12:28:29 2014 (r271619) @@ -104,7 +104,6 @@ extern int ffs_rawread(struct vnode *vp, #endif static vop_fsync_t ffs_fsync; static vop_lock1_t ffs_lock; -static vop_getpages_t ffs_getpages; static vop_read_t ffs_read; static vop_write_t ffs_write; static int ffs_extread(struct vnode *vp, struct uio *uio, int ioflag); @@ -124,7 +123,7 @@ static vop_vptofh_t ffs_vptofh; struct vop_vector ffs_vnodeops1 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, - .vop_getpages = ffs_getpages, + .vop_getpages = vnode_pager_local_getpages, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -143,7 +142,7 @@ struct vop_vector ffs_fifoops1 = { struct vop_vector ffs_vnodeops2 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, - .vop_getpages = ffs_getpages, + .vop_getpages = vnode_pager_local_getpages, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -847,53 +846,6 @@ ffs_write(ap) } /* - * get page routine - */ -static int -ffs_getpages(ap) - struct vop_getpages_args *ap; -{ - int i; - vm_page_t mreq; - int pcount; - - mreq = ap->a_m[ap->a_reqpage]; - - /* - * Since the caller has busied the requested page, that page's valid - * field will not be changed by other threads. - */ - vm_page_assert_xbusied(mreq); - - /* - * if ANY DEV_BSIZE blocks are valid on a large filesystem block, - * then the entire page is valid. Since the page may be mapped, - * user programs might reference data beyond the actual end of file - * occuring within the page. We have to zero that data. - */ - if (mreq->valid) { - VM_OBJECT_WLOCK(mreq->object); - if (mreq->valid != VM_PAGE_BITS_ALL) - vm_page_zero_invalid(mreq, TRUE); - pcount = round_page(ap->a_count) / PAGE_SIZE; - for (i = 0; i < pcount; i++) { - if (i != ap->a_reqpage) { - vm_page_lock(ap->a_m[i]); - vm_page_free(ap->a_m[i]); - vm_page_unlock(ap->a_m[i]); - } - } - VM_OBJECT_WUNLOCK(mreq->object); - return VM_PAGER_OK; - } - - return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, - ap->a_count, - ap->a_reqpage); -} - - -/* * Extended attribute area reading. */ static int Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon Sep 15 11:35:14 2014 (r271618) +++ head/sys/vm/vnode_pager.c Mon Sep 15 12:28:29 2014 (r271619) @@ -665,6 +665,39 @@ vnode_pager_getpages(vm_object_t object, } /* + * The implementation of VOP_GETPAGES() for local filesystems, where + * partially valid pages can only occur at the end of file. + */ +int +vnode_pager_local_getpages(struct vop_getpages_args *ap) +{ + vm_page_t mreq; + + mreq = ap->a_m[ap->a_reqpage]; + + /* + * Since the caller has busied the requested page, that page's valid + * field will not be changed by other threads. + */ + vm_page_assert_xbusied(mreq); + + /* + * The requested page has valid blocks. Invalid part can only + * exist at the end of file, and the page is made fully valid + * by zeroing in vm_pager_getpages(). Free non-requested + * pages, since no i/o is done to read its content. + */ + if (mreq->valid != 0) { + vm_pager_free_nonreq(mreq->object, ap->a_m, ap->a_reqpage, + round_page(ap->a_count) / PAGE_SIZE); + return (VM_PAGER_OK); + } + + return (vnode_pager_generic_getpages(ap->a_vp, ap->a_m, + ap->a_count, ap->a_reqpage)); +} + +/* * This is now called from local media FS's to operate against their * own vnodes if they fail to implement VOP_GETPAGES. */ Modified: head/sys/vm/vnode_pager.h ============================================================================== --- head/sys/vm/vnode_pager.h Mon Sep 15 11:35:14 2014 (r271618) +++ head/sys/vm/vnode_pager.h Mon Sep 15 12:28:29 2014 (r271619) @@ -45,6 +45,8 @@ int vnode_pager_generic_getpages(struct int vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *m, int count, boolean_t sync, int *rtvals); +struct vop_getpages_args; +int vnode_pager_local_getpages(struct vop_getpages_args *ap); void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 12:36:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F2A3CFA; Mon, 15 Sep 2014 12:36:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A01CC3F; Mon, 15 Sep 2014 12:36:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FCafeR067308; Mon, 15 Sep 2014 12:36:41 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FCaex0067306; Mon, 15 Sep 2014 12:36:40 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201409151236.s8FCaex0067306@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 15 Sep 2014 12:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271620 - stable/10/sys/dev/ixgbe 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 12:36:41 -0000 Author: brueffer Date: Mon Sep 15 12:36:40 2014 New Revision: 271620 URL: http://svnweb.freebsd.org/changeset/base/271620 Log: MFC: r271286 Use the right constants in comparisons. This is currently a nop, as MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD. Reviewed by: Eric Joyner @ Intel Approved by: re (kib) Modified: stable/10/sys/dev/ixgbe/ixgbe.c stable/10/sys/dev/ixgbe/ixv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:28:29 2014 (r271619) +++ stable/10/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:36:40 2014 (r271620) @@ -517,7 +517,7 @@ ixgbe_attach(device_t dev) } if (((ixgbe_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixgbe_rxd < MIN_TXD || ixgbe_rxd > MAX_TXD) { + ixgbe_rxd < MIN_RXD || ixgbe_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else Modified: stable/10/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixv.c Mon Sep 15 12:28:29 2014 (r271619) +++ stable/10/sys/dev/ixgbe/ixv.c Mon Sep 15 12:36:40 2014 (r271620) @@ -347,7 +347,7 @@ ixv_attach(device_t dev) adapter->num_tx_desc = ixv_txd; if (((ixv_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixv_rxd < MIN_TXD || ixv_rxd > MAX_TXD) { + ixv_rxd < MIN_RXD || ixv_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 12:44:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CEF4F54; Mon, 15 Sep 2014 12:44:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58047D15; Mon, 15 Sep 2014 12:44:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FCij2Y071635; Mon, 15 Sep 2014 12:44:45 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FCiiqE071632; Mon, 15 Sep 2014 12:44:44 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201409151244.s8FCiiqE071632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 15 Sep 2014 12:44: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: r271621 - stable/9/sys/dev/ixgbe 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 12:44:45 -0000 Author: brueffer Date: Mon Sep 15 12:44:44 2014 New Revision: 271621 URL: http://svnweb.freebsd.org/changeset/base/271621 Log: MFC: r271286 Use the right constants in comparisons. This is currently a nop, as MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD. Reviewed by: Eric Joyner @ Intel Approved by: re (kib) Modified: stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:36:40 2014 (r271620) +++ stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:44:44 2014 (r271621) @@ -517,7 +517,7 @@ ixgbe_attach(device_t dev) } if (((ixgbe_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixgbe_rxd < MIN_TXD || ixgbe_rxd > MAX_TXD) { + ixgbe_rxd < MIN_RXD || ixgbe_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else Modified: stable/9/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:36:40 2014 (r271620) +++ stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:44:44 2014 (r271621) @@ -347,7 +347,7 @@ ixv_attach(device_t dev) adapter->num_tx_desc = ixv_txd; if (((ixv_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || - ixv_rxd < MIN_TXD || ixv_rxd > MAX_TXD) { + ixv_rxd < MIN_RXD || ixv_rxd > MAX_RXD) { device_printf(dev, "RXD config issue, using default!\n"); adapter->num_rx_desc = DEFAULT_RXD; } else From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 12:54:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F6E81DF; Mon, 15 Sep 2014 12:54:23 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA8A5E02; Mon, 15 Sep 2014 12:54:22 +0000 (UTC) Received: from [130.235.5.34] (dator-30.onk.lu.se [130.235.5.34]) by mrelayeu.kundenserver.de (node=mreue004) with ESMTP (Nemesis) id 0M9tU4-1XeU8x024e-00B5bI; Mon, 15 Sep 2014 14:54:19 +0200 Message-ID: <5416E174.5040409@FreeBSD.org> Date: Mon, 15 Sep 2014 14:54:12 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r271621 - stable/9/sys/dev/ixgbe References: <201409151244.s8FCiiqE071632@svn.freebsd.org> In-Reply-To: <201409151244.s8FCiiqE071632@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:g+NUu2dvq8uxC/gorxFvtIrOPtsDXqTymFQKa4Y5FUc DER576DwNbe/o+hLLiVkjG+026R95q6GAEaHIsgOlXqggWgjGK 9Jv0SZ1uL3cBkJsCaU66l80ApoBAVZV4WXeTYir8Ipcqp6Xcb+ rt3SUUPkQUone0bMSPMUvMxKBq+vy+vB8tDZbFY91cDoFGQcqb ypIrQeHcxFB1tJK4TjKC0Wo5blgOvptwXMKyxX5nVHVIeCRta5 ARwrR51FvQG1IwwKvdcBPaG4IukP1XcsLG5Y7peBMlZcajNnIi fZFQ7/CC1mzfbuWz/9hL7j67jLz5cv92OKbTb0tdBQvJNvMRHm 3Q7lU3Zb59Th76/Cy+rI= X-UI-Out-Filterresults: notjunk:1; X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 12:54:23 -0000 Not approved by RE of course, since stable/9 is open. Chris On 2014-09-15 14:44, Christian Brueffer wrote: > Author: brueffer > Date: Mon Sep 15 12:44:44 2014 > New Revision: 271621 > URL: http://svnweb.freebsd.org/changeset/base/271621 > > Log: > MFC: r271286 > > Use the right constants in comparisons. This is currently a nop, as > MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD. > > Reviewed by: Eric Joyner @ Intel > Approved by: re (kib) > > Modified: > stable/9/sys/dev/ixgbe/ixgbe.c > stable/9/sys/dev/ixgbe/ixv.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) > stable/9/sys/dev/ixgbe/ (props changed) > > Modified: stable/9/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:36:40 2014 (r271620) > +++ stable/9/sys/dev/ixgbe/ixgbe.c Mon Sep 15 12:44:44 2014 (r271621) > @@ -517,7 +517,7 @@ ixgbe_attach(device_t dev) > } > > if (((ixgbe_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || > - ixgbe_rxd < MIN_TXD || ixgbe_rxd > MAX_TXD) { > + ixgbe_rxd < MIN_RXD || ixgbe_rxd > MAX_RXD) { > device_printf(dev, "RXD config issue, using default!\n"); > adapter->num_rx_desc = DEFAULT_RXD; > } else > > Modified: stable/9/sys/dev/ixgbe/ixv.c > ============================================================================== > --- stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:36:40 2014 (r271620) > +++ stable/9/sys/dev/ixgbe/ixv.c Mon Sep 15 12:44:44 2014 (r271621) > @@ -347,7 +347,7 @@ ixv_attach(device_t dev) > adapter->num_tx_desc = ixv_txd; > > if (((ixv_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 || > - ixv_rxd < MIN_TXD || ixv_rxd > MAX_TXD) { > + ixv_rxd < MIN_RXD || ixv_rxd > MAX_RXD) { > device_printf(dev, "RXD config issue, using default!\n"); > adapter->num_rx_desc = DEFAULT_RXD; > } else > From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 13:01:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 371D93DA; Mon, 15 Sep 2014 13:01:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 222D7ED7; Mon, 15 Sep 2014 13:01:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FD1mjK080780; Mon, 15 Sep 2014 13:01:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FD1lpB080779; Mon, 15 Sep 2014 13:01:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151301.s8FD1lpB080779@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 13:01: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: r271622 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 13:01:48 -0000 Author: trasz Date: Mon Sep 15 13:01:47 2014 New Revision: 271622 URL: http://svnweb.freebsd.org/changeset/base/271622 Log: MFC r271317: Avoid unlocking unlocked mutex in RCTL jail code. Specific test case is attached to PR. PR: 193457 Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Mon Sep 15 12:44:44 2014 (r271621) +++ stable/10/sys/kern/kern_jail.c Mon Sep 15 13:01:47 2014 (r271622) @@ -1811,9 +1811,11 @@ kern_jail_set(struct thread *td, struct #ifdef RACCT if (!created) { - sx_sunlock(&allprison_lock); + if (!(flags & JAIL_ATTACH)) + sx_sunlock(&allprison_lock); prison_racct_modify(pr); - sx_slock(&allprison_lock); + if (!(flags & JAIL_ATTACH)) + sx_slock(&allprison_lock); } #endif From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 13:19:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C196D78C; Mon, 15 Sep 2014 13:19:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC4A0D0; Mon, 15 Sep 2014 13:19:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FDJeCf086488; Mon, 15 Sep 2014 13:19:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FDJeAI086487; Mon, 15 Sep 2014 13:19:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151319.s8FDJeAI086487@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 13:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271623 - stable/10/usr.bin/rctl 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 13:19:40 -0000 Author: trasz Date: Mon Sep 15 13:19:40 2014 New Revision: 271623 URL: http://svnweb.freebsd.org/changeset/base/271623 Log: MFC r271436: Fix typo. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/rctl/rctl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/rctl/rctl.8 ============================================================================== --- stable/10/usr.bin/rctl/rctl.8 Mon Sep 15 13:01:47 2014 (r271622) +++ stable/10/usr.bin/rctl/rctl.8 Mon Sep 15 13:19:40 2014 (r271623) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 16, 2014 +.Dd September 11, 2014 .Dt RCTL 8 .Os .Sh NAME @@ -209,7 +209,7 @@ resource would be .Bl -column -offset 3n "pseudoterminals" .It Em action .It Sy deny Ta deny the allocation; not supported for -.Sy cpu +.Sy cputime and .Sy wallclock .It Sy log Ta "log a warning to the console" From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 13:40:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2676CB36; Mon, 15 Sep 2014 13:40:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA242A2; Mon, 15 Sep 2014 13:40:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FDeCKD095944; Mon, 15 Sep 2014 13:40:12 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FDeAnv095933; Mon, 15 Sep 2014 13:40:10 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409151340.s8FDeAnv095933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 15 Sep 2014 13:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271624 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc contrib/openpam/doc... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 13:40:12 -0000 Author: des Date: Mon Sep 15 13:40:09 2014 New Revision: 271624 URL: http://svnweb.freebsd.org/changeset/base/271624 Log: Upgrade to OpenPAM Ourouparia. Added: head/contrib/openpam/lib/libpam/openpam_strlset.c - copied unchanged from r271612, vendor/openpam/dist/lib/libpam/openpam_strlset.c head/contrib/openpam/lib/libpam/openpam_strlset.h - copied unchanged from r271612, vendor/openpam/dist/lib/libpam/openpam_strlset.h Deleted: head/contrib/openpam/m4/ Modified: head/contrib/openpam/CREDITS head/contrib/openpam/HISTORY head/contrib/openpam/INSTALL head/contrib/openpam/LICENSE head/contrib/openpam/Makefile.am head/contrib/openpam/Makefile.in head/contrib/openpam/README head/contrib/openpam/RELNOTES head/contrib/openpam/TODO head/contrib/openpam/aclocal.m4 head/contrib/openpam/autogen.sh head/contrib/openpam/bin/Makefile.in head/contrib/openpam/bin/openpam_dump_policy/Makefile.in head/contrib/openpam/bin/openpam_dump_policy/openpam_dump_policy.c head/contrib/openpam/bin/pamtest/Makefile.in head/contrib/openpam/bin/pamtest/pamtest.1 head/contrib/openpam/bin/su/Makefile.in head/contrib/openpam/bin/su/su.1 head/contrib/openpam/config.h.in head/contrib/openpam/configure head/contrib/openpam/configure.ac head/contrib/openpam/doc/Makefile.in head/contrib/openpam/doc/man/Makefile.in head/contrib/openpam/doc/man/openpam.3 head/contrib/openpam/doc/man/openpam_borrow_cred.3 head/contrib/openpam/doc/man/openpam_free_data.3 head/contrib/openpam/doc/man/openpam_free_envlist.3 head/contrib/openpam/doc/man/openpam_get_feature.3 head/contrib/openpam/doc/man/openpam_get_option.3 head/contrib/openpam/doc/man/openpam_log.3 head/contrib/openpam/doc/man/openpam_nullconv.3 head/contrib/openpam/doc/man/openpam_readline.3 head/contrib/openpam/doc/man/openpam_readlinev.3 head/contrib/openpam/doc/man/openpam_readword.3 head/contrib/openpam/doc/man/openpam_restore_cred.3 head/contrib/openpam/doc/man/openpam_set_feature.3 head/contrib/openpam/doc/man/openpam_set_option.3 head/contrib/openpam/doc/man/openpam_straddch.3 head/contrib/openpam/doc/man/openpam_subst.3 head/contrib/openpam/doc/man/openpam_ttyconv.3 head/contrib/openpam/doc/man/pam.3 head/contrib/openpam/doc/man/pam.conf.5 head/contrib/openpam/doc/man/pam_acct_mgmt.3 head/contrib/openpam/doc/man/pam_authenticate.3 head/contrib/openpam/doc/man/pam_chauthtok.3 head/contrib/openpam/doc/man/pam_close_session.3 head/contrib/openpam/doc/man/pam_conv.3 head/contrib/openpam/doc/man/pam_end.3 head/contrib/openpam/doc/man/pam_error.3 head/contrib/openpam/doc/man/pam_get_authtok.3 head/contrib/openpam/doc/man/pam_get_data.3 head/contrib/openpam/doc/man/pam_get_item.3 head/contrib/openpam/doc/man/pam_get_user.3 head/contrib/openpam/doc/man/pam_getenv.3 head/contrib/openpam/doc/man/pam_getenvlist.3 head/contrib/openpam/doc/man/pam_info.3 head/contrib/openpam/doc/man/pam_open_session.3 head/contrib/openpam/doc/man/pam_prompt.3 head/contrib/openpam/doc/man/pam_putenv.3 head/contrib/openpam/doc/man/pam_set_data.3 head/contrib/openpam/doc/man/pam_set_item.3 head/contrib/openpam/doc/man/pam_setcred.3 head/contrib/openpam/doc/man/pam_setenv.3 head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 head/contrib/openpam/doc/man/pam_sm_authenticate.3 head/contrib/openpam/doc/man/pam_sm_chauthtok.3 head/contrib/openpam/doc/man/pam_sm_close_session.3 head/contrib/openpam/doc/man/pam_sm_open_session.3 head/contrib/openpam/doc/man/pam_sm_setcred.3 head/contrib/openpam/doc/man/pam_start.3 head/contrib/openpam/doc/man/pam_strerror.3 head/contrib/openpam/doc/man/pam_verror.3 head/contrib/openpam/doc/man/pam_vinfo.3 head/contrib/openpam/doc/man/pam_vprompt.3 head/contrib/openpam/include/Makefile.in head/contrib/openpam/include/security/Makefile.in head/contrib/openpam/include/security/openpam_version.h head/contrib/openpam/lib/Makefile.am head/contrib/openpam/lib/Makefile.in head/contrib/openpam/lib/libpam/Makefile.am head/contrib/openpam/lib/libpam/Makefile.in head/contrib/openpam/lib/libpam/openpam_configure.c head/contrib/openpam/lib/libpam/openpam_ctype.h head/contrib/openpam/lib/libpam/openpam_dispatch.c head/contrib/openpam/lib/libpam/openpam_ttyconv.c head/contrib/openpam/lib/libpam/pam_get_authtok.c head/contrib/openpam/ltmain.sh head/contrib/openpam/mkpkgng.in head/contrib/openpam/modules/Makefile.in head/contrib/openpam/modules/pam_deny/Makefile.in head/contrib/openpam/modules/pam_permit/Makefile.in head/contrib/openpam/modules/pam_unix/Makefile.in head/contrib/openpam/pamgdb.in head/contrib/openpam/t/Makefile.am head/contrib/openpam/t/Makefile.in head/lib/libpam/libpam/Makefile Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/CREDITS ============================================================================== --- head/contrib/openpam/CREDITS Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/CREDITS Mon Sep 15 13:40:09 2014 (r271624) @@ -15,6 +15,8 @@ directly or indirectly, with patches, cr ideas: Andrew Morgan + Ankita Pal + Baptiste Daroussin Brian Fundakowski Feldman Christos Zoulas Daniel Richard G. @@ -25,6 +27,7 @@ ideas: Eric Melville Espen Grøndahl Gary Winiger + Gavin Atkinson Gleb Smirnoff Hubert Feyrer Jason Evans @@ -46,5 +49,3 @@ ideas: Takanori Saneto Wojciech A. Koszek Yar Tikhiy - -$Id: CREDITS 648 2013-03-05 17:54:27Z des $ Modified: head/contrib/openpam/HISTORY ============================================================================== --- head/contrib/openpam/HISTORY Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/HISTORY Mon Sep 15 13:40:09 2014 (r271624) @@ -1,3 +1,24 @@ +OpenPAM Ourouparia 2014-09-12 + + - ENHANCE: When executing a chain, require at least one service + function to succeed. This mitigates fail-open scenarios caused by + misconfigurations or missing modules. + + - ENHANCE: Make sure to overwrite buffers which may have contained an + authentication token when they're no longer needed. + + - BUGFIX: Under certain circumstances, specifying a non-existent + module (or misspelling the name of a module) in a policy could + result in a fail-open scenario. (CVE-2014-3879) + + - FEATURE: Add a search path for modules. This was implemented in + Nummularia but inadvertently left out of the release notes. + + - BUGFIX: The is_upper() predicate only accepted the letter A as an + upper-case character instead of the entire A-Z range. As a result, + service and module names containing upper-case letters other than A + would be rejected. +============================================================================ OpenPAM Nummularia 2013-09-07 - ENHANCE: Rewrite the dynamic loader to improve readability and @@ -97,7 +118,7 @@ OpenPAM Lycopsida 2011-12-18 module before loading it. - ENHANCE: added / improved input validation in many cases, including - the policy file and some function arguments. + the policy file and some function arguments. (CVE-2011-4122) ============================================================================ OpenPAM Hydrangea 2007-12-21 @@ -427,5 +448,3 @@ Fixed a number of bugs in the previous r OpenPAM Calamite 2002-02-09 First (beta) release. -============================================================================ -$Id: HISTORY 737 2013-09-07 12:53:55Z des $ Modified: head/contrib/openpam/INSTALL ============================================================================== --- head/contrib/openpam/INSTALL Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/INSTALL Mon Sep 15 13:40:09 2014 (r271624) @@ -54,5 +54,3 @@ directory: # make install - -$Id: INSTALL 648 2013-03-05 17:54:27Z des $ Modified: head/contrib/openpam/LICENSE ============================================================================== --- head/contrib/openpam/LICENSE Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/LICENSE Mon Sep 15 13:40:09 2014 (r271624) @@ -31,5 +31,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIAB 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. - -$Id: LICENSE 648 2013-03-05 17:54:27Z des $ Modified: head/contrib/openpam/Makefile.am ============================================================================== --- head/contrib/openpam/Makefile.am Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/Makefile.am Mon Sep 15 13:40:09 2014 (r271624) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 623 2013-02-25 07:24:51Z des $ +# $Id: Makefile.am 816 2014-09-12 07:50:22Z des $ ACLOCAL_AMFLAGS = -I m4 Modified: head/contrib/openpam/Makefile.in ============================================================================== --- head/contrib/openpam/Makefile.in Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/Makefile.in Mon Sep 15 13:40:09 2014 (r271624) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 623 2013-02-25 07:24:51Z des $ +# $Id: Makefile.am 816 2014-09-12 07:50:22Z des $ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -84,13 +84,10 @@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in $(srcdir)/pamgdb.in $(srcdir)/mkpkgng.in \ - INSTALL README TODO compile config.guess config.sub depcomp \ - install-sh missing ltmain.sh + INSTALL README TODO compile config.guess config.sub install-sh \ + missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ Modified: head/contrib/openpam/README ============================================================================== --- head/contrib/openpam/README Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/README Mon Sep 15 13:40:09 2014 (r271624) @@ -23,5 +23,3 @@ These are some of OpenPAM's features: this will be made configurable in a future release. Please direct bug reports and inquiries to . - -$Id: README 648 2013-03-05 17:54:27Z des $ Modified: head/contrib/openpam/RELNOTES ============================================================================== --- head/contrib/openpam/RELNOTES Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/RELNOTES Mon Sep 15 13:40:09 2014 (r271624) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Nummularia - ==================================== + Release notes for OpenPAM Ourouparia + ==================================== This release corresponds to the code used in FreeBSD HEAD as of the release date, and is also expected to work on almost any POSIX-like @@ -20,5 +20,3 @@ The distribution consists of the followi - Unit tests for limited portions of the libraries. Please direct bug reports and inquiries to . - -$Id: RELNOTES 741 2013-09-07 13:34:02Z des $ Modified: head/contrib/openpam/TODO ============================================================================== --- head/contrib/openpam/TODO Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/TODO Mon Sep 15 13:40:09 2014 (r271624) @@ -13,5 +13,3 @@ Before the next release: wrapper for) openpam_log() which respects the PAM_SILENT flag and the no_warn module option. This would eliminate the need for FreeBSD's _pam_verbose_error(). - -$Id: TODO 736 2013-09-07 12:52:42Z des $ Modified: head/contrib/openpam/aclocal.m4 ============================================================================== --- head/contrib/openpam/aclocal.m4 Mon Sep 15 13:19:40 2014 (r271623) +++ head/contrib/openpam/aclocal.m4 Mon Sep 15 13:40:09 2014 (r271624) @@ -20,6 +20,8593 @@ You have another version of autoconf. I If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 14:04:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4FA5205; Mon, 15 Sep 2014 14:04:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9002F7B6; Mon, 15 Sep 2014 14:04:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FE4tmT009143; Mon, 15 Sep 2014 14:04:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FE4tgg009142; Mon, 15 Sep 2014 14:04:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151404.s8FE4tgg009142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 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: r271626 - stable/10/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 14:04:55 -0000 Author: trasz Date: Mon Sep 15 14:04:55 2014 New Revision: 271626 URL: http://svnweb.freebsd.org/changeset/base/271626 Log: MFC r271157: Fix typo. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Mon Sep 15 13:59:36 2014 (r271625) +++ stable/10/usr.sbin/ctld/login.c Mon Sep 15 14:04:55 2014 (r271626) @@ -720,8 +720,8 @@ login_negotiate_key(struct pdu *request, "MaxRecvDataSegmentLength"); } if (tmp > MAX_DATA_SEGMENT_LENGTH) { - log_debugx("capping MaxDataSegmentLength from %d to %d", - tmp, MAX_DATA_SEGMENT_LENGTH); + log_debugx("capping MaxRecvDataSegmentLength " + "from %d to %d", tmp, MAX_DATA_SEGMENT_LENGTH); tmp = MAX_DATA_SEGMENT_LENGTH; } conn->conn_max_data_segment_length = tmp; From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 14:21:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CA8370C; Mon, 15 Sep 2014 14:21:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB6B1999; Mon, 15 Sep 2014 14:21:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FELvte018262; Mon, 15 Sep 2014 14:21:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FELviL018261; Mon, 15 Sep 2014 14:21:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151421.s8FELviL018261@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 14:21: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: r271627 - stable/10/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 14:21:58 -0000 Author: trasz Date: Mon Sep 15 14:21:57 2014 New Revision: 271627 URL: http://svnweb.freebsd.org/changeset/base/271627 Log: MFC r271169: Turn two errors, which are possible to trigger only by bugs, into assertions. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 14:04:55 2014 (r271626) +++ stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 14:21:57 2014 (r271627) @@ -1760,9 +1760,7 @@ main_loop(struct conf *conf, bool dont_f client_salen = sizeof(client_sa); kernel_accept(&connection_id, &portal_id, (struct sockaddr *)&client_sa, &client_salen); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); log_debugx("incoming connection, id %d, portal id %d", connection_id, portal_id); @@ -1806,10 +1804,8 @@ found: &client_salen); if (client_fd < 0) log_err(1, "accept"); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, - client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); + handle_connection(portal, client_fd, (struct sockaddr *)&client_sa, dont_fork); From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 14:43:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64E7EF2A; Mon, 15 Sep 2014 14:43:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50548C04; Mon, 15 Sep 2014 14:43:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FEhxSL027763; Mon, 15 Sep 2014 14:43:59 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FEhxYd027762; Mon, 15 Sep 2014 14:43:59 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409151443.s8FEhxYd027762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 15 Sep 2014 14:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271628 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 14:43:59 -0000 Author: hrs Date: Mon Sep 15 14:43:58 2014 New Revision: 271628 URL: http://svnweb.freebsd.org/changeset/base/271628 Log: Use generic SYSCTL_* macro instead of deprecated SYSCTL_VNET_*. Suggested by: glebius Modified: head/sys/netinet/ip_options.c Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Mon Sep 15 14:21:57 2014 (r271627) +++ head/sys/netinet/ip_options.c Mon Sep 15 14:43:58 2014 (r271628) @@ -66,19 +66,19 @@ __FBSDID("$FreeBSD$"); #include static VNET_DEFINE(int, ip_dosourceroute); -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, - &VNET_NAME(ip_dosourceroute), 0, +SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_dosourceroute), 0, "Enable forwarding source routed IP packets"); #define V_ip_dosourceroute VNET(ip_dosourceroute) static VNET_DEFINE(int, ip_acceptsourceroute); -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, - CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, +SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, "Enable accepting source routed IP packets"); #define V_ip_acceptsourceroute VNET(ip_acceptsourceroute) VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject */ -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, RR, TS)"); static void save_rte(struct mbuf *m, u_char *, struct in_addr); From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 14:45:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC3B91AF; Mon, 15 Sep 2014 14:45:46 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.allbsd.org", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 701E1C27; Mon, 15 Sep 2014 14:45:46 +0000 (UTC) Received: from alph.d.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=56) by mail.allbsd.org (8.14.9/8.14.8) with ESMTP id s8FEjJm0072221 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Sep 2014 23:45:30 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.8/8.14.8) with ESMTP id s8FEjIW5024105; Mon, 15 Sep 2014 23:45:19 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 15 Sep 2014 23:44:16 +0900 (JST) Message-Id: <20140915.234416.291650200211280840.hrs@allbsd.org> To: glebius@FreeBSD.org Subject: Re: svn commit: r271610 - in head: etc/rc.d sys/netinet From: Hiroki Sato In-Reply-To: <20140915111102.GS60617@FreeBSD.org> References: <201409150720.s8F7KeJW018298@svn.freebsd.org> <20140915111102.GS60617@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.6 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Sep_15_23_44_16_2014_221)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Mon, 15 Sep 2014 23:45:39 +0900 (JST) X-Spam-Status: No, score=-97.9 required=13.0 tests=CONTENT_TYPE_PRESENT, RDNS_NONE,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 14:45:47 -0000 ----Security_Multipart(Mon_Sep_15_23_44_16_2014_221)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Gleb Smirnoff wrote in <20140915111102.GS60617@FreeBSD.org>: gl> Hiroki, gl> gl> On Mon, Sep 15, 2014 at 07:20:40AM +0000, Hiroki Sato wrote: gl> H> Modified: head/sys/netinet/ip_options.c gl> H> ============================================================================== gl> H> --- head/sys/netinet/ip_options.c Mon Sep 15 06:21:28 2014 (r271609) gl> H> +++ head/sys/netinet/ip_options.c Mon Sep 15 07:20:40 2014 (r271610) gl> H> @@ -65,18 +65,21 @@ __FBSDID("$FreeBSD$"); gl> H> gl> H> #include gl> H> gl> H> -static int ip_dosourceroute = 0; gl> H> -SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, gl> H> - &ip_dosourceroute, 0, "Enable forwarding source routed IP packets"); gl> H> - gl> H> -static int ip_acceptsourceroute = 0; gl> H> -SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, gl> H> - CTLFLAG_RW, &ip_acceptsourceroute, 0, gl> H> +static VNET_DEFINE(int, ip_dosourceroute); gl> H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, gl> H> + &VNET_NAME(ip_dosourceroute), 0, gl> H> + "Enable forwarding source routed IP packets"); gl> H> +#define V_ip_dosourceroute VNET(ip_dosourceroute) gl> H> + gl> H> +static VNET_DEFINE(int, ip_acceptsourceroute); gl> H> +SYSCTL_VNET_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, gl> H> + CTLFLAG_RW, &VNET_NAME(ip_acceptsourceroute), 0, gl> H> "Enable accepting source routed IP packets"); gl> H> +#define V_ip_acceptsourceroute VNET(ip_acceptsourceroute) gl> H> gl> H> -int ip_doopts = 1; /* 0 = ignore, 1 = process, 2 = reject */ gl> H> -SYSCTL_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW, gl> H> - &ip_doopts, 0, "Enable IP options processing ([LS]SRR, RR, TS)"); gl> H> +VNET_DEFINE(int, ip_doopts) = 1; /* 0 = ignore, 1 = process, 2 = reject */ gl> H> +SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, process_options, CTLFLAG_RW, gl> H> + &VNET_NAME(ip_doopts), 0, "Enable IP options processing ([LS]SRR, RR, TS)"); gl> gl> Since r261590 one doesn't need SYSCTL_VNET_* macros. You can simply add gl> CTLFLAG_VNET to the generic SYSCTL_* macro. gl> gl> I kept old macros due to big amount of code using it, and I was lazy gl> to convert it. But new code shouldn't be added. Ah, okay, thank you for pointing out it. Fixed in r271628. -- Hiroki ----Security_Multipart(Mon_Sep_15_23_44_16_2014_221)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlQW+0AACgkQTyzT2CeTzy0XNwCcDWvPyk+baAahx5hlyP5vWzbP CHQAn33IgorWUj5zc2KXD4nFKjpDXeqz =3S1m -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Sep_15_23_44_16_2014_221)---- From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 15:15:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CF88CC9; Mon, 15 Sep 2014 15:15:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 384E1F9E; Mon, 15 Sep 2014 15:15:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FFFrKE042174; Mon, 15 Sep 2014 15:15:53 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FFFrX0042173; Mon, 15 Sep 2014 15:15:53 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409151515.s8FFFrX0042173@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Mon, 15 Sep 2014 15:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271629 - head/sys/x86/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 15:15:53 -0000 Author: royger Date: Mon Sep 15 15:15:52 2014 New Revision: 271629 URL: http://svnweb.freebsd.org/changeset/base/271629 Log: xen: don't set suspend/resume methods for the PIRQ PIC The suspend/resume of event channels is already handled by the xen_intr_pic. If those methods are set on the PIRQ PIC they are just called twice, which breaks proper resume. This fix restores migration of FreeBSD guests to a working state. Sponsored by: Citrix Systems R&D Modified: head/sys/x86/xen/xen_intr.c Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Mon Sep 15 14:43:58 2014 (r271628) +++ head/sys/x86/xen/xen_intr.c Mon Sep 15 15:15:52 2014 (r271629) @@ -179,8 +179,6 @@ struct pic xen_intr_pirq_pic = { .pic_disable_intr = xen_intr_pirq_disable_intr, .pic_vector = xen_intr_vector, .pic_source_pending = xen_intr_source_pending, - .pic_suspend = xen_intr_suspend, - .pic_resume = xen_intr_resume, .pic_config_intr = xen_intr_pirq_config_intr, .pic_assign_cpu = xen_intr_assign_cpu }; From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 15:18:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA1C8E4F; Mon, 15 Sep 2014 15:18:50 +0000 (UTC) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EE70FCB; Mon, 15 Sep 2014 15:18:49 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id n15so1045132lbi.20 for ; Mon, 15 Sep 2014 08:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=nGRMjrjRpDRkWhqL9z6JxXydz449c09WueE4iJzLUss=; b=hEE5c3o+MEGPKixRF1Cl3P+/jLs6kmeG6yjVkE6a51966CY+zVstw4ZuIyqtCJE/8k JJqM5Itj6GUDzq+TM5Iq3vx4jsPi9AQ5LIhgfTA31rdCZbA7d1M6vcLr/hYWM6M3woII P53MDHMFmir7f+/mr6l5HANOPmpPZ/XJ54Yf1i/bL/RF80Vo2nD/+JMoCfRJZbYqPDuf XwBbgWSnyC4D4aGQk/mxB7AIvz6xvvtPQ+8Dx7p5Cp3BeQDMvnCGQYQSTPS7dXMdLeZB YSu1bIweoShPAFLi8MNBHG5NcmnNbCLIg8JucYuE31o86aZcuff18CJ9eExY02AA94Dx 9Lwg== MIME-Version: 1.0 X-Received: by 10.152.18.130 with SMTP id w2mr4041869lad.89.1410794327271; Mon, 15 Sep 2014 08:18:47 -0700 (PDT) Sender: mahrens@gmail.com Received: by 10.112.140.228 with HTTP; Mon, 15 Sep 2014 08:18:47 -0700 (PDT) In-Reply-To: <1B0D590AE4FF45DFAA7328244352D33F@multiplay.co.uk> References: <201409111621.s8BGLpYJ019867@svn.freebsd.org> <5416A9E8.2080403@FreeBSD.org> <1B0D590AE4FF45DFAA7328244352D33F@multiplay.co.uk> Date: Mon, 15 Sep 2014 08:18:47 -0700 X-Google-Sender-Auth: 3wrbXT1TSMNMtdMntR4F-E9TLy8 Message-ID: Subject: Re: svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Matthew Ahrens To: Steven Hartland Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 15:18:50 -0000 On Mon, Sep 15, 2014 at 2:04 AM, Steven Hartland wrote: > ----- Original Message ----- From: "Andriy Gapon" > > > On 11/09/2014 19:21, Steven Hartland wrote: >> >>> Author: smh >>> Date: Thu Sep 11 16:21:51 2014 >>> New Revision: 271429 >>> URL: http://svnweb.freebsd.org/changeset/base/271429 >>> >>> Log: >>> Persist vdev_resilver_txg changes to avoid panic caused by validation >>> vs a vdev_resilver_txg value from a previous resilver. >>> >> >> Looks that this change is a prime candidate for a discussion with OpenZFS >> folks. >> I know that it is a pain to go through all hoops for submitting a change >> to >> illumos, but at the very least we should let them know of the problem. >> > > Yep I already raised the bug: https://www.illumos.org/issues/5154 ;-) > > I don't know that anyone reads illumos bug submissions (I don't). > If I could actually send emails to their mailing list I would have > discused but the > OpenZFS list has been broken for weeks. I've raised it with Matt, who > directed > me at Luke but had no response from him :( > > The list works fine for me. Keep bugging Luke. You can also bug Martin ( mm@freebsd.org). --matt From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 15:36:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F90ABC1; Mon, 15 Sep 2014 15:36:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AF6732A; Mon, 15 Sep 2014 15:36:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FFa0o4051802; Mon, 15 Sep 2014 15:36:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FFa0Jw051800; Mon, 15 Sep 2014 15:36:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409151536.s8FFa0Jw051800@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 15 Sep 2014 15:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271630 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 15:36:00 -0000 Author: ian Date: Mon Sep 15 15:36:00 2014 New Revision: 271630 URL: http://svnweb.freebsd.org/changeset/base/271630 Log: The private peripheral interrupts start at offset 16, not 0. Also, use names rather than inline mystery constants for these offsets. Pointed out by: andrew Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Mon Sep 15 15:15:52 2014 (r271629) +++ head/sys/arm/arm/gic.c Mon Sep 15 15:36:00 2014 (r271630) @@ -83,7 +83,11 @@ __FBSDID("$FreeBSD$"); #define GICC_ABPR 0x001C /* v1 ICCABPR */ #define GICC_IIDR 0x00FC /* v1 ICCIIDR*/ -#define GIC_LAST_IPI 15 /* Irqs 0-15 are IPIs. */ +#define GIC_FIRST_IPI 0 /* Irqs 0-15 are SGIs/IPIs. */ +#define GIC_LAST_IPI 15 +#define GIC_FIRST_PPI 16 /* Irqs 16-31 are private (per */ +#define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ +#define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ /* First bit is a polarity bit (0 - low, 1 - high) */ #define GICD_ICFGR_POL_LOW (0 << 0) @@ -205,9 +209,9 @@ gic_decode_fdt(uint32_t iparent, uint32_ *pol = INTR_POLARITY_CONFORM; } else { if (intr[0] == 0) - *interrupt = fdt32_to_cpu(intr[1]) + 32; + *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_SPI; else - *interrupt = fdt32_to_cpu(intr[1]); + *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_PPI; /* * In intr[2], bits[3:0] are trigger type and level flags. * 1 = low-to-high edge triggered From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 15:49:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A674FA; Mon, 15 Sep 2014 15:49:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2594369F; Mon, 15 Sep 2014 15:49:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FFnUWQ056900; Mon, 15 Sep 2014 15:49:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FFnUhl056899; Mon, 15 Sep 2014 15:49:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409151549.s8FFnUhl056899@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 15 Sep 2014 15:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271631 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 15:49:31 -0000 Author: glebius Date: Mon Sep 15 15:49:29 2014 New Revision: 271631 URL: http://svnweb.freebsd.org/changeset/base/271631 Log: Remove redundant declaration. vnode.h should be included before vnode_pager.h. Modified: head/sys/vm/vnode_pager.h Modified: head/sys/vm/vnode_pager.h ============================================================================== --- head/sys/vm/vnode_pager.h Mon Sep 15 15:36:00 2014 (r271630) +++ head/sys/vm/vnode_pager.h Mon Sep 15 15:49:29 2014 (r271631) @@ -45,7 +45,6 @@ int vnode_pager_generic_getpages(struct int vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *m, int count, boolean_t sync, int *rtvals); -struct vop_getpages_args; int vnode_pager_local_getpages(struct vop_getpages_args *ap); void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 16:31:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBE40239; Mon, 15 Sep 2014 16:31:21 +0000 (UTC) Received: from mx0a-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5B1FBE3; Mon, 15 Sep 2014 16:31:21 +0000 (UTC) Received: from pps.filterd (m0045602.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.14.5/8.14.5) with SMTP id s8FGJYu7014812; Mon, 15 Sep 2014 09:31:15 -0700 Received: from avcashub1.qlogic.com (avcashub2.qlogic.com [198.70.193.116]) by mx0a-0016ce01.pphosted.com with ESMTP id 1patsxh2nk-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 15 Sep 2014 09:31:15 -0700 Received: from AVMB1.qlogic.org ([fe80::c919:8cc:f3ba:c727]) by avcashub2.qlogic.org ([::1]) with mapi id 14.02.0387.000; Mon, 15 Sep 2014 09:31:15 -0700 From: David Somayajulu To: "Andrey V. Elsukov" , David C Somayajulu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Thread-Topic: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Thread-Index: AQHPavVn2jiHLJpVI0alLPpTagQEkZwC40GAgABIDUA= Date: Mon, 15 Sep 2014 16:31:13 +0000 Message-ID: <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> References: <201405081940.s48Jebh5041824@svn.freebsd.org> <54167255.5090806@FreeBSD.org> In-Reply-To: <54167255.5090806@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.4.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=7561 signatures=670520 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409150142 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 16:31:22 -0000 Hi Andrey, When I didn't have the clean override, "make clean" was not cleaning prope= rly when I built a standalone loadable driver. Perhaps we can change "clean= " in bxe/Makefile and bce/Makefile to "dclean". Thanks David S. -----Original Message----- From: Andrey V. Elsukov [mailto:ae@FreeBSD.org] Sent: Sunday, September 14, 2014 10:00 PM To: David C Somayajulu; src-committers@freebsd.org; svn-src-all@freebsd.org= ; svn-src-head@freebsd.org Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/= dev/bxe sys/modules/bce On 08.05.2014 23:40, David C Somayajulu wrote: > Author: davidcs > Date: Thu May 8 19:40:37 2014 > New Revision: 265703 > URL: http://svnweb.freebsd.org/changeset/base/265703 > Modified: head/sys/modules/bce/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/modules/bce/Makefile Thu May 8 19:35:29 2014 (r2= 65702) > +++ head/sys/modules/bce/Makefile Thu May 8 19:40:37 2014 (r2= 65703) > @@ -5,4 +5,9 @@ SRCS=3D opt_bce.h if_bce.c miibus_if.h mii > > #CFLAGS +=3D -DBCE_DEBUG=3D0 > > +clean: > + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms > + rm -f *.o *.kld *.ko > + rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h > + > .include Hi, why did you override 'clean' target? It works well by default, but now some files don't deleted, e.g. when you b= uild modules with DEBUG_FLAGS. Also the same problem with if_bxe(4) module. -- WBR, Andrey V. Elsukov ________________________________ This message and any attached documents contain information from QLogic Cor= poration or its wholly-owned subsidiaries that may be confidential. If you = are not the intended recipient, you may not read, copy, distribute, or use = this information. If you have received this transmission in error, please n= otify the sender immediately by reply e-mail and then delete this message. From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 16:40:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 408925ED; Mon, 15 Sep 2014 16:40:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11827CD3; Mon, 15 Sep 2014 16:40:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FGeRMk080814; Mon, 15 Sep 2014 16:40:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FGeRhm080813; Mon, 15 Sep 2014 16:40:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409151640.s8FGeRhm080813@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Sep 2014 16:40: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: r271632 - stable/10/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 16:40:28 -0000 Author: trasz Date: Mon Sep 15 16:40:27 2014 New Revision: 271632 URL: http://svnweb.freebsd.org/changeset/base/271632 Log: MFC r271187: Avoid ctld(8) crash on getaddrinfo(3) failure. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 15:49:29 2014 (r271631) +++ stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 16:40:27 2014 (r271632) @@ -561,8 +561,10 @@ portal_new(struct portal_group *pg) static void portal_delete(struct portal *portal) { + TAILQ_REMOVE(&portal->p_portal_group->pg_portals, portal, p_next); - freeaddrinfo(portal->p_ai); + if (portal->p_ai != NULL) + freeaddrinfo(portal->p_ai); free(portal->p_listen); free(portal); } @@ -633,8 +635,7 @@ portal_group_add_listen(struct portal_gr arg = portal->p_listen; if (arg[0] == '\0') { log_warnx("empty listen address"); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } if (arg[0] == '[') { @@ -646,8 +647,7 @@ portal_group_add_listen(struct portal_gr if (arg == NULL) { log_warnx("invalid listen address %s", portal->p_listen); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } if (arg[0] == '\0') { @@ -657,8 +657,7 @@ portal_group_add_listen(struct portal_gr } else { log_warnx("invalid listen address %s", portal->p_listen); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } } else { @@ -691,8 +690,7 @@ portal_group_add_listen(struct portal_gr if (error != 0) { log_warnx("getaddrinfo for %s failed: %s", portal->p_listen, gai_strerror(error)); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 16:47:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 337478AC; Mon, 15 Sep 2014 16:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E371DCB; Mon, 15 Sep 2014 16:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FGl4UY085012; Mon, 15 Sep 2014 16:47:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FGl4V3085011; Mon, 15 Sep 2014 16:47:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409151647.s8FGl4V3085011@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Sep 2014 16:47: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: r271633 - stable/10/release/powerpc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 16:47:05 -0000 Author: emaste Date: Mon Sep 15 16:47:04 2014 New Revision: 271633 URL: http://svnweb.freebsd.org/changeset/base/271633 Log: MFC r265171 by nwhitehorn: Use mkimg instead of md(4) and gpart [for powerpc]. Approved by: re Modified: stable/10/release/powerpc/make-memstick.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/powerpc/make-memstick.sh ============================================================================== --- stable/10/release/powerpc/make-memstick.sh Mon Sep 15 16:40:27 2014 (r271632) +++ stable/10/release/powerpc/make-memstick.sh Mon Sep 15 16:47:04 2014 (r271633) @@ -41,38 +41,7 @@ if [ $? -ne 0 ]; then fi rm ${1}/etc/fstab -# -# Use $BLOCKSIZE for transfers to improve efficiency. When calculating -# how many blocks to transfer "+ 2" is to account for truncation in the -# division and to provide space for the label. -# - -filesize=`stat -f "%z" ${tempfile}` -blocks=$(($filesize / ${BLOCKSIZE} + 1728)) -dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} -if [ $? -ne 0 ]; then - echo "creation of image file failed" - exit 1 -fi - -unit=`mdconfig -a -t vnode -f ${2}` -if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 -fi - -gpart create -s APM ${unit} -gpart add -t freebsd-boot -s 800K ${unit} -gpart bootcode -p ${1}/boot/boot1.hfs -i 1 ${unit} -gpart add -t freebsd-ufs -l FreeBSD_Install ${unit} - -dd if=${tempfile} of=/dev/${unit}s3 bs=$BLOCKSIZE conv=sync -if [ $? -ne 0 ]; then - echo "copying filesystem into image file failed" - exit 1 -fi - -mdconfig -d -u ${unit} +mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} rm -f ${tempfile} From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 17:14:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AED4158; Mon, 15 Sep 2014 17:14:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB031CC; Mon, 15 Sep 2014 17:14:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FHE9ru098964; Mon, 15 Sep 2014 17:14:09 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FHE9Lk098963; Mon, 15 Sep 2014 17:14:09 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201409151714.s8FHE9Lk098963@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 15 Sep 2014 17:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271634 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 17:14:10 -0000 Author: alc Date: Mon Sep 15 17:14:09 2014 New Revision: 271634 URL: http://svnweb.freebsd.org/changeset/base/271634 Log: Three improvements to vnode_pager_generic_getpages(): Eliminate an exclusive object lock acquisition and release on the expected execution path. Do page zeroing before the object lock is acquired rather than during the time that the object lock is held. Use vm_pager_free_nonreq() to eliminate duplicated code. Reviewed by: kib MFC after: 6 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon Sep 15 16:47:04 2014 (r271633) +++ head/sys/vm/vnode_pager.c Mon Sep 15 17:14:09 2014 (r271634) @@ -772,24 +772,24 @@ vnode_pager_generic_getpages(struct vnod } /* + * Since the caller has busied the requested page, that page's valid + * field will not be changed by other threads. + */ + vm_page_assert_xbusied(m[reqpage]); + + /* * If we have a completely valid page available to us, we can * clean up and return. Otherwise we have to re-read the * media. */ - VM_OBJECT_WLOCK(object); if (m[reqpage]->valid == VM_PAGE_BITS_ALL) { - for (i = 0; i < count; i++) - if (i != reqpage) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - VM_OBJECT_WUNLOCK(object); - return VM_PAGER_OK; + vm_pager_free_nonreq(object, m, reqpage, count); + return (VM_PAGER_OK); } else if (reqblock == -1) { pmap_zero_page(m[reqpage]); KASSERT(m[reqpage]->dirty == 0, ("vnode_pager_generic_getpages: page %p is dirty", m)); + VM_OBJECT_WLOCK(object); m[reqpage]->valid = VM_PAGE_BITS_ALL; for (i = 0; i < count; i++) if (i != reqpage) { @@ -799,9 +799,11 @@ vnode_pager_generic_getpages(struct vnod } VM_OBJECT_WUNLOCK(object); return (VM_PAGER_OK); + } else if (m[reqpage]->valid != 0) { + VM_OBJECT_WLOCK(object); + m[reqpage]->valid = 0; + VM_OBJECT_WUNLOCK(object); } - m[reqpage]->valid = 0; - VM_OBJECT_WUNLOCK(object); /* * here on direct device I/O From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 17:20:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A6D9333; Mon, 15 Sep 2014 17:20:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D45219; Mon, 15 Sep 2014 17:20:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FHKDNr099887; Mon, 15 Sep 2014 17:20:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FHKDFs099885; Mon, 15 Sep 2014 17:20:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409151720.s8FHKDFs099885@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Sep 2014 17:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271635 - in head: lib/libc/sys sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 17:20:14 -0000 Author: jhb Date: Mon Sep 15 17:20:13 2014 New Revision: 271635 URL: http://svnweb.freebsd.org/changeset/base/271635 Log: Add stricter checking of some mmap() arguments: - Fail with EINVAL if an invalid protection mask is passed to mmap(). - Fail with EINVAL if an unknown flag is passed to mmap(). - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. Reviewed by: alc, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D698 Modified: head/lib/libc/sys/mmap.2 head/sys/vm/vm_mmap.c Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Mon Sep 15 17:14:09 2014 (r271634) +++ head/lib/libc/sys/mmap.2 Mon Sep 15 17:20:13 2014 (r271635) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd June 19, 2014 +.Dd September 15, 2014 .Dt MMAP 2 .Os .Sh NAME @@ -372,6 +372,29 @@ The argument is not a valid open file descriptor. .It Bq Er EINVAL +An invalid value was passed in the +.Fa prot +argument. +.It Bq Er EINVAL +An undefined option was set in the +.Fa flags +argument. +.It Bq Er EINVAL +Both +.Dv MAP_PRIVATE +and +.Dv MAP_SHARED +were specified. +.It Bq Er EINVAL +None of +.Dv MAP_ANON , +.Dv MAP_PRIVATE , +.Dv MAP_SHARED , +or +.Dv MAP_STACK +was specified. +At least one of these flags must be included. +.It Bq Er EINVAL .Dv MAP_FIXED was specified and the .Fa addr Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Sep 15 17:14:09 2014 (r271634) +++ head/sys/vm/vm_mmap.c Mon Sep 15 17:20:13 2014 (r271635) @@ -203,17 +203,17 @@ sys_mmap(td, uap) struct vnode *vp; vm_offset_t addr; vm_size_t size, pageoff; - vm_prot_t cap_maxprot, prot, maxprot; + vm_prot_t cap_maxprot, maxprot; void *handle; objtype_t handle_type; - int align, error, flags; + int align, error, flags, prot; off_t pos; struct vmspace *vms = td->td_proc->p_vmspace; cap_rights_t rights; addr = (vm_offset_t) uap->addr; size = uap->len; - prot = uap->prot & VM_PROT_ALL; + prot = uap->prot; flags = uap->flags; pos = uap->pos; @@ -244,8 +244,23 @@ sys_mmap(td, uap) flags |= MAP_ANON; pos = 0; } + /* XXX: MAP_RENAME, MAP_NORESERVE */ + if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_HASSEMAPHORE | + MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE | + MAP_PREFAULT_READ | +#ifdef MAP_32BIT + MAP_32BIT | +#endif + MAP_ALIGNMENT_MASK)) != 0) + return (EINVAL); if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) return (EINVAL); + if ((flags & (MAP_ANON | MAP_SHARED | MAP_PRIVATE)) == 0 || + (flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE)) + return (EINVAL); + if (prot != PROT_NONE && + (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + return (EINVAL); /* * Align the file position to a page boundary, @@ -415,6 +430,8 @@ sys_mmap(td, uap) map: td->td_fpop = fp; maxprot &= cap_maxprot; + + /* This relies on VM_PROT_* matching PROT_*. */ error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot, flags, handle_type, handle, pos); td->td_fpop = NULL; From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 17:22:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F4E14C3; Mon, 15 Sep 2014 17:22:16 +0000 (UTC) Received: from mail-pd0-x22a.google.com (mail-pd0-x22a.google.com [IPv6:2607:f8b0:400e:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45FD72EC; Mon, 15 Sep 2014 17:22:16 +0000 (UTC) Received: by mail-pd0-f170.google.com with SMTP id fp1so6667990pdb.15 for ; Mon, 15 Sep 2014 10:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=MjFCkKHlfMEBHh9fvMAR7WhmylXVIwtlCBBi8dU4k9w=; b=api9vGZoEcgsCky7vfKjorg+VHZpwxxBu1yg3rEokGOT0YdvwhNRA6ECTQ+Su24ETf Fv8fE8YUIIqgJBFx0a9PTuEKbgsk/AHUzzvO8oKh2r2nCeoCl5AqDceVR2hnLdU3hENk NEQ99HGyIhOUUyXhzHJc8D9U3CDv+d5D8niSaeO0gZdilI4rq7f7ii5DiDmy15j1FPu2 BHtdAWaJfxbJNO39Ln5QI0jFMF+yi2UfMF+Rf4S454rrRN2WYugkGDnxmtKVKYi33zfR YVmAGvkLGG5fWG0qEj7JfhojXdCVupd5YokiMLZ3XCpZkUi21za2UXxF958JkNg3nruT aBrw== X-Received: by 10.70.127.238 with SMTP id nj14mr8741850pdb.156.1410801735865; Mon, 15 Sep 2014 10:22:15 -0700 (PDT) Received: from [10.185.225.253] (mobile-166-137-212-254.mycingular.net. [166.137.212.254]) by mx.google.com with ESMTPSA id db2sm11983137pbc.16.2014.09.15.10.22.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Sep 2014 10:22:15 -0700 (PDT) References: <201405081940.s48Jebh5041824@svn.freebsd.org> <54167255.5090806@FreeBSD.org> <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> Mime-Version: 1.0 (1.0) In-Reply-To: <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (11D257) From: Garrett Cooper Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Date: Mon, 15 Sep 2014 10:22:09 -0700 To: David Somayajulu Cc: "svn-src-head@freebsd.org" , "Andrey V. Elsukov" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , David C Somayajulu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 17:22:16 -0000 > On Sep 15, 2014, at 9:31, David Somayajulu w= rote: >=20 > Hi Andrey, > When I didn't have the clean override, "make clean" was not cleaning prop= erly when I built a standalone loadable driver. Perhaps we can change "clean= " in bxe/Makefile and bce/Makefile to "dclean". Hi David, Does make depend work from a clean obj tree? You added some files to you= r make clean target that aren't in SRCS. Cheers, -Garrett= From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 17:49:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A25ED67; Mon, 15 Sep 2014 17:49:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52BC97A4; Mon, 15 Sep 2014 17:49:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FHnncL014093; Mon, 15 Sep 2014 17:49:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FHnksP014072; Mon, 15 Sep 2014 17:49:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409151749.s8FHnksP014072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Sep 2014 17:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271636 - in stable/10: sbin/geom/class/part sys/geom/part sys/sys usr.sbin/bsdinstall/partedit 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 17:49:49 -0000 Author: emaste Date: Mon Sep 15 17:49:46 2014 New Revision: 271636 URL: http://svnweb.freebsd.org/changeset/base/271636 Log: MFC EFI support for the installer r264978 (nwhitehorn): Add EFI support to the installer. This requires that the kernel provide a sysctl to determine what firmware is in use. This sysctl does not exist yet, so the following blocks are in front of the wheels: - I've provisionally called this "hw.platform" after the equivalent thing on PPC - The logic to check the sysctl is short-circuited to always choose BIOS. There's a comment in the top of the file about how to turn this off. If IA64 acquired a boot1.efifat-like thing (probably with very few modifications), the same code could be adapted there. r265016 (nwhitehorn): Finish connecting up installer UEFI support. If the kernel was booted using EFI, set up the disks for an EFI system. If booted from BIOS/CSM, set up for BIOS. r268256 (nwhitehorn): After EFI support was added to the installer, it needed to allow boot partitions of types other than "freebsd-boot" (in particular, "efi"). This allows the removal of some nasty hacks for supporting PowerPC systems, in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific code on MBR. This changes the installer to use the correct names, which also breaks a degeneracy in the meaning of "freebsd-boot" that allows the addition of support for some newer IBM systems that can boot from GPT in addition to MBR. Since I have no idea how to detect which those systems are, leave the default on IBM PPC systems as MBR for now. Approved by: re PR: 193658 Relnotes: Yes Modified: stable/10/sbin/geom/class/part/gpart.8 stable/10/sys/geom/part/g_part.c stable/10/sys/geom/part/g_part.h stable/10/sys/geom/part/g_part_apm.c stable/10/sys/geom/part/g_part_gpt.c stable/10/sys/geom/part/g_part_mbr.c stable/10/sys/sys/gpt.h stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c stable/10/usr.sbin/bsdinstall/partedit/partedit.h stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/10/sbin/geom/class/part/gpart.8 Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sbin/geom/class/part/gpart.8 Mon Sep 15 17:49:46 2014 (r271636) @@ -574,6 +574,16 @@ Symbolic names currently understood and .Fx are: .Bl -tag -width ".Cm dragonfly-disklabel64" +.It Cm apple-boot +The system partition dedicated to storing boot loaders on some Apple +systems. +The scheme-specific types are +.Qq Li "!171" +for MBR, +.Qq Li "!Apple_Bootstrap" +for APM, and +.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac" +for GPT. .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. Usually it is used by the GRUB 2 loader for GPT partitioning schemes. @@ -844,6 +854,14 @@ A partition that contains a NTFS or exFA The scheme-specific type is .Qq Li "!7" for MBR. +.It Cm prep-boot +The system partition dedicated to storing boot loaders on some PowerPC systems, +notably those made by IBM. +The scheme-specific types are +.Qq Li "!65" +for MBR and +.Qq Li "!0x9e1a2d38-c612-4316-aa26-8b49521e5a8b" +for GPT. .It Cm vmware-vmfs A partition that contains a VMware File System (VMFS). The scheme-specific types are @@ -1039,7 +1057,7 @@ Instead, the 800 KBytes bootstrap code i should be written with the .Cm gpart bootcode command to a partition of type -.Cm freebsd-boot , +.Cm apple-boot , which should also be 800 KB in size. .Sh OPERATIONAL FLAGS Actions other than the Modified: stable/10/sys/geom/part/g_part.c ============================================================================== --- stable/10/sys/geom/part/g_part.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part.c Mon Sep 15 17:49:46 2014 (r271636) @@ -117,6 +117,7 @@ struct g_part_alias_list { { "dragonfly-legacy", G_PART_ALIAS_DFBSD_LEGACY }, { "dragonfly-hammer", G_PART_ALIAS_DFBSD_HAMMER }, { "dragonfly-hammer2", G_PART_ALIAS_DFBSD_HAMMER2 }, + { "prep-boot", G_PART_ALIAS_PREP_BOOT }, }; SYSCTL_DECL(_kern_geom); Modified: stable/10/sys/geom/part/g_part.h ============================================================================== --- stable/10/sys/geom/part/g_part.h Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part.h Mon Sep 15 17:49:46 2014 (r271636) @@ -84,6 +84,7 @@ enum g_part_alias { G_PART_ALIAS_DFBSD_LEGACY, /* A DfBSD legacy partition entry */ G_PART_ALIAS_DFBSD_HAMMER, /* A DfBSD HAMMER FS partition entry */ G_PART_ALIAS_DFBSD_HAMMER2, /* A DfBSD HAMMER2 FS partition entry */ + G_PART_ALIAS_PREP_BOOT, /* A PREP/CHRP boot partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: stable/10/sys/geom/part/g_part_apm.c ============================================================================== --- stable/10/sys/geom/part/g_part_apm.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part_apm.c Mon Sep 15 17:49:46 2014 (r271636) @@ -149,11 +149,6 @@ apm_parse_type(const char *type, char *b strcpy(buf, APM_ENT_TYPE_APPLE_UFS); return (0); } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT); - if (!strcasecmp(type, alias)) { - strcpy(buf, APM_ENT_TYPE_APPLE_BOOT); - return (0); - } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); if (!strcasecmp(type, alias)) { strcpy(buf, APM_ENT_TYPE_FREEBSD); Modified: stable/10/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/10/sys/geom/part/g_part_gpt.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part_gpt.c Mon Sep 15 17:49:46 2014 (r271636) @@ -190,6 +190,7 @@ static struct uuid gpt_uuid_dfbsd_hammer static struct uuid gpt_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2; static struct uuid gpt_uuid_dfbsd_label32 = GPT_ENT_TYPE_DRAGONFLY_LABEL32; static struct uuid gpt_uuid_dfbsd_label64 = GPT_ENT_TYPE_DRAGONFLY_LABEL64; +static struct uuid gpt_uuid_prep_boot = GPT_ENT_TYPE_PREP_BOOT; static struct g_part_uuid_alias { struct uuid *uuid; @@ -240,6 +241,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_dfbsd_hammer2, G_PART_ALIAS_DFBSD_HAMMER2, 0 }, { &gpt_uuid_dfbsd_label32, G_PART_ALIAS_DFBSD, 0xa5 }, { &gpt_uuid_dfbsd_label64, G_PART_ALIAS_DFBSD64, 0xa5 }, + { &gpt_uuid_prep_boot, G_PART_ALIAS_PREP_BOOT, 0x41 }, { NULL, 0, 0 } }; Modified: stable/10/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/10/sys/geom/part/g_part_mbr.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/geom/part/g_part_mbr.c Mon Sep 15 17:49:46 2014 (r271636) @@ -135,7 +135,7 @@ static struct g_part_mbr_alias { { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, - { DOSPTYP_PPCBOOT, G_PART_ALIAS_FREEBSD_BOOT }, + { DOSPTYP_PPCBOOT, G_PART_ALIAS_PREP_BOOT }, { DOSPTYP_VMFS, G_PART_ALIAS_VMFS }, { DOSPTYP_VMKDIAG, G_PART_ALIAS_VMKDIAG }, }; Modified: stable/10/sys/sys/gpt.h ============================================================================== --- stable/10/sys/sys/gpt.h Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/sys/sys/gpt.h Mon Sep 15 17:49:46 2014 (r271636) @@ -91,6 +91,8 @@ struct gpt_ent { {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_ZFS \ {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_PREP_BOOT \ + {0x9e1a2d38,0xc612,0x4316,0xaa,0x26,{0x8b,0x49,0x52,0x1e,0x5a,0x8b}} /* * The following are unused but documented here to avoid reuse. Modified: stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Sep 15 17:49:46 2014 (r271636) @@ -584,7 +584,7 @@ set_default_part_metadata(const char *na if (strcmp(type, "freebsd-swap") == 0) mountpoint = "none"; - if (strcmp(type, "freebsd-boot") == 0) + if (strcmp(type, bootpart_type(scheme)) == 0) md->bootcode = 1; /* VTOC8 needs partcode in UFS partitions */ @@ -949,7 +949,8 @@ addpartform: LIST_FOREACH(gc, &pp->lg_config, lg_config) if (strcmp(gc->lg_name, "type") == 0) break; - if (gc != NULL && strcmp(gc->lg_val, "freebsd-boot") == 0) + if (gc != NULL && strcmp(gc->lg_val, + bootpart_type(scheme)) == 0) break; } @@ -971,7 +972,7 @@ addpartform: gctl_ro_param(r, "arg0", -1, geom->lg_name); gctl_ro_param(r, "flags", -1, GPART_FLAGS); gctl_ro_param(r, "verb", -1, "add"); - gctl_ro_param(r, "type", -1, "freebsd-boot"); + gctl_ro_param(r, "type", -1, bootpart_type(scheme)); snprintf(sizestr, sizeof(sizestr), "%jd", bootpart_size(scheme) / sector); gctl_ro_param(r, "size", -1, sizestr); @@ -1031,7 +1032,7 @@ addpartform: gctl_issue(r); /* Error usually expected and non-fatal */ gctl_free(r); - if (strcmp(items[0].text, "freebsd-boot") == 0) + if (strcmp(items[0].text, bootpart_type(scheme)) == 0) get_part_metadata(newpartname, 1)->bootcode = 1; else if (strcmp(items[0].text, "freebsd") == 0) gpart_partition(newpartname, "BSD"); Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit.h ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit.h Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit.h Mon Sep 15 17:49:46 2014 (r271636) @@ -74,9 +74,10 @@ void set_default_part_metadata(const cha /* machine-dependent bootability checks */ const char *default_scheme(void); -int is_scheme_bootable(const char *part_type); -size_t bootpart_size(const char *part_type); -const char *bootcode_path(const char *part_type); -const char *partcode_path(const char *part_type); +int is_scheme_bootable(const char *scheme); +size_t bootpart_size(const char *scheme); +const char *bootpart_type(const char *scheme); +const char *bootcode_path(const char *scheme); +const char *partcode_path(const char *scheme); #endif Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_generic.c Mon Sep 15 17:49:46 2014 (r271636) @@ -58,6 +58,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_pc98.c Mon Sep 15 17:49:46 2014 (r271636) @@ -52,6 +52,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { if (strcmp(part_type, "PC98") == 0) return ("/boot/pc98boot"); Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Mon Sep 15 17:49:46 2014 (r271636) @@ -60,7 +60,8 @@ is_scheme_bootable(const char *part_type if (strcmp(platform, "ps3") == 0 && strcmp(part_type, "GPT") == 0) return (1); if (strcmp(platform, "chrp") == 0 && - (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0)) + (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0 || + strcmp(part_type, "GPT") == 0)) return (1); return (0); @@ -68,21 +69,46 @@ is_scheme_bootable(const char *part_type size_t bootpart_size(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + if (strcmp(part_type, "APM") == 0 || strcmp(part_type, "MBR") == 0) return (800*1024); + if (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0) + return (800*1024); return (0); } const char * +bootpart_type(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + + if (strcmp(platform, "chrp") == 0) + return ("prep-boot"); + if (strcmp(platform, "powermac") == 0) + return ("apple-boot"); + + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } const char * partcode_path(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + if (strcmp(part_type, "APM") == 0) return ("/boot/boot1.hfs"); - if (strcmp(part_type, "MBR") == 0) + if (strcmp(part_type, "MBR") == 0 || + (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0)) return ("/boot/boot1.elf"); return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Mon Sep 15 17:49:46 2014 (r271636) @@ -50,6 +50,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:20:13 2014 (r271635) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:49:46 2014 (r271636) @@ -26,10 +26,15 @@ * $FreeBSD$ */ +#include +#include #include #include "partedit.h" +static char platform[255] = ""; +static const char *platform_sysctl = "machdep.bootmethod"; + const char * default_scheme(void) { return ("GPT"); @@ -37,27 +42,60 @@ default_scheme(void) { int is_scheme_bootable(const char *part_type) { - if (strcmp(part_type, "BSD") == 0) - return (1); + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + if (strcmp(part_type, "GPT") == 0) return (1); - if (strcmp(part_type, "MBR") == 0) - return (1); + if (strcmp(platform, "BIOS") == 0) { + if (strcmp(part_type, "BSD") == 0) + return (1); + if (strcmp(part_type, "MBR") == 0) + return (1); + } return (0); } size_t -bootpart_size(const char *part_type) { - if (strcmp(part_type, "GPT") == 0) - return (64*1024); +bootpart_size(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); /* No partcode except for GPT */ + if (strcmp(scheme, "GPT") != 0) + return (0); + + if (strcmp(platform, "BIOS") == 0) + return (64*1024); + else + return (800*1024); + return (0); } const char * +bootpart_type(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + + if (strcmp(platform, "UEFI") == 0) + return ("efi"); + + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + if (strcmp(platform, "UEFI") == 0) + return (NULL); + if (strcmp(part_type, "GPT") == 0) return ("/boot/pmbr"); if (strcmp(part_type, "MBR") == 0) @@ -70,8 +108,16 @@ bootcode_path(const char *part_type) { const char * partcode_path(const char *part_type) { - if (strcmp(part_type, "GPT") == 0) - return ("/boot/gptboot"); + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + + if (strcmp(part_type, "GPT") == 0) { + if (strcmp(platform, "UEFI") == 0) + return ("/boot/boot1.efifat"); + else + return ("/boot/gptboot"); + } /* No partcode except for GPT */ return (NULL); From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 17:56:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A1B9EE; Mon, 15 Sep 2014 17:56:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1460088F; Mon, 15 Sep 2014 17:56:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FHutlC018410; Mon, 15 Sep 2014 17:56:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FHutEc018409; Mon, 15 Sep 2014 17:56:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409151756.s8FHutEc018409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Sep 2014 17:56: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: r271637 - stable/10/usr.sbin/bsdinstall/partedit 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 17:56:56 -0000 Author: emaste Date: Mon Sep 15 17:56:55 2014 New Revision: 271637 URL: http://svnweb.freebsd.org/changeset/base/271637 Log: MFC r268540 by nwhitehorn: Allow up to 512K for boot code on GPT with BIOS. As pmbr.s says in a comment, "545K should be enough for any boot code". This rounds down slightly. Approved by: re Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:49:46 2014 (r271636) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Mon Sep 15 17:56:55 2014 (r271637) @@ -69,7 +69,7 @@ bootpart_size(const char *scheme) { return (0); if (strcmp(platform, "BIOS") == 0) - return (64*1024); + return (512*1024); else return (800*1024); From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 18:05:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CDF05AD; Mon, 15 Sep 2014 18:05:39 +0000 (UTC) Received: from mx0b-0016ce01.pphosted.com (mx0b-0016ce01.pphosted.com [67.231.156.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D03C0997; Mon, 15 Sep 2014 18:05:38 +0000 (UTC) Received: from pps.filterd (m0000643.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.14.5/8.14.5) with SMTP id s8FI3S3x023860; Mon, 15 Sep 2014 11:05:31 -0700 Received: from avcashub1.qlogic.com (avcashub1.qlogic.com [198.70.193.115]) by mx0b-0016ce01.pphosted.com with ESMTP id 1p9fyqc5kn-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 15 Sep 2014 11:05:31 -0700 Received: from AVMB1.qlogic.org ([fe80::c919:8cc:f3ba:c727]) by avcashub1.qlogic.org ([::1]) with mapi id 14.02.0387.000; Mon, 15 Sep 2014 11:05:33 -0700 From: David Somayajulu To: Garrett Cooper Subject: RE: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Thread-Topic: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Thread-Index: AQHPavVn2jiHLJpVI0alLPpTagQEkZwC40GAgABIDUCAAIdIgP//lckw Date: Mon, 15 Sep 2014 18:05:29 +0000 Message-ID: <49F5640B08EAA94DAF2F6B6145E6A08A0128665976@AVMB1.qlogic.org> References: <201405081940.s48Jebh5041824@svn.freebsd.org> <54167255.5090806@FreeBSD.org> <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.4.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=7561 signatures=670520 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409150151 Cc: "svn-src-head@freebsd.org" , "Andrey V. Elsukov" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , David C Somayajulu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 18:05:39 -0000 Hi Garrett, Please see below. Cheers -david S. -----Original Message----- From: Garrett Cooper [mailto:yaneurabeya@gmail.com] Sent: Monday, September 15, 2014 10:22 AM To: David Somayajulu Cc: Andrey V. Elsukov; David C Somayajulu; src-committers@freebsd.org; svn-= src-all@freebsd.org; svn-src-head@freebsd.org Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/= dev/bxe sys/modules/bce > On Sep 15, 2014, at 9:31, David Somayajulu = wrote: > > Hi Andrey, > When I didn't have the clean override, "make clean" was not cleaning pro= perly when I built a standalone loadable driver. Perhaps we can change "cle= an" in bxe/Makefile and bce/Makefile to "dclean". Hi David, Does make depend work from a clean obj tree? You added some files to yo= ur make clean target that aren't in SRCS. Cheers, -Garrett [David S.] Not sure. I haven't tried it. ________________________________ This message and any attached documents contain information from QLogic Cor= poration or its wholly-owned subsidiaries that may be confidential. If you = are not the intended recipient, you may not read, copy, distribute, or use = this information. If you have received this transmission in error, please n= otify the sender immediately by reply e-mail and then delete this message. From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 18:11:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75FFB8F9; Mon, 15 Sep 2014 18:11:50 +0000 (UTC) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [IPv6:2001:4200:7000:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 13A5CA72; Mon, 15 Sep 2014 18:11:50 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 143891) id 3A42443AD; Mon, 15 Sep 2014 20:11:27 +0200 (SAST) Date: Mon, 15 Sep 2014 20:11:27 +0200 From: John Hay To: Xin LI Subject: Re: svn commit: r269800 - stable/10/sbin/ping6 Message-ID: <20140915181126.GA22013@zibbi.meraka.csir.co.za> References: <53e8688f.2851.32479e23@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53e8688f.2851.32479e23@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 18:11:50 -0000 Hi Xin, I have just upgraded one of my boxes to 10-stable and found one of my scripts just hangs. I traced it to this change in ping6. If you do "ping6 -c 3 ", ping6 will hang until you ^C it. Regards John On Mon, Aug 11, 2014 at 06:54:07AM +0000, Xin LI wrote: > Author: delphij > Date: Mon Aug 11 06:54:07 2014 > New Revision: 269800 > URL: http://svnweb.freebsd.org/changeset/base/269800 > > Log: > MFC r269180: > > When interval is set to very small value with limited amount of packets, > ping6(8) would quit before the remote side gets a chance to respond. > > Solve this by resetting the itimer when we have reached the maximum packet > number have reached, but let the other handling to continue. > > PR: bin/151023 > Submitted by: tjmao at tjmao.net > > Modified: > stable/10/sbin/ping6/ping6.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sbin/ping6/ping6.c > ============================================================================== > --- stable/10/sbin/ping6/ping6.c Mon Aug 11 03:04:16 2014 (r269799) > +++ stable/10/sbin/ping6/ping6.c Mon Aug 11 06:54:07 2014 (r269800) > @@ -1090,8 +1090,14 @@ main(int argc, char *argv[]) > /* signal handling */ > if (seenalrm) { > /* last packet sent, timeout reached? */ > - if (npackets && ntransmitted >= npackets) > - break; > + if (npackets && ntransmitted >= npackets) { > + struct timeval zerotime = {0, 0}; > + itimer.it_value = zerotime; > + itimer.it_interval = zerotime; > + (void)setitimer(ITIMER_REAL, &itimer, NULL); > + seenalrm = 0; /* clear flag */ > + continue; > + } > retransmit(); > seenalrm = 0; > continue; From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 19:38:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F2F283A; Mon, 15 Sep 2014 19:38:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B2FB3D9; Mon, 15 Sep 2014 19:38:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FJcZPE067130; Mon, 15 Sep 2014 19:38:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FJcZew067129; Mon, 15 Sep 2014 19:38:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409151938.s8FJcZew067129@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Sep 2014 19:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271643 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 19:38:35 -0000 Author: tuexen Date: Mon Sep 15 19:38:34 2014 New Revision: 271643 URL: http://svnweb.freebsd.org/changeset/base/271643 Log: Chunk IDs are 8 bit entities, not 16 bit. Thanks to Peter Kasting from Google for drawing my attention to it. MFC after: 3 days Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Sep 15 19:07:24 2014 (r271642) +++ head/sys/netinet/sctp_structs.h Mon Sep 15 19:38:34 2014 (r271643) @@ -418,8 +418,8 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { - uint16_t id; - uint16_t can_take_data; + uint8_t id; + uint8_t can_take_data; }; From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 19:48:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DE1FAF6; Mon, 15 Sep 2014 19:48:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D116C3; Mon, 15 Sep 2014 19:48:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FJmSC0071766; Mon, 15 Sep 2014 19:48:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FJmSqQ071765; Mon, 15 Sep 2014 19:48:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409151948.s8FJmSqQ071765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 15 Sep 2014 19:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271644 - head/sys/cam/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 19:48:28 -0000 Author: mav Date: Mon Sep 15 19:48:27 2014 New Revision: 271644 URL: http://svnweb.freebsd.org/changeset/base/271644 Log: Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives. Submitted by: Sean Fagan MFC after: 3 days Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Sep 15 19:38:34 2014 (r271643) +++ head/sys/cam/scsi/scsi_da.c Mon Sep 15 19:48:27 2014 (r271644) @@ -547,6 +547,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * PNY USB 3.0 Flash Drives + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "PNY", "USB 3.0 FD*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_RC16 + }, + { + /* * PNY USB Flash keys * PR: usb/75578, usb/72344, usb/65436 */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 19:53:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16221CCC; Mon, 15 Sep 2014 19:53:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01E0B7E1; Mon, 15 Sep 2014 19:53:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FJrnxg075731; Mon, 15 Sep 2014 19:53:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FJrnAJ075730; Mon, 15 Sep 2014 19:53:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409151953.s8FJrnAJ075730@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 15 Sep 2014 19:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271645 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 19:53:50 -0000 Author: adrian Date: Mon Sep 15 19:53:49 2014 New Revision: 271645 URL: http://svnweb.freebsd.org/changeset/base/271645 Log: Set DROP_EN on each RX queue if transmit flow-control is disabled. This allows the NIC to drop frames on the receive queue and not cause the MAC to block on receiving to _any_ queue. Tested: igb0@pci0:5:0:0: class=0x020000 card=0x152115d9 chip=0x15218086 rev=0x01 hdr=0x00 vendor = 'Intel Corporation' device = 'I350 Gigabit Network Connection' class = network subclass = ethernet Discussed with: Eric Joyner MFC after: 1 week Sponsored by: Norse Corp, Inc. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Sep 15 19:48:27 2014 (r271644) +++ head/sys/dev/e1000/if_igb.c Mon Sep 15 19:53:49 2014 (r271645) @@ -4712,6 +4712,18 @@ igb_initialize_receive_units(struct adap rctl |= E1000_RCTL_SZ_2048; } + /* + * If TX flow control is disabled and there's >1 queue defined, + * enable DROP. + * + * This drops frames rather than hanging the RX MAC for all queues. + */ + if ((adapter->num_queues > 1) && + (adapter->fc == e1000_fc_none || + adapter->fc == e1000_fc_rx_pause)) { + srrctl |= E1000_SRRCTL_DROP_EN; + } + /* Setup the Base and Length of the Rx Descriptor Rings */ for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 bus_addr = rxr->rxdma.dma_paddr; @@ -6255,6 +6267,7 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS) adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode; e1000_force_mac_fc(&adapter->hw); + /* XXX TODO: update DROP_EN on each RX queue if appropriate */ return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 20:08:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17E6A226; Mon, 15 Sep 2014 20:08:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 034D1928; Mon, 15 Sep 2014 20:08:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FK87cX081112; Mon, 15 Sep 2014 20:08:07 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FK87B2081111; Mon, 15 Sep 2014 20:08:07 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409152008.s8FK87B2081111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 15 Sep 2014 20:08: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: r271646 - stable/10/share/vt/keymaps 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 20:08:08 -0000 Author: se Date: Mon Sep 15 20:08:07 2014 New Revision: 271646 URL: http://svnweb.freebsd.org/changeset/base/271646 Log: MFC r271452: Add two forgotten keymap names (fr.kbd and fr.acc.kbd) to the list of files to be installed. Approved by: re Modified: stable/10/share/vt/keymaps/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/vt/keymaps/Makefile ============================================================================== --- stable/10/share/vt/keymaps/Makefile Mon Sep 15 19:53:49 2014 (r271645) +++ stable/10/share/vt/keymaps/Makefile Mon Sep 15 20:08:07 2014 (r271646) @@ -31,8 +31,10 @@ FILES= INDEX.keymaps \ es.dvorak.kbd \ es.kbd \ fi.kbd \ + fr.acc.kbd \ fr.dvorak.acc.kbd \ fr.dvorak.kbd \ + fr.kbd \ fr.macbook.kbd \ gr.101.acc.kbd \ gr.elot.acc.kbd \ From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 20:50:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 898FCAB; Mon, 15 Sep 2014 20:50:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75781D49; Mon, 15 Sep 2014 20:50:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FKoRWw002121; Mon, 15 Sep 2014 20:50:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FKoR4X002120; Mon, 15 Sep 2014 20:50:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409152050.s8FKoR4X002120@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 15 Sep 2014 20:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271647 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 20:50:27 -0000 Author: adrian Date: Mon Sep 15 20:50:26 2014 New Revision: 271647 URL: http://svnweb.freebsd.org/changeset/base/271647 Log: Fix a double-free of mbufs in rx_ixgbe_discard(). fmp->buf at the free point is already part of the chain being freed, so double-freeing is counter-productive. Submitted by: Marc De La Gueronniere MFC after: 1 week Sponsored by: Verisign, Inc. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Sep 15 20:08:07 2014 (r271646) +++ head/sys/dev/ixgbe/ixgbe.c Mon Sep 15 20:50:26 2014 (r271647) @@ -4523,11 +4523,6 @@ ixgbe_rx_discard(struct rx_ring *rxr, in rbuf = &rxr->rx_buffers[i]; - if (rbuf->fmp != NULL) {/* Partial chain ? */ - rbuf->fmp->m_flags |= M_PKTHDR; - m_freem(rbuf->fmp); - rbuf->fmp = NULL; - } /* ** With advanced descriptors the writeback @@ -4536,7 +4531,13 @@ ixgbe_rx_discard(struct rx_ring *rxr, in ** the normal refresh path to get new buffers ** and mapping. */ - if (rbuf->buf) { + + if (rbuf->fmp != NULL) {/* Partial chain ? */ + rbuf->fmp->m_flags |= M_PKTHDR; + m_freem(rbuf->fmp); + rbuf->fmp = NULL; + rbuf->buf = NULL; /* rbuf->buf is part of fmp's chain */ + } else if (rbuf->buf) { m_free(rbuf->buf); rbuf->buf = NULL; } From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 20:54:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61F6C298; Mon, 15 Sep 2014 20:54:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E07FE06; Mon, 15 Sep 2014 20:54:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FKsDpL004057; Mon, 15 Sep 2014 20:54:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FKsCSr004055; Mon, 15 Sep 2014 20:54:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409152054.s8FKsCSr004055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 15 Sep 2014 20:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271648 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 20:54:13 -0000 Author: adrian Date: Mon Sep 15 20:54:12 2014 New Revision: 271648 URL: http://svnweb.freebsd.org/changeset/base/271648 Log: The error bits are not valid with EOP=0; so intermediary fragments should not be discarded. Submitted by: Marc De La Gueronniere MFC after: 1 week Sponsored by: Verisign, Inc. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Sep 15 20:50:26 2014 (r271647) +++ head/sys/dev/ixgbe/ixgbe.c Mon Sep 15 20:54:12 2014 (r271648) @@ -4142,7 +4142,6 @@ ixgbe_setup_receive_ring(struct rx_ring rxr->lro_enabled = FALSE; rxr->rx_copies = 0; rxr->rx_bytes = 0; - rxr->discard = FALSE; rxr->vtag_strip = FALSE; bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, @@ -4618,13 +4617,8 @@ ixgbe_rxeof(struct ix_queue *que) eop = ((staterr & IXGBE_RXD_STAT_EOP) != 0); /* Make sure bad packets are discarded */ - if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) || - (rxr->discard)) { + if (eop && (staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) { rxr->rx_discarded++; - if (eop) - rxr->discard = FALSE; - else - rxr->discard = TRUE; ixgbe_rx_discard(rxr, i); goto next_desc; } Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Mon Sep 15 20:50:26 2014 (r271647) +++ head/sys/dev/ixgbe/ixgbe.h Mon Sep 15 20:54:12 2014 (r271648) @@ -331,7 +331,6 @@ struct rx_ring { struct lro_ctrl lro; bool lro_enabled; bool hw_rsc; - bool discard; bool vtag_strip; u16 next_to_refresh; u16 next_to_check; From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 21:09:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D07AB5DB; Mon, 15 Sep 2014 21:09:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2AD7F4B; Mon, 15 Sep 2014 21:09:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FL9JIM009512; Mon, 15 Sep 2014 21:09:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FL9JMp009510; Mon, 15 Sep 2014 21:09:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409152109.s8FL9JMp009510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 15 Sep 2014 21:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271649 - in head/sys: conf modules/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 21:09:20 -0000 Author: adrian Date: Mon Sep 15 21:09:19 2014 New Revision: 271649 URL: http://svnweb.freebsd.org/changeset/base/271649 Log: Disable flow-director support until it's been debugged and verified. The flowdirector feature shares on-chip memory with other things such as the RX buffers. In theory it should be configured in a way that doesn't interfere with the rest of operation. In practice, the RX buffer calculation didn't take the flow-director allocation into account and there'd be overlap. This lead to various garbage frames being received containing what looks like internal NIC state. What _I_ saw was traffic ending up in the wrong RX queues. If I was doing a UDP traffic test with only one NIC ring receiving traffic, everything is fine. If I fired up a second UDP stream which came in on another ring, there'd be a few percent of traffic from both rings ending up in the wrong ring. Ie, the RSS hash would indicate it was supposed to come in ring X, but it'd come in ring Y. However, when the allocation was fixed up, the developers at Verisign still saw traffic stalls. The flowdirector feature ends up fiddling with the NIC to do various attempts at load balancing connections by populating flow table rules based on sampled traffic. It's likely that all of that has to be carefully reviewed and made less "magic". So for now the flow director feature is disabled (which fixes both what I was seeing and what they were seeing) until it's all much more debugged and verified. Tested: * (me) 82599EB 2x10G NIC, RSS UDP testing. * (verisign) not sure on the NIC (but likely 82599), 100k-200k/sec TCP transaction tests. Submitted by: Marc De La Gueronniere MFC after: 1 week Sponsored by: Verisign, Inc. Modified: head/sys/conf/files head/sys/modules/ixgbe/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Sep 15 20:54:12 2014 (r271648) +++ head/sys/conf/files Mon Sep 15 21:09:19 2014 (r271649) @@ -1779,7 +1779,7 @@ dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb dev/ixgbe/ixgbe.c optional ixgbe inet \ - compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP -DIXGBE_FDIR" + compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" dev/ixgbe/ixv.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ixgbe inet \ Modified: head/sys/modules/ixgbe/Makefile ============================================================================== --- head/sys/modules/ixgbe/Makefile Mon Sep 15 20:54:12 2014 (r271648) +++ head/sys/modules/ixgbe/Makefile Mon Sep 15 21:09:19 2014 (r271649) @@ -10,6 +10,6 @@ SRCS += ixgbe.c ixv.c SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c SRCS += ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c -CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR +CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 22:32:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 248BB51D; Mon, 15 Sep 2014 22:32:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 107A7B16; Mon, 15 Sep 2014 22:32:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FMWZXu050773; Mon, 15 Sep 2014 22:32:35 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FMWZXi050772; Mon, 15 Sep 2014 22:32:35 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201409152232.s8FMWZXi050772@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 15 Sep 2014 22:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271650 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 22:32:36 -0000 Author: jmg Date: Mon Sep 15 22:32:35 2014 New Revision: 271650 URL: http://svnweb.freebsd.org/changeset/base/271650 Log: document mqueuefs is required for mq_open... Modified: head/lib/libc/sys/mq_open.2 Modified: head/lib/libc/sys/mq_open.2 ============================================================================== --- head/lib/libc/sys/mq_open.2 Mon Sep 15 21:09:19 2014 (r271649) +++ head/lib/libc/sys/mq_open.2 Mon Sep 15 22:32:35 2014 (r271650) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2005 +.Dd September 15, 2014 .Dt MQ_OPEN 2 .Os .Sh NAME @@ -223,6 +223,11 @@ The and .Xr kevent 2 system calls are supported for message queue descriptor. +.Pp +Please see the +.Xr mqueuefs 5 +man page for instructions on loading the module or compiling the service into +the kernel. .Sh RETURN VALUES Upon successful completion, the function returns a message queue descriptor; otherwise, the function returns @@ -294,7 +299,8 @@ There is insufficient space for the crea .Xr mq_setattr 2 , .Xr mq_timedreceive 3 , .Xr mq_timedsend 3 , -.Xr mq_unlink 3 +.Xr mq_unlink 3 , +.Xr mqueuefs 5 .Sh STANDARDS The .Fn mq_open From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 23:21:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 183CABA6; Mon, 15 Sep 2014 23:21:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015BBFB4; Mon, 15 Sep 2014 23:21:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8FNLwMH073900; Mon, 15 Sep 2014 23:21:58 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8FNLvcX073887; Mon, 15 Sep 2014 23:21:57 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201409152321.s8FNLvcX073887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Mon, 15 Sep 2014 23:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271651 - in head/lib/msun: . ld128 ld80 man 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Sep 2014 23:21:59 -0000 Author: kargl Date: Mon Sep 15 23:21:57 2014 New Revision: 271651 URL: http://svnweb.freebsd.org/changeset/base/271651 Log: * Makefile: . Hook e_lgammal[_r].c to the build. . Create man page links for lgammal[-r].3. * Symbol.map: . Sort lgammal to its rightful place. . Add FBSD_1.4 section for the new lgamal_r symbol. * ld128/e_lgammal_r.c: . 128-bit implementataion of lgammal_r(). * ld80/e_lgammal_r.c: . Intel 80-bit format implementation of lgammal_r(). * src/e_lgamma.c: . Expose lgammal as a weak reference to lgamma for platforms where long double is mapped to double. * src/e_lgamma_r.c: . Use integer literal constants instead of real literal constants. Let compiler(s) do the job of conversion to the appropriate type. . Expose lgammal_r as a weak reference to lgamma_r for platforms where long double is mapped to double. * src/e_lgammaf_r.c: . Fixed the Cygnus Support conversion of e_lgamma_r.c to float. This includes the generation of new polynomial and rational approximations with fewer terms. For each approximation, include a comment on an estimate of the accuracy over the relevant domain. . Use integer literal constants instead of real literal constants. Let compiler(s) do the job of conversion to the appropriate type. This allows the removal of several explicit casts of double values to float. * src/e_lgammal.c: . Wrapper for lgammal() about lgammal_r(). * src/imprecise.c: . Remove the lgamma. * src/math.h: . Add a prototype for lgammal_r(). * man/lgamma.3: . Document the new functions. Reviewed by: bde Added: head/lib/msun/ld128/e_lgammal_r.c (contents, props changed) head/lib/msun/ld80/e_lgammal_r.c (contents, props changed) head/lib/msun/src/e_lgammal.c (contents, props changed) Modified: head/lib/msun/Makefile head/lib/msun/Symbol.map head/lib/msun/man/lgamma.3 head/lib/msun/src/e_lgamma.c head/lib/msun/src/e_lgamma_r.c head/lib/msun/src/e_lgammaf_r.c head/lib/msun/src/imprecise.c head/lib/msun/src/math.h Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Sep 15 22:32:35 2014 (r271650) +++ head/lib/msun/Makefile Mon Sep 15 23:21:57 2014 (r271651) @@ -98,6 +98,7 @@ COMMON_SRCS+= s_copysignl.c s_fabsl.c s_ # If long double != double use these; otherwise, we alias the double versions. COMMON_SRCS+= e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \ e_coshl.c e_fmodl.c e_hypotl.c \ + e_lgammal.c e_lgammal_r.c \ e_remainderl.c e_sinhl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ @@ -188,7 +189,8 @@ MLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl. ilogb.3 logb.3 ilogb.3 logbf.3 ilogb.3 logbl.3 MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3 MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3 -MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 \ +MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 \ + lgamma.3 lgammaf.3 lgamma.3 lgammal.3 \ lgamma.3 tgamma.3 lgamma.3 tgammaf.3 MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log10l.3 \ log.3 log1p.3 log.3 log1pf.3 log.3 log1pl.3 \ Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Mon Sep 15 22:32:35 2014 (r271650) +++ head/lib/msun/Symbol.map Mon Sep 15 23:21:57 2014 (r271651) @@ -269,6 +269,7 @@ FBSD_1.3 { erfl; expl; expm1l; + lgammal; log10l; log1pl; log2l; @@ -276,7 +277,11 @@ FBSD_1.3 { sinhl; tanhl; /* Implemented as weak aliases for imprecise versions */ - lgammal; powl; tgammal; }; + +/* First added in 11.0-CURRENT */ +FBSD_1.4 { + lgammal_r; +}; Added: head/lib/msun/ld128/e_lgammal_r.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/ld128/e_lgammal_r.c Mon Sep 15 23:21:57 2014 (r271651) @@ -0,0 +1,329 @@ +/* @(#)e_lgamma_r.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * See e_lgamma_r.c for complete comments. + * + * Converted to long double by Steven G. Kargl. + */ + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +static const volatile double vzero = 0; + +static const double +zero= 0, +half= 0.5, +one = 1; + +static const long double +pi = 3.14159265358979323846264338327950288e+00L; +/* + * Domain y in [0x1p-119, 0.28], range ~[-1.4065e-36, 1.4065e-36]: + * |(lgamma(2 - y) + y / 2) / y - a(y)| < 2**-119.1 + */ +static const long double +a0 = 7.72156649015328606065120900824024296e-02L, +a1 = 3.22467033424113218236207583323018498e-01L, +a2 = 6.73523010531980951332460538330282217e-02L, +a3 = 2.05808084277845478790009252803463129e-02L, +a4 = 7.38555102867398526627292839296001626e-03L, +a5 = 2.89051033074152328576829509522483468e-03L, +a6 = 1.19275391170326097618357349881842913e-03L, +a7 = 5.09669524743042462515256340206203019e-04L, +a8 = 2.23154758453578096143609255559576017e-04L, +a9 = 9.94575127818397632126978731542755129e-05L, +a10 = 4.49262367375420471287545895027098145e-05L, +a11 = 2.05072127845117995426519671481628849e-05L, +a12 = 9.43948816959096748454087141447939513e-06L, +a13 = 4.37486780697359330303852050718287419e-06L, +a14 = 2.03920783892362558276037363847651809e-06L, +a15 = 9.55191070057967287877923073200324649e-07L, +a16 = 4.48993286185740853170657139487620560e-07L, +a17 = 2.13107543597620911675316728179563522e-07L, +a18 = 9.70745379855304499867546549551023473e-08L, +a19 = 5.61889970390290257926487734695402075e-08L, +a20 = 6.42739653024130071866684358960960951e-09L, +a21 = 3.34491062143649291746195612991870119e-08L, +a22 = -1.57068547394315223934653011440641472e-08L, +a23 = 1.30812825422415841213733487745200632e-08L; +/* + * Domain x in [tc-0.24, tc+0.28], range ~[-6.3201e-37, 6.3201e-37]: + * |(lgamma(x) - tf) - t(x - tc)| < 2**-120.3. + */ +static const long double +tc = 1.46163214496836234126265954232572133e+00L, +tf = -1.21486290535849608095514557177691584e-01L, +tt = 1.57061739945077675484237837992951704e-36L, +t0 = -1.99238329499314692728655623767019240e-36L, +t1 = -6.08453430711711404116887457663281416e-35L, +t2 = 4.83836122723810585213722380854828904e-01L, +t3 = -1.47587722994530702030955093950668275e-01L, +t4 = 6.46249402389127526561003464202671923e-02L, +t5 = -3.27885410884813055008502586863748063e-02L, +t6 = 1.79706751152103942928638276067164935e-02L, +t7 = -1.03142230366363872751602029672767978e-02L, +t8 = 6.10053602051788840313573150785080958e-03L, +t9 = -3.68456960831637325470641021892968954e-03L, +t10 = 2.25976482322181046611440855340968560e-03L, +t11 = -1.40225144590445082933490395950664961e-03L, +t12 = 8.78232634717681264035014878172485575e-04L, +t13 = -5.54194952796682301220684760591403899e-04L, +t14 = 3.51912956837848209220421213975000298e-04L, +t15 = -2.24653443695947456542669289367055542e-04L, +t16 = 1.44070395420840737695611929680511823e-04L, +t17 = -9.27609865550394140067059487518862512e-05L, +t18 = 5.99347334438437081412945428365433073e-05L, +t19 = -3.88458388854572825603964274134801009e-05L, +t20 = 2.52476631610328129217896436186551043e-05L, +t21 = -1.64508584981658692556994212457518536e-05L, +t22 = 1.07434583475987007495523340296173839e-05L, +t23 = -7.03070407519397260929482550448878399e-06L, +t24 = 4.60968590693753579648385629003100469e-06L, +t25 = -3.02765473778832036018438676945512661e-06L, +t26 = 1.99238771545503819972741288511303401e-06L, +t27 = -1.31281299822614084861868817951788579e-06L, +t28 = 8.60844432267399655055574642052370223e-07L, +t29 = -5.64535486432397413273248363550536374e-07L, +t30 = 3.99357783676275660934903139592727737e-07L, +t31 = -2.95849029193433121795495215869311610e-07L, +t32 = 1.37790144435073124976696250804940384e-07L; +/* + * Domain y in [-0.1, 0.232], range ~[-1.4046e-37, 1.4181e-37]: + * |(lgamma(1 + y) + 0.5 * y) / y - u(y) / v(y)| < 2**-122.8 + */ +static const long double +u0 = -7.72156649015328606065120900824024311e-02L, +u1 = 4.24082772271938167430983113242482656e-01L, +u2 = 2.96194003481457101058321977413332171e+00L, +u3 = 6.49503267711258043997790983071543710e+00L, +u4 = 7.40090051288150177152835698948644483e+00L, +u5 = 4.94698036296756044610805900340723464e+00L, +u6 = 2.00194224610796294762469550684947768e+00L, +u7 = 4.82073087750608895996915051568834949e-01L, +u8 = 6.46694052280506568192333848437585427e-02L, +u9 = 4.17685526755100259316625348933108810e-03L, +u10 = 9.06361003550314327144119307810053410e-05L, +v1 = 5.15937098592887275994320496999951947e+00L, +v2 = 1.14068418766251486777604403304717558e+01L, +v3 = 1.41164839437524744055723871839748489e+01L, +v4 = 1.07170702656179582805791063277960532e+01L, +v5 = 5.14448694179047879915042998453632434e+00L, +v6 = 1.55210088094585540637493826431170289e+00L, +v7 = 2.82975732849424562719893657416365673e-01L, +v8 = 2.86424622754753198010525786005443539e-02L, +v9 = 1.35364253570403771005922441442688978e-03L, +v10 = 1.91514173702398375346658943749580666e-05L, +v11 = -3.25364686890242327944584691466034268e-08L; +/* + * Domain x in (2, 3], range ~[-1.3341e-36, 1.3536e-36]: + * |(lgamma(y+2) - 0.5 * y) / y - s(y)/r(y)| < 2**-120.1 + * with y = x - 2. + */ +static const long double +s0 = -7.72156649015328606065120900824024297e-02L, +s1 = 1.23221687850916448903914170805852253e-01L, +s2 = 5.43673188699937239808255378293820020e-01L, +s3 = 6.31998137119005233383666791176301800e-01L, +s4 = 3.75885340179479850993811501596213763e-01L, +s5 = 1.31572908743275052623410195011261575e-01L, +s6 = 2.82528453299138685507186287149699749e-02L, +s7 = 3.70262021550340817867688714880797019e-03L, +s8 = 2.83374000312371199625774129290973648e-04L, +s9 = 1.15091830239148290758883505582343691e-05L, +s10 = 2.04203474281493971326506384646692446e-07L, +s11 = 9.79544198078992058548607407635645763e-10L, +r1 = 2.58037466655605285937112832039537492e+00L, +r2 = 2.86289413392776399262513849911531180e+00L, +r3 = 1.78691044735267497452847829579514367e+00L, +r4 = 6.89400381446725342846854215600008055e-01L, +r5 = 1.70135865462567955867134197595365343e-01L, +r6 = 2.68794816183964420375498986152766763e-02L, +r7 = 2.64617234244861832870088893332006679e-03L, +r8 = 1.52881761239180800640068128681725702e-04L, +r9 = 4.63264813762296029824851351257638558e-06L, +r10 = 5.89461519146957343083848967333671142e-08L, +r11 = 1.79027678176582527798327441636552968e-10L; +/* + * Domain z in [8, 0x1p70], range ~[-9.8214e-35, 9.8214e-35]: + * |lgamma(x) - (x - 0.5) * (log(x) - 1) - w(1/x)| < 2**-113.0 + */ +static const long double +w0 = 4.18938533204672741780329736405617738e-01L, +w1 = 8.33333333333333333333333333332852026e-02L, +w2 = -2.77777777777777777777777727810123528e-03L, +w3 = 7.93650793650793650791708939493907380e-04L, +w4 = -5.95238095238095234390450004444370959e-04L, +w5 = 8.41750841750837633887817658848845695e-04L, +w6 = -1.91752691752396849943172337347259743e-03L, +w7 = 6.41025640880333069429106541459015557e-03L, +w8 = -2.95506530801732133437990433080327074e-02L, +w9 = 1.79644237328444101596766586979576927e-01L, +w10 = -1.39240539108367641920172649259736394e+00L, +w11 = 1.33987701479007233325288857758641761e+01L, +w12 = -1.56363596431084279780966590116006255e+02L, +w13 = 2.14830978044410267201172332952040777e+03L, +w14 = -3.28636067474227378352761516589092334e+04L, +w15 = 5.06201257747865138432663574251462485e+05L, +w16 = -6.79720123352023636706247599728048344e+06L, +w17 = 6.57556601705472106989497289465949255e+07L, +w18 = -3.26229058141181783534257632389415580e+08L; + +static long double +sin_pil(long double x) +{ + volatile long double vz; + long double y,z; + uint64_t lx, n; + uint16_t hx; + + y = -x; + + vz = y+0x1.p112; + z = vz-0x1.p112; + if (z == y) + return zero; + + vz = y+0x1.p110; + EXTRACT_LDBL128_WORDS(hx,lx,n,vz); + z = vz-0x1.p110; + if (z > y) { + z -= 0.25; + n--; + } + n &= 7; + y = y - z + n * 0.25L; + + switch (n) { + case 0: y = __kernel_sinl(pi*y,zero,0); break; + case 1: + case 2: y = __kernel_cosl(pi*(0.5-y),zero); break; + case 3: + case 4: y = __kernel_sinl(pi*(one-y),zero,0); break; + case 5: + case 6: y = -__kernel_cosl(pi*(y-1.5),zero); break; + default: y = __kernel_sinl(pi*(y-2.0),zero,0); break; + } + return -y; +} + + +long double +lgammal_r(long double x, int *signgamp) +{ + long double nadj,p,p1,p2,p3,q,r,t,w,y,z; + uint64_t llx,lx; + int i; + uint16_t hx; + + EXTRACT_LDBL128_WORDS(hx, lx, llx, x); + + if((hx & 0x7fff) == 0x7fff) { /* erfl(nan)=nan */ + i = (hx>>15)<<1; + return (1-i)+one/x; /* erfl(+-inf)=+-1 */ + } + + /* purge off +-inf, NaN, +-0, tiny and negative arguments */ + *signgamp = 1; + if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */ + return x*x; + if((hx==0||hx==0x8000)&&lx==0) return one/vzero; + + /* purge off tiny and negative arguments */ + if(fabsl(x)<0x1p-119L) { + if(hx&0x8000) { + *signgamp = -1; + return -logl(-x); + } else return -logl(x); + } + if(hx&0x8000) { + if(fabsl(x)>=0x1p112) + return one/vzero; + t = sin_pil(x); + if(t==zero) return one/vzero; + nadj = logl(pi/fabsl(t*x)); + if(t=0.7315998077392578) {y = 1-x; i= 0;} + else if(x>=0.2316399812698364) {y= x-(tc-1); i=1;} + else {y = x; i=2;} + } else { + r = 0; + if(x>=1.7316312789916992) {y=2-x;i=0;} + else if(x>=1.2316322326660156) {y=x-tc;i=1;} + else {y=x-1;i=2;} + } + switch(i) { + case 0: + z = y*y; + p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*(a10+z*(a12+z*(a14+z*(a16+ + z*(a18+z*(a20+z*a22)))))))))); + p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*(a11+z*(a13+z*(a15+ + z*(a17+z*(a19+z*(a21+z*a23))))))))))); + p = y*p1+p2; + r += (p-y/2); break; + case 1: + p = t0+y*t1+tt+y*y*(t2+y*(t3+y*(t4+y*(t5+y*(t6+y*(t7+y*(t8+ + y*(t9+y*(t10+y*(t11+y*(t12+y*(t13+y*(t14+y*(t15+y*(t16+ + y*(t17+y*(t18+y*(t19+y*(t20+y*(t21+y*(t22+y*(t23+ + y*(t24+y*(t25+y*(t26+y*(t27+y*(t28+y*(t29+y*(t30+ + y*(t31+y*t32)))))))))))))))))))))))))))))); + r += (tf + p); break; + case 2: + p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*(u5+y*(u6+y*(u7+ + y*(u8+y*(u9+y*u10)))))))))); + p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*(v5+y*(v6+y*(v7+ + y*(v8+y*(v9+y*(v10+y*v11)))))))))); + r += (-y/2 + p1/p2); + } + } + else if(x<8) { + i = x; + y = x-i; + p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*(s6+y*(s7+y*(s8+ + y*(s9+y*(s10+y*s11))))))))))); + q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*(r6+y*(r7+y*(r8+ + y*(r9+y*(r10+y*r11)))))))))); + r = y/2+p/q; + z = 1; /* lgamma(1+s) = log(s) + lgamma(s) */ + switch(i) { + case 7: z *= (y+6); /* FALLTHRU */ + case 6: z *= (y+5); /* FALLTHRU */ + case 5: z *= (y+4); /* FALLTHRU */ + case 4: z *= (y+3); /* FALLTHRU */ + case 3: z *= (y+2); /* FALLTHRU */ + r += logl(z); break; + } + } else if (x < 0x1p119L) { + t = logl(x); + z = one/x; + y = z*z; + w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*(w6+y*(w7+y*(w8+ + y*(w9+y*(w10+y*(w11+y*(w12+y*(w13+y*(w14+y*(w15+y*(w16+ + y*(w17+y*w18))))))))))))))))); + r = (x-half)*(t-one)+w; + } else + r = x*(logl(x)-1); + if(hx&0x8000) r = nadj - r; + return r; +} Added: head/lib/msun/ld80/e_lgammal_r.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/ld80/e_lgammal_r.c Mon Sep 15 23:21:57 2014 (r271651) @@ -0,0 +1,345 @@ +/* @(#)e_lgamma_r.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * See s_lgamma_r.c for complete comments. + * + * Converted to long double by Steven G. Kargl. + */ + +#include +#ifdef __i386__ +#include +#endif + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +static const volatile double vzero = 0; + +static const double +zero= 0, +half= 0.5, +one = 1; + +static const union IEEEl2bits +piu = LD80C(0xc90fdaa22168c235, 1, 3.14159265358979323851e+00L); +#define pi (piu.e) +/* + * Domain y in [0x1p-70, 0.27], range ~[-4.5264e-22, 4.5264e-22]: + * |(lgamma(2 - y) + y / 2) / y - a(y)| < 2**-70.9 + */ +static const union IEEEl2bits +a0u = LD80C(0x9e233f1bed863d26, -4, 7.72156649015328606028e-02L), +a1u = LD80C(0xa51a6625307d3249, -2, 3.22467033424113218889e-01L), +a2u = LD80C(0x89f000d2abafda8c, -4, 6.73523010531979398946e-02L), +a3u = LD80C(0xa8991563eca75f26, -6, 2.05808084277991211934e-02L), +a4u = LD80C(0xf2027e10634ce6b6, -8, 7.38555102796070454026e-03L), +a5u = LD80C(0xbd6eb76dd22187f4, -9, 2.89051035162703932972e-03L), +a6u = LD80C(0x9c562ab05e0458ed, -10, 1.19275351624639999297e-03L), +a7u = LD80C(0x859baed93ee48e46, -11, 5.09674593842117925320e-04L), +a8u = LD80C(0xe9f28a4432949af2, -13, 2.23109648015769155122e-04L), +a9u = LD80C(0xd12ad0d9b93c6bb0, -14, 9.97387167479808509830e-05L), +a10u= LD80C(0xb7522643c78a219b, -15, 4.37071076331030136818e-05L), +a11u= LD80C(0xca024dcdece2cb79, -16, 2.40813493372040143061e-05L), +a12u= LD80C(0xbb90fb6968ebdbf9, -19, 2.79495621083634031729e-06L), +a13u= LD80C(0xba1c9ffeeae07b37, -17, 1.10931287015513924136e-05L); +#define a0 (a0u.e) +#define a1 (a1u.e) +#define a2 (a2u.e) +#define a3 (a3u.e) +#define a4 (a4u.e) +#define a5 (a5u.e) +#define a6 (a6u.e) +#define a7 (a7u.e) +#define a8 (a8u.e) +#define a9 (a9u.e) +#define a10 (a10u.e) +#define a11 (a11u.e) +#define a12 (a12u.e) +#define a13 (a13u.e) +/* + * Domain x in [tc-0.24, tc+0.28], range ~[-6.1205e-22, 6.1205e-22]: + * |(lgamma(x) - tf) - t(x - tc)| < 2**-70.5 + */ +static const union IEEEl2bits +tcu = LD80C(0xbb16c31ab5f1fb71, 0, 1.46163214496836234128e+00L), +tfu = LD80C(0xf8cdcde61c520e0f, -4, -1.21486290535849608093e-01L), +ttu = LD80C(0xd46ee54b27d4de99, -69, -2.81152980996018785880e-21L), +t0u = LD80C(0x80b9406556a62a6b, -68, 3.40728634996055147231e-21L), +t1u = LD80C(0xc7e9c6f6df3f8c39, -67, -1.05833162742737073665e-20L), +t2u = LD80C(0xf7b95e4771c55d51, -2, 4.83836122723810583532e-01L), +t3u = LD80C(0x97213c6e35e119ff, -3, -1.47587722994530691476e-01L), +t4u = LD80C(0x845a14a6a81dc94b, -4, 6.46249402389135358063e-02L), +t5u = LD80C(0x864d46fa89997796, -5, -3.27885410884846056084e-02L), +t6u = LD80C(0x93373cbd00297438, -6, 1.79706751150707171293e-02L), +t7u = LD80C(0xa8fcfca7eddc8d1d, -7, -1.03142230361450732547e-02L), +t8u = LD80C(0xc7e7015ff4bc45af, -8, 6.10053603296546099193e-03L), +t9u = LD80C(0xf178d2247adc5093, -9, -3.68456964904901200152e-03L), +t10u = LD80C(0x94188d58f12e5e9f, -9, 2.25976420273774583089e-03L), +t11u = LD80C(0xb7cbaef14e1406f1, -10, -1.40224943666225639823e-03L), +t12u = LD80C(0xe63a671e6704ea4d, -11, 8.78250640744776944887e-04L), +t13u = LD80C(0x914b6c9cae61783e, -11, -5.54255012657716808811e-04L), +t14u = LD80C(0xb858f5bdb79276fe, -12, 3.51614951536825927370e-04L), +t15u = LD80C(0xea73e744c34b9591, -13, -2.23591563824520112236e-04L), +t16u = LD80C(0x99aeabb0d67ba835, -13, 1.46562869351659194136e-04L), +t17u = LD80C(0xd7c6938325db2024, -14, -1.02889866046435680588e-04L), +t18u = LD80C(0xe24cb1e3b0474775, -15, 5.39540265505221957652e-05L); +#define tc (tcu.e) +#define tf (tfu.e) +#define tt (ttu.e) +#define t0 (t0u.e) +#define t1 (t1u.e) +#define t2 (t2u.e) +#define t3 (t3u.e) +#define t4 (t4u.e) +#define t5 (t5u.e) +#define t6 (t6u.e) +#define t7 (t7u.e) +#define t8 (t8u.e) +#define t9 (t9u.e) +#define t10 (t10u.e) +#define t11 (t11u.e) +#define t12 (t12u.e) +#define t13 (t13u.e) +#define t14 (t14u.e) +#define t15 (t15u.e) +#define t16 (t16u.e) +#define t17 (t17u.e) +#define t18 (t18u.e) +/* + * Domain y in [-0.1, 0.232], range ~[-8.1938e-22, 8.3815e-22]: + * |(lgamma(1 + y) + 0.5 * y) / y - u(y) / v(y)| < 2**-71.2 + */ +static const union IEEEl2bits +u0u = LD80C(0x9e233f1bed863d27, -4, -7.72156649015328606095e-02L), +u1u = LD80C(0x98280ee45e4ddd3d, -1, 5.94361239198682739769e-01L), +u2u = LD80C(0xe330c8ead4130733, 0, 1.77492629495841234275e+00L), +u3u = LD80C(0xd4a213f1a002ec52, 0, 1.66119622514818078064e+00L), +u4u = LD80C(0xa5a9ca6f5bc62163, -1, 6.47122051417476492989e-01L), +u5u = LD80C(0xc980e49cd5b019e6, -4, 9.83903751718671509455e-02L), +u6u = LD80C(0xff636a8bdce7025b, -9, 3.89691687802305743450e-03L), +v1u = LD80C(0xbd109c533a19fbf5, 1, 2.95413883330948556544e+00L), +v2u = LD80C(0xd295cbf96f31f099, 1, 3.29039286955665403176e+00L), +v3u = LD80C(0xdab8bcfee40496cb, 0, 1.70876276441416471410e+00L), +v4u = LD80C(0xd2f2dc3638567e9f, -2, 4.12009126299534668571e-01L), +v5u = LD80C(0xa07d9b0851070f41, -5, 3.91822868305682491442e-02L), +v6u = LD80C(0xe3cd8318f7adb2c4, -11, 8.68998648222144351114e-04L); +#define u0 (u0u.e) +#define u1 (u1u.e) +#define u2 (u2u.e) +#define u3 (u3u.e) +#define u4 (u4u.e) +#define u5 (u5u.e) +#define u6 (u6u.e) +#define v1 (v1u.e) +#define v2 (v2u.e) +#define v3 (v3u.e) +#define v4 (v4u.e) +#define v5 (v5u.e) +#define v6 (v6u.e) +/* + * Domain x in (2, 3], range ~[-3.3648e-22, 3.4416e-22]: + * |(lgamma(y+2) - 0.5 * y) / y - s(y)/r(y)| < 2**-72.3 + * with y = x - 2. + */ +static const union IEEEl2bits +s0u = LD80C(0x9e233f1bed863d27, -4, -7.72156649015328606095e-02L), +s1u = LD80C(0xd3ff0dcc7fa91f94, -3, 2.07027640921219389860e-01L), +s2u = LD80C(0xb2bb62782478ef31, -2, 3.49085881391362090549e-01L), +s3u = LD80C(0xb49f7438c4611a74, -3, 1.76389518704213357954e-01L), +s4u = LD80C(0x9a957008fa27ecf9, -5, 3.77401710862930008071e-02L), +s5u = LD80C(0xda9b389a6ca7a7ac, -9, 3.33566791452943399399e-03L), +s6u = LD80C(0xbc7a2263faf59c14, -14, 8.98728786745638844395e-05L), +r1u = LD80C(0xbf5cff5b11477d4d, 0, 1.49502555796294337722e+00L), +r2u = LD80C(0xd9aec89de08e3da6, -1, 8.50323236984473285866e-01L), +r3u = LD80C(0xeab7ae5057c443f9, -3, 2.29216312078225806131e-01L), +r4u = LD80C(0xf29707d9bd2b1e37, -6, 2.96130326586640089145e-02L), +r5u = LD80C(0xd376c2f09736c5a3, -10, 1.61334161411590662495e-03L), +r6u = LD80C(0xc985983d0cd34e3d, -16, 2.40232770710953450636e-05L), +r7u = LD80C(0xe5c7a4f7fc2ef13d, -25, -5.34997929289167573510e-08L); +#define s0 (s0u.e) +#define s1 (s1u.e) +#define s2 (s2u.e) +#define s3 (s3u.e) +#define s4 (s4u.e) +#define s5 (s5u.e) +#define s6 (s6u.e) +#define r1 (r1u.e) +#define r2 (r2u.e) +#define r3 (r3u.e) +#define r4 (r4u.e) +#define r5 (r5u.e) +#define r6 (r6u.e) +#define r7 (r7u.e) +/* + * Domain z in [8, 0x1p70], range ~[-3.0235e-22, 3.0563e-22]: + * |lgamma(x) - (x - 0.5) * (log(x) - 1) - w(1/x)| < 2**-71.7 + */ +static const union IEEEl2bits +w0u = LD80C(0xd67f1c864beb4a69, -2, 4.18938533204672741776e-01L), +w1u = LD80C(0xaaaaaaaaaaaaaaa1, -4, 8.33333333333333332678e-02L), +w2u = LD80C(0xb60b60b60b5491c9, -9, -2.77777777777760927870e-03L), +w3u = LD80C(0xd00d00cf58aede4c, -11, 7.93650793490637233668e-04L), +w4u = LD80C(0x9c09bf626783d4a5, -11, -5.95238023926039051268e-04L), +w5u = LD80C(0xdca7cadc5baa517b, -11, 8.41733700408000822962e-04L), +w6u = LD80C(0xfb060e361e1ffd07, -10, -1.91515849570245136604e-03L), +w7u = LD80C(0xcbd5101bb58d1f2b, -8, 6.22046743903262649294e-03L), +w8u = LD80C(0xad27a668d32c821b, -6, -2.11370706734662081843e-02L); +#define w0 (w0u.e) +#define w1 (w1u.e) +#define w2 (w2u.e) +#define w3 (w3u.e) +#define w4 (w4u.e) +#define w5 (w5u.e) +#define w6 (w6u.e) +#define w7 (w7u.e) +#define w8 (w8u.e) + +static long double +sin_pil(long double x) +{ + volatile long double vz; + long double y,z; + uint64_t n; + uint16_t hx; + + y = -x; + + vz = y+0x1p63L; + z = vz-0x1p63L; + if (z == y) + return zero; + + vz = y+0x1p61; + EXTRACT_LDBL80_WORDS(hx,n,vz); + z = vz-0x1p61; + if (z > y) { + z -= 0.25; /* adjust to round down */ + n--; + } + n &= 7; /* octant of y mod 2 */ + y = y - z + n * 0.25; /* y mod 2 */ + + switch (n) { + case 0: y = __kernel_sinl(pi*y,zero,0); break; + case 1: + case 2: y = __kernel_cosl(pi*(0.5-y),zero); break; + case 3: + case 4: y = __kernel_sinl(pi*(one-y),zero,0); break; + case 5: + case 6: y = -__kernel_cosl(pi*(y-1.5),zero); break; + default: y = __kernel_sinl(pi*(y-2.0),zero,0); break; + } + return -y; +} + +long double +lgammal_r(long double x, int *signgamp) +{ + long double nadj,p,p1,p2,p3,q,r,t,w,y,z; + uint64_t lx; + int i; + uint16_t hx; + + EXTRACT_LDBL80_WORDS(hx,lx,x); + + /* purge off +-inf, NaN, +-0 */ + *signgamp = 1; + if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */ + return x*x; + if((hx==0||hx==0x8000)&&lx==0) return one/vzero; + + ENTERI(); + + /* purge off tiny and negative arguments */ + if(fabsl(x)<0x1p-70L) { /* |x|<2**-70, return -log(|x|) */ + if(hx&0x8000) { + *signgamp = -1; + RETURNI(-logl(-x)); + } else RETURNI(-logl(x)); + } + if(hx&0x8000) { + if(fabsl(x)>=0x1p63) /* |x|>=2**(p-1), must be -integer */ + RETURNI(one/vzero); + t = sin_pil(x); + if(t==zero) RETURNI(one/vzero); /* -integer */ + nadj = logl(pi/fabsl(t*x)); + if(t=0.7315998077392578) {y = 1-x; i= 0;} + else if(x>=0.2316399812698364) {y= x-(tc-1); i=1;} + else {y = x; i=2;} + } else { + r = 0; + if(x>=1.7316312789916992) {y=2-x;i=0;} + else if(x>=1.2316322326660156) {y=x-tc;i=1;} + else {y=x-1;i=2;} + } + switch(i) { + case 0: + z = y*y; + p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*(a10+z*a12))))); + p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*(a11+z*a13)))))); + p = y*p1+p2; + r += (p-y/2); break; + case 1: + p = t0+y*t1+tt+y*y*(t2+y*(t3+y*(t4+y*(t5+y*(t6+y*(t7+y*(t8+ + y*(t9+y*(t10+y*(t11+y*(t12+y*(t13+y*(t14+y*(t15+y*(t16+ + y*(t17+y*t18)))))))))))))))); + r += (tf + p); break; + case 2: + p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*(u5+y*u6)))))); + p2 = 1+y*(v1+y*(v2+y*(v3+y*(v4+y*(v5+y*v6))))); + r += (-y/2 + p1/p2); + } + } + else if(x<8) { + i = x; + y = x-i; + p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6)))))); + q = 1+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*(r6+y*r7)))))); + r = y/2+p/q; + z = 1; /* lgamma(1+s) = log(s) + lgamma(s) */ + switch(i) { + case 7: z *= (y+6); /* FALLTHRU */ + case 6: z *= (y+5); /* FALLTHRU */ + case 5: z *= (y+4); /* FALLTHRU */ + case 4: z *= (y+3); /* FALLTHRU */ + case 3: z *= (y+2); /* FALLTHRU */ + r += logl(z); break; + } + /* 8.0 <= x < 2**70 */ + } else if (x < 0x1p70L) { + t = logl(x); + z = one/x; + y = z*z; + w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*(w6+y*(w7+y*w8))))))); + r = (x-half)*(t-one)+w; + } else + /* 2**70 <= x <= inf */ + r = x*(logl(x)-1); + if(hx&0x8000) r = nadj - r; + RETURNI(r); +} Modified: head/lib/msun/man/lgamma.3 ============================================================================== --- head/lib/msun/man/lgamma.3 Mon Sep 15 22:32:35 2014 (r271650) +++ head/lib/msun/man/lgamma.3 Mon Sep 15 23:21:57 2014 (r271651) @@ -28,7 +28,7 @@ .\" from: @(#)lgamma.3 6.6 (Berkeley) 12/3/92 .\" $FreeBSD$ .\" -.Dd January 14, 2005 +.Dd September 12, 2014 .Dt LGAMMA 3 .Os .Sh NAME @@ -36,6 +36,8 @@ .Nm lgamma_r , .Nm lgammaf , .Nm lgammaf_r , +.Nm lgammal , +.Nm lgammal_r , .Nm gamma , .Nm gamma_r , .Nm gammaf , @@ -58,6 +60,10 @@ .Fn lgammaf "float x" .Ft float .Fn lgammaf_r "float x" "int *signgamp" +.Ft "long double" +.Fn lgammal "long double x" +.Ft "long double" +.Fn lgammal_r "long double x" "int *signgamp" .Ft double .Fn gamma "double x" .Ft double @@ -66,14 +72,15 @@ .Fn gammaf "float x" .Ft float .Fn gammaf_r "float x" "int *signgamp" -.Ft double +.Ft "long double" .Fn tgamma "double x" .Ft float .Fn tgammaf "float x" .Sh DESCRIPTION -.Fn lgamma x +.Fn lgamma x , +.Fn lgammaf x , and -.Fn lgammaf x +.Fn lgammal x .if t \{\ return ln\||\(*G(x)| where .Bd -unfilled -offset indent @@ -87,13 +94,15 @@ The external integer .Fa signgam returns the sign of \(*G(x). .Pp -.Fn lgamma_r x signgamp +.Fn lgamma_r x signgamp , +.Fn lgammaf_r x signgamp , and -.Fn lgammaf_r x signgamp +.Fn lgammal_r x signgamp provide the same functionality as -.Fn lgamma x +.Fn lgamma x , +.Fn lgammaf x , and -.Fn lgammaf x +.Fn lgammal x , but the caller must provide an integer to store the sign of \(*G(x). .Pp The @@ -115,6 +124,7 @@ are deprecated aliases for and .Fn lgammaf_r , respectively. + .Sh IDIOSYNCRASIES Do not use the expression .Dq Li signgam\(**exp(lgamma(x)) @@ -139,14 +149,18 @@ Exponentiation of will lose up to 10 significant bits. .Sh RETURN VALUES .Fn gamma , -.Fn gamma_r , .Fn gammaf , +.Fn gammal , +.Fn gamma_r , .Fn gammaf_r , +.Fn gammal_r , .Fn lgamma , -.Fn lgamma_r , .Fn lgammaf , +.Fn lgammal , +.Fn lgamma_r , +.Fn lgammaf_r , and -.Fn lgammaf_r +.Fn lgammal_r return appropriate values unless an argument is out of range. Overflow will occur for sufficiently large positive values, and non-positive integers. @@ -159,6 +173,7 @@ will underflow. The .Fn lgamma , .Fn lgammaf , +.Fn lgammal , .Fn tgamma , and .Fn tgammaf Modified: head/lib/msun/src/e_lgamma.c ============================================================================== --- head/lib/msun/src/e_lgamma.c Mon Sep 15 22:32:35 2014 (r271650) +++ head/lib/msun/src/e_lgamma.c Mon Sep 15 23:21:57 2014 (r271651) @@ -21,6 +21,8 @@ __FBSDID("$FreeBSD$"); * Method: call __ieee754_lgamma_r */ +#include + #include "math.h" #include "math_private.h" @@ -31,3 +33,7 @@ __ieee754_lgamma(double x) { return __ieee754_lgamma_r(x,&signgam); } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(lgamma, lgammal); +#endif Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Mon Sep 15 22:32:35 2014 (r271650) +++ head/lib/msun/src/e_lgamma_r.c Mon Sep 15 23:21:57 2014 (r271651) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); * */ +#include + #include "math.h" #include "math_private.h" @@ -250,7 +252,7 @@ __ieee754_lgamma_r(double x, int *signga p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10)))); p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11))))); p = y*p1+p2; - r += (p-0.5*y); break; + r += (p-y/2); break; case 1: z = y*y; w = z*y; @@ -273,11 +275,11 @@ __ieee754_lgamma_r(double x, int *signga r = half*y+p/q; z = one; /* lgamma(1+s) = log(s) + lgamma(s) */ switch(i) { - case 7: z *= (y+6.0); /* FALLTHRU */ - case 6: z *= (y+5.0); /* FALLTHRU */ - case 5: z *= (y+4.0); /* FALLTHRU */ - case 4: z *= (y+3.0); /* FALLTHRU */ - case 3: z *= (y+2.0); /* FALLTHRU */ + case 7: z *= (y+6); /* FALLTHRU */ + case 6: z *= (y+5); /* FALLTHRU */ + case 5: z *= (y+4); /* FALLTHRU */ + case 4: z *= (y+3); /* FALLTHRU */ + case 3: z *= (y+2); /* FALLTHRU */ r += __ieee754_log(z); break; } /* 8.0 <= x < 2**58 */ @@ -293,3 +295,8 @@ __ieee754_lgamma_r(double x, int *signga if(hx<0) r = nadj - r; return r; } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(lgamma_r, lgammal_r); +#endif + Modified: head/lib/msun/src/e_lgammaf_r.c ============================================================================== --- head/lib/msun/src/e_lgammaf_r.c Mon Sep 15 22:32:35 2014 (r271650) +++ head/lib/msun/src/e_lgammaf_r.c Mon Sep 15 23:21:57 2014 (r271651) @@ -1,5 +1,6 @@ /* e_lgammaf_r.c -- float version of e_lgamma_r.c. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + * Conversion to float fixed By Steven G. Kargl. */ /* @@ -22,72 +23,63 @@ __FBSDID("$FreeBSD$"); static const volatile float vzero = 0; static const float -zero= 0.0000000000e+00, -half= 5.0000000000e-01, /* 0x3f000000 */ -one = 1.0000000000e+00, /* 0x3f800000 */ +zero= 0, +half= 0.5, +one = 1, pi = 3.1415927410e+00, /* 0x40490fdb */ -a0 = 7.7215664089e-02, /* 0x3d9e233f */ -a1 = 3.2246702909e-01, /* 0x3ea51a66 */ -a2 = 6.7352302372e-02, /* 0x3d89f001 */ -a3 = 2.0580807701e-02, /* 0x3ca89915 */ -a4 = 7.3855509982e-03, /* 0x3bf2027e */ -a5 = 2.8905137442e-03, /* 0x3b3d6ec6 */ -a6 = 1.1927076848e-03, /* 0x3a9c54a1 */ -a7 = 5.1006977446e-04, /* 0x3a05b634 */ -a8 = 2.2086278477e-04, /* 0x39679767 */ -a9 = 1.0801156895e-04, /* 0x38e28445 */ -a10 = 2.5214456400e-05, /* 0x37d383a2 */ -a11 = 4.4864096708e-05, /* 0x383c2c75 */ -tc = 1.4616321325e+00, /* 0x3fbb16c3 */ -tf = -1.2148628384e-01, /* 0xbdf8cdcd */ -/* tt = -(tail of tf) */ -tt = 6.6971006518e-09, /* 0x31e61c52 */ -t0 = 4.8383611441e-01, /* 0x3ef7b95e */ -t1 = -1.4758771658e-01, /* 0xbe17213c */ -t2 = 6.4624942839e-02, /* 0x3d845a15 */ -t3 = -3.2788541168e-02, /* 0xbd064d47 */ -t4 = 1.7970675603e-02, /* 0x3c93373d */ -t5 = -1.0314224288e-02, /* 0xbc28fcfe */ -t6 = 6.1005386524e-03, /* 0x3bc7e707 */ -t7 = -3.6845202558e-03, /* 0xbb7177fe */ -t8 = 2.2596477065e-03, /* 0x3b141699 */ -t9 = -1.4034647029e-03, /* 0xbab7f476 */ -t10 = 8.8108185446e-04, /* 0x3a66f867 */ -t11 = -5.3859531181e-04, /* 0xba0d3085 */ -t12 = 3.1563205994e-04, /* 0x39a57b6b */ -t13 = -3.1275415677e-04, /* 0xb9a3f927 */ -t14 = 3.3552918467e-04, /* 0x39afe9f7 */ -u0 = -7.7215664089e-02, /* 0xbd9e233f */ -u1 = 6.3282704353e-01, /* 0x3f2200f4 */ -u2 = 1.4549225569e+00, /* 0x3fba3ae7 */ -u3 = 9.7771751881e-01, /* 0x3f7a4bb2 */ -u4 = 2.2896373272e-01, /* 0x3e6a7578 */ -u5 = 1.3381091878e-02, /* 0x3c5b3c5e */ -v1 = 2.4559779167e+00, /* 0x401d2ebe */ -v2 = 2.1284897327e+00, /* 0x4008392d */ -v3 = 7.6928514242e-01, /* 0x3f44efdf */ -v4 = 1.0422264785e-01, /* 0x3dd572af */ -v5 = 3.2170924824e-03, /* 0x3b52d5db */ -s0 = -7.7215664089e-02, /* 0xbd9e233f */ -s1 = 2.1498242021e-01, /* 0x3e5c245a */ -s2 = 3.2577878237e-01, /* 0x3ea6cc7a */ -s3 = 1.4635047317e-01, /* 0x3e15dce6 */ -s4 = 2.6642270386e-02, /* 0x3cda40e4 */ -s5 = 1.8402845599e-03, /* 0x3af135b4 */ -s6 = 3.1947532989e-05, /* 0x3805ff67 */ -r1 = 1.3920053244e+00, /* 0x3fb22d3b */ -r2 = 7.2193557024e-01, /* 0x3f38d0c5 */ -r3 = 1.7193385959e-01, /* 0x3e300f6e */ -r4 = 1.8645919859e-02, /* 0x3c98bf54 */ -r5 = 7.7794247773e-04, /* 0x3a4beed6 */ -r6 = 7.3266842264e-06, /* 0x36f5d7bd */ -w0 = 4.1893854737e-01, /* 0x3ed67f1d */ -w1 = 8.3333335817e-02, /* 0x3daaaaab */ -w2 = -2.7777778450e-03, /* 0xbb360b61 */ -w3 = 7.9365057172e-04, /* 0x3a500cfd */ -w4 = -5.9518753551e-04, /* 0xba1c065c */ -w5 = 8.3633989561e-04, /* 0x3a5b3dd2 */ -w6 = -1.6309292987e-03; /* 0xbad5c4e8 */ +/* + * Domain y in [0x1p-27, 0.27], range ~[-3.4599e-10, 3.4590e-10]: + * |(lgamma(2 - y) + 0.5 * y) / y - a(y)| < 2**-31.4 + */ +a0 = 7.72156641e-02, /* 0x3d9e233f */ +a1 = 3.22467119e-01, /* 0x3ea51a69 */ +a2 = 6.73484802e-02, /* 0x3d89ee00 */ +a3 = 2.06395667e-02, /* 0x3ca9144f */ +a4 = 6.98275631e-03, /* 0x3be4cf9b */ +a5 = 4.11768444e-03, /* 0x3b86eda4 */ +/* + * Domain x in [tc-0.24, tc+0.28], range ~[-5.6577e-10, 5.5677e-10]: + * |(lgamma(x) - tf) - t(x - tc)| < 2**-30.8. + */ +tc = 1.46163213e+00, /* 0x3fbb16c3 */ +tf = -1.21486291e-01, /* 0xbdf8cdce */ +t0 = -2.94064460e-11, /* 0xae0154b7 */ +t1 = -2.35939837e-08, /* 0xb2caabb8 */ +t2 = 4.83836412e-01, /* 0x3ef7b968 */ +t3 = -1.47586212e-01, /* 0xbe1720d7 */ +t4 = 6.46013096e-02, /* 0x3d844db1 */ +t5 = -3.28450352e-02, /* 0xbd068884 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 00:00:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F709313; Tue, 16 Sep 2014 00:00:23 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B5D31E; Tue, 16 Sep 2014 00:00:22 +0000 (UTC) Received: from [10.0.1.3] (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NBY00L07W0B2250@st11p02mm-asmtp002.mac.com>; Tue, 16 Sep 2014 00:00:14 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-09-16_01:2014-09-15,2014-09-15,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409150204 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.0 \(1973.6\)) Subject: Re: svn commit: r271297 - head/sys/netinet From: Rui Paulo In-reply-to: <201409090310.s893ALba076415@svn.freebsd.org> Date: Mon, 15 Sep 2014 17:00:11 -0700 Content-transfer-encoding: quoted-printable Message-id: References: <201409090310.s893ALba076415@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1973.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 00:00:23 -0000 On Sep 8, 2014, at 20:10, Adrian Chadd wrote: >=20 > The IPv6 part of this is missing - I'm going to do some re-juggling = of > where various parts of the RSS framework live before I add the IPv6 > code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch], > rather than living here.) Any thoughts on how are you going to handle the IPv6 part? I would = probably avoid parsing any special IPv6 header type and provide RSS iff = the packet is IPv6 header + next header =3D (TCP|UDP). -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 00:04:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DB7B4C2; Tue, 16 Sep 2014 00:04:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77F5E3C9; Tue, 16 Sep 2014 00:04:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G04dcB093979; Tue, 16 Sep 2014 00:04:39 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G04d8D093978; Tue, 16 Sep 2014 00:04:39 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201409160004.s8G04d8D093978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Tue, 16 Sep 2014 00:04:39 +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: r271653 - stable/9/sys/netinet/cc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 00:04:39 -0000 Author: lstewart Date: Tue Sep 16 00:04:38 2014 New Revision: 271653 URL: http://svnweb.freebsd.org/changeset/base/271653 Log: MFC r270160: Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage Modified: stable/9/sys/netinet/cc/cc_cdg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/9/sys/netinet/cc/cc_cdg.c Mon Sep 15 23:43:01 2014 (r271652) +++ stable/9/sys/netinet/cc/cc_cdg.c Tue Sep 16 00:04:38 2014 (r271653) @@ -226,6 +226,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_ba /* Function prototypes. */ static int cdg_mod_init(void); +static int cdg_mod_destroy(void); static void cdg_conn_init(struct cc_var *ccv); static int cdg_cb_init(struct cc_var *ccv); static void cdg_cb_destroy(struct cc_var *ccv); @@ -239,7 +240,8 @@ struct cc_algo cdg_cc_algo = { .cb_destroy = cdg_cb_destroy, .cb_init = cdg_cb_init, .conn_init = cdg_conn_init, - .cong_signal = cdg_cong_signal + .cong_signal = cdg_cong_signal, + .mod_destroy = cdg_mod_destroy }; /* Vnet created and being initialised. */ @@ -283,6 +285,14 @@ cdg_mod_init(void) } static int +cdg_mod_destroy(void) +{ + + uma_zdestroy(qdiffsample_zone); + return (0); +} + +static int cdg_cb_init(struct cc_var *ccv) { struct cdg *cdg_data; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 00:11:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CBF773B; Tue, 16 Sep 2014 00:11:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0731266E; Tue, 16 Sep 2014 00:11:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G0B1sC096567; Tue, 16 Sep 2014 00:11:01 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G0B1uQ096566; Tue, 16 Sep 2014 00:11:01 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201409160011.s8G0B1uQ096566@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Tue, 16 Sep 2014 00:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271654 - stable/8/sys/netinet/cc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 00:11:02 -0000 Author: lstewart Date: Tue Sep 16 00:11:01 2014 New Revision: 271654 URL: http://svnweb.freebsd.org/changeset/base/271654 Log: MFC r270160: Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage Modified: stable/8/sys/netinet/cc/cc_cdg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/8/sys/netinet/cc/cc_cdg.c Tue Sep 16 00:04:38 2014 (r271653) +++ stable/8/sys/netinet/cc/cc_cdg.c Tue Sep 16 00:11:01 2014 (r271654) @@ -226,6 +226,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_ba /* Function prototypes. */ static int cdg_mod_init(void); +static int cdg_mod_destroy(void); static void cdg_conn_init(struct cc_var *ccv); static int cdg_cb_init(struct cc_var *ccv); static void cdg_cb_destroy(struct cc_var *ccv); @@ -239,7 +240,8 @@ struct cc_algo cdg_cc_algo = { .cb_destroy = cdg_cb_destroy, .cb_init = cdg_cb_init, .conn_init = cdg_conn_init, - .cong_signal = cdg_cong_signal + .cong_signal = cdg_cong_signal, + .mod_destroy = cdg_mod_destroy }; /* Vnet created and being initialised. */ @@ -283,6 +285,14 @@ cdg_mod_init(void) } static int +cdg_mod_destroy(void) +{ + + uma_zdestroy(qdiffsample_zone); + return (0); +} + +static int cdg_cb_init(struct cc_var *ccv) { struct cdg *cdg_data; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 00:56:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93FCDDCD; Tue, 16 Sep 2014 00:56:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED19A2F; Tue, 16 Sep 2014 00:56:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G0um3X017813; Tue, 16 Sep 2014 00:56:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G0ulaf017811; Tue, 16 Sep 2014 00:56:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409160056.s8G0ulaf017811@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Sep 2014 00:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271655 - in head: lib/libc/sys 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 00:56:48 -0000 Author: ngie Date: Tue Sep 16 00:56:47 2014 New Revision: 271655 URL: http://svnweb.freebsd.org/changeset/base/271655 Log: Validate the mode argument in access, eaccess, and faccessat for optional POSIX compliance and to improve compatibility with Linux and NetBSD The issue was identified with lib/libc/sys/t_access:access_inval from NetBSD Update the manpage accordingly PR: 181155 Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code) MFC after: 4 weeks Phabric: D678 (code), D786 (manpage) Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/sys/access.2 head/sys/kern/vfs_syscalls.c Modified: head/lib/libc/sys/access.2 ============================================================================== --- head/lib/libc/sys/access.2 Tue Sep 16 00:11:01 2014 (r271654) +++ head/lib/libc/sys/access.2 Tue Sep 16 00:56:47 2014 (r271655) @@ -133,8 +133,16 @@ and .Sh RETURN VALUES .Rv -std .Sh ERRORS -Access to the file is denied if: +.Fn access , +.Fn eaccess , +or +.Fn faccessat +will fail if: .Bl -tag -width Er +.It Bq Er EINVAL +The value of the +.Fa mode +argument is invalid. .It Bq Er ENOTDIR A component of the path prefix is not a directory. .It Bq Er ENAMETOOLONG Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Sep 16 00:11:01 2014 (r271654) +++ head/sys/kern/vfs_syscalls.c Tue Sep 16 00:56:47 2014 (r271655) @@ -2055,6 +2055,9 @@ kern_accessat(struct thread *td, int fd, cap_rights_t rights; int error; + if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) + return (EINVAL); + /* * Create and modify a temporary credential instead of one that * is potentially shared. From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 00:59:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB0E7F74; Tue, 16 Sep 2014 00:59:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A64D6A45; Tue, 16 Sep 2014 00:59:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G0x8T6018171; Tue, 16 Sep 2014 00:59:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G0x8Fe018170; Tue, 16 Sep 2014 00:59:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409160059.s8G0x8Fe018170@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Sep 2014 00:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271656 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 00:59:08 -0000 Author: ngie Date: Tue Sep 16 00:59:08 2014 New Revision: 271656 URL: http://svnweb.freebsd.org/changeset/base/271656 Log: Bump .Dd for the content change done to access(2) in r271655 PR: 181155 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/sys/access.2 Modified: head/lib/libc/sys/access.2 ============================================================================== --- head/lib/libc/sys/access.2 Tue Sep 16 00:56:47 2014 (r271655) +++ head/lib/libc/sys/access.2 Tue Sep 16 00:59:08 2014 (r271656) @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd September 15, 2014 .Dt ACCESS 2 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 00:59:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 159DF190; Tue, 16 Sep 2014 00:59:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 013BFA4F; Tue, 16 Sep 2014 00:59:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G0xuZ6018311; Tue, 16 Sep 2014 00:59:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G0xukK018310; Tue, 16 Sep 2014 00:59:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409160059.s8G0xukK018310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Sep 2014 00:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271657 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 00:59:57 -0000 Author: ngie Date: Tue Sep 16 00:59:56 2014 New Revision: 271657 URL: http://svnweb.freebsd.org/changeset/base/271657 Log: Bump __FreeBSD_version for the change made in r271655 PR: 181155 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Sep 16 00:59:08 2014 (r271656) +++ head/sys/sys/param.h Tue Sep 16 00:59:56 2014 (r271657) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100032 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100033 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 01:21:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3138741; Tue, 16 Sep 2014 01:21:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE44ECBE; Tue, 16 Sep 2014 01:21:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G1LliX031246; Tue, 16 Sep 2014 01:21:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G1Ll0L031243; Tue, 16 Sep 2014 01:21:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409160121.s8G1Ll0L031243@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Sep 2014 01:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271658 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 01:21:48 -0000 Author: adrian Date: Tue Sep 16 01:21:47 2014 New Revision: 271658 URL: http://svnweb.freebsd.org/changeset/base/271658 Log: Modify cpuset_setithread() to take a CPU ID as an integer, not a char. We're going to end up having > 254 CPUs at some point. Modified: head/sys/kern/kern_cpuset.c head/sys/sys/cpuset.h Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Sep 16 00:59:56 2014 (r271657) +++ head/sys/kern/kern_cpuset.c Tue Sep 16 01:21:47 2014 (r271658) @@ -719,7 +719,7 @@ out: * Apply new cpumask to the ithread. */ int -cpuset_setithread(lwpid_t id, u_char cpu) +cpuset_setithread(lwpid_t id, int cpu) { struct cpuset *nset, *rset; struct cpuset *parent, *old_set; Modified: head/sys/sys/cpuset.h ============================================================================== --- head/sys/sys/cpuset.h Tue Sep 16 00:59:56 2014 (r271657) +++ head/sys/sys/cpuset.h Tue Sep 16 01:21:47 2014 (r271658) @@ -118,7 +118,7 @@ struct cpuset *cpuset_thread0(void); struct cpuset *cpuset_ref(struct cpuset *); void cpuset_rel(struct cpuset *); int cpuset_setthread(lwpid_t id, cpuset_t *); -int cpuset_setithread(lwpid_t id, u_char cpu); +int cpuset_setithread(lwpid_t id, int cpu); int cpuset_create_root(struct prison *, struct cpuset **); int cpuset_setproc_update_set(struct proc *, struct cpuset *); char *cpusetobj_strprint(char *, const cpuset_t *); From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 01:49:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81E08C88; Tue, 16 Sep 2014 01:49:28 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20CE8E83; Tue, 16 Sep 2014 01:49:28 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id j5so4919191qga.36 for ; Mon, 15 Sep 2014 18:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ksE/Gc1a5obcdkqpA1OXNUs6Zrt9wywsgg4jes/rMb0=; b=Qyc/OU2hVetaiz71K1jyS5sfmeSFFzVCGm4N5ZIGaEphlVGAUS7qPrxqTVL4qpCCMM SJ9dyzMMjSM0scQKme2vWWS07Fhm8y4607VH5zamh6uy47JQOsHs3RLQykYcFwI+p4t0 kh8buDj3Z9fYGkZdZhTutoftYnz9NAPpXG2Q5UddiNQejztDhYp2apfRgFrmaXOfNlcr 0w77qRlLOg8Phr2+rO5Z/Ed9ZIvfraCQCIZjweIG/7Rhhb3vopKqnbNGrPYTbldqz0VZ Z3OEgmwFuUewJQv5TB1j3hXeZK1OzKHo7AU06k0aGwqJSgMi7d4V/EsI9osHnaOCDmG/ YMZg== MIME-Version: 1.0 X-Received: by 10.224.46.8 with SMTP id h8mr43023754qaf.6.1410832167204; Mon, 15 Sep 2014 18:49:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Mon, 15 Sep 2014 18:49:27 -0700 (PDT) In-Reply-To: References: <201409090310.s893ALba076415@svn.freebsd.org> Date: Mon, 15 Sep 2014 18:49:27 -0700 X-Google-Sender-Auth: Us5c6jkFlCqoRomsM0mMZuJzbSM Message-ID: Subject: Re: svn commit: r271297 - head/sys/netinet From: Adrian Chadd To: Rui Paulo Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 01:49:28 -0000 On 15 September 2014 17:00, Rui Paulo wrote: > On Sep 8, 2014, at 20:10, Adrian Chadd wrote: >> >> The IPv6 part of this is missing - I'm going to do some re-juggling of >> where various parts of the RSS framework live before I add the IPv6 >> code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch], >> rather than living here.) > > Any thoughts on how are you going to handle the IPv6 part? I would probably avoid parsing any special IPv6 header type and provide RSS iff the packet is IPv6 header + next header = (TCP|UDP). I'm likely going to do exactly that for now and only support those bits in the RSS config. The IPV6 _EXT bits can come later. -a From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 01:59:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F3CCE1E; Tue, 16 Sep 2014 01:59:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 698B5F2D; Tue, 16 Sep 2014 01:59:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G1xKDL045979; Tue, 16 Sep 2014 01:59:20 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G1xKtd045978; Tue, 16 Sep 2014 01:59:20 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409160159.s8G1xKtd045978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 16 Sep 2014 01:59: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: r271659 - stable/10/sys/amd64/vmm 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 01:59:20 -0000 Author: grehan Date: Tue Sep 16 01:59:19 2014 New Revision: 271659 URL: http://svnweb.freebsd.org/changeset/base/271659 Log: MFC r270689: Implement the 0x2B SUB instruction, and the OR variant of 0x81. Found with local APIC accesses from bitrig/amd64 bsd.rd, 07/15-snap. Approved by: re (rodrigc) Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Tue Sep 16 01:21:47 2014 (r271658) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Tue Sep 16 01:59:19 2014 (r271659) @@ -65,6 +65,7 @@ enum { VIE_OP_TYPE_MOVZX, VIE_OP_TYPE_AND, VIE_OP_TYPE_OR, + VIE_OP_TYPE_SUB, VIE_OP_TYPE_TWO_BYTE, VIE_OP_TYPE_PUSH, VIE_OP_TYPE_CMP, @@ -97,6 +98,10 @@ static const struct vie_op one_byte_opco .op_byte = 0x0F, .op_type = VIE_OP_TYPE_TWO_BYTE }, + [0x2B] = { + .op_byte = 0x2B, + .op_type = VIE_OP_TYPE_SUB, + }, [0x3B] = { .op_byte = 0x3B, .op_type = VIE_OP_TYPE_CMP, @@ -597,18 +602,16 @@ emulate_and(void *vm, int vcpuid, uint64 break; case 0x81: /* - * AND mem (ModRM:r/m) with immediate and store the + * AND/OR mem (ModRM:r/m) with immediate and store the * result in mem. * - * 81 /4 and r/m16, imm16 - * 81 /4 and r/m32, imm32 - * REX.W + 81 /4 and r/m64, imm32 sign-extended to 64 + * AND: i = 4 + * OR: i = 1 + * 81 /i op r/m16, imm16 + * 81 /i op r/m32, imm32 + * REX.W + 81 /i op r/m64, imm32 sign-extended to 64 * - * Currently, only the AND operation of the 0x81 opcode - * is implemented (ModRM:reg = b100). */ - if ((vie->reg & 7) != 4) - break; /* get the first operand */ error = memread(vm, vcpuid, gpa, &val1, size, arg); @@ -616,11 +619,26 @@ emulate_and(void *vm, int vcpuid, uint64 break; /* - * perform the operation with the pre-fetched immediate - * operand and write the result - */ - val1 &= vie->immediate; - error = memwrite(vm, vcpuid, gpa, val1, size, arg); + * perform the operation with the pre-fetched immediate + * operand and write the result + */ + switch (vie->reg & 7) { + case 0x4: + /* modrm:reg == b100, AND */ + val1 &= vie->immediate; + break; + case 0x1: + /* modrm:reg == b001, OR */ + val1 |= vie->immediate; + break; + default: + error = EINVAL; + break; + } + if (error) + break; + + error = memwrite(vm, vcpuid, gpa, val1, size, arg); break; default: break; @@ -723,6 +741,62 @@ emulate_cmp(void *vm, int vcpuid, uint64 } static int +emulate_sub(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t nval, rflags, rflags2, val1, val2; + enum vm_reg_name reg; + + size = vie->opsize; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x2B: + /* + * SUB r/m from r and store the result in r + * + * 2B/r SUB r16, r/m16 + * 2B/r SUB r32, r/m32 + * REX.W + 2B/r SUB r64, r/m64 + */ + + /* get the first operand */ + reg = gpr_map[vie->reg]; + error = vie_read_register(vm, vcpuid, reg, &val1); + if (error) + break; + + /* get the second operand */ + error = memread(vm, vcpuid, gpa, &val2, size, arg); + if (error) + break; + + /* perform the operation and write the result */ + nval = val1 - val2; + error = vie_update_register(vm, vcpuid, reg, nval, size); + break; + default: + break; + } + + if (!error) { + rflags2 = getcc(size, val1, val2); + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + &rflags); + if (error) + return (error); + + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & RFLAGS_STATUS_BITS; + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + rflags, 8); + } + + return (error); +} + +static int emulate_push(void *vm, int vcpuid, uint64_t mmio_gpa, struct vie *vie, struct vm_guest_paging *paging, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -865,6 +939,10 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_or(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_SUB: + error = emulate_sub(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; default: error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 03:26:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA80FA73; Tue, 16 Sep 2014 03:26:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF729AA; Tue, 16 Sep 2014 03:26:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G3QgxW087677; Tue, 16 Sep 2014 03:26:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G3QgaK087676; Tue, 16 Sep 2014 03:26:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409160326.s8G3QgaK087676@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Sep 2014 03:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271660 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 03:26:42 -0000 Author: adrian Date: Tue Sep 16 03:26:42 2014 New Revision: 271660 URL: http://svnweb.freebsd.org/changeset/base/271660 Log: Ensure the correct software IPv4 hash is done based on the configured RSS parameters, rather than assuming we're hashing IPv4+UDP and IPv4+TCP. Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Tue Sep 16 01:59:19 2014 (r271659) +++ head/sys/netinet/in_rss.c Tue Sep 16 03:26:42 2014 (r271660) @@ -671,7 +671,9 @@ rss_mbuf_software_hash_v4(const struct m * XXX TODO: does the hardware hash on 4-tuple if IP * options are present? */ - if (proto == IPPROTO_TCP && is_frag == 0) { + if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_TCP_IPV4) && + (proto == IPPROTO_TCP) && + (is_frag == 0)) { if (m->m_len < iphlen + sizeof(struct tcphdr)) { printf("%s: short TCP frame?\n", __func__); return (-1); @@ -683,7 +685,9 @@ rss_mbuf_software_hash_v4(const struct m proto, hashval, hashtype); - } else if (proto == IPPROTO_UDP && is_frag == 0) { + } else if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_UDP_IPV4) && + (proto == IPPROTO_UDP) && + (is_frag == 0)) { uh = (struct udphdr *)((caddr_t)ip + iphlen); if (m->m_len < iphlen + sizeof(struct udphdr)) { printf("%s: short UDP frame?\n", __func__); @@ -695,7 +699,7 @@ rss_mbuf_software_hash_v4(const struct m proto, hashval, hashtype); - } else { + } else if (rss_gethashconfig_local() & RSS_HASHTYPE_RSS_IPV4) { /* Default to 2-tuple hash */ return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, 0, /* source port */ @@ -703,6 +707,9 @@ rss_mbuf_software_hash_v4(const struct m 0, /* IPPROTO_IP */ hashval, hashtype); + } else { + printf("%s: no available hashtypes!\n", __func__); + return (-1); } } From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 05:45:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A926ECBB; Tue, 16 Sep 2014 05:45:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94EE2763; Tue, 16 Sep 2014 05:45:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G5jdxE051141; Tue, 16 Sep 2014 05:45:39 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G5jcjx051138; Tue, 16 Sep 2014 05:45:38 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409160545.s8G5jcjx051138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Tue, 16 Sep 2014 05:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271663 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 05:45:39 -0000 Author: hrs Date: Tue Sep 16 05:45:38 2014 New Revision: 271663 URL: http://svnweb.freebsd.org/changeset/base/271663 Log: Fix a typo; master server for iprop service should be singular. Modified: head/etc/defaults/rc.conf head/etc/rc.d/ipropd_slave Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Sep 16 04:01:55 2014 (r271662) +++ head/etc/defaults/rc.conf Tue Sep 16 05:45:38 2014 (r271663) @@ -293,7 +293,7 @@ ipropd_slave_enable="NO" # Run Heimdal i ipropd_slave_program="/usr/libexec/ipropd-slave" ipropd_slave_flags="" # Flags to ipropd-slave. ipropd_slave_keytab="/etc/krb5.keytab" # keytab for ipropd-slave. -ipropd_slave_masters="" # master node names. +ipropd_slave_master="" # master node name. gssd_enable="NO" # Run the gssd daemon (or NO). gssd_program="/usr/sbin/gssd" # Path to gssd. Modified: head/etc/rc.d/ipropd_slave ============================================================================== --- head/etc/rc.d/ipropd_slave Tue Sep 16 04:01:55 2014 (r271662) +++ head/etc/rc.d/ipropd_slave Tue Sep 16 05:45:38 2014 (r271663) @@ -17,15 +17,15 @@ start_precmd=${name}_start_precmd ipropd_slave_start_precmd() { - if [ -z "$ipropd_slave_masters" ]; then - warn "\$ipropd_slave_masters is empty." + if [ -z "$ipropd_slave_master" ]; then + warn "\$ipropd_slave_master is empty." return 1 fi command_args=" \ $command_args \ --keytab=\"$ipropd_slave_keytab\" \ --detach \ - $ipropd_slave_masters" + $ipropd_slave_master" } load_rc_config $name From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 08:40:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33DFACF0; Tue, 16 Sep 2014 08:40:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F15B977; Tue, 16 Sep 2014 08:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G8eqdM033141; Tue, 16 Sep 2014 08:40:52 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G8eqR7033140; Tue, 16 Sep 2014 08:40:52 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201409160840.s8G8eqR7033140@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 16 Sep 2014 08:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271664 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 08:40:53 -0000 Author: cperciva Date: Tue Sep 16 08:40:52 2014 New Revision: 271664 URL: http://svnweb.freebsd.org/changeset/base/271664 Log: Cache GELI passphrases entered at the console during the boot process, in order to improve user-friendliness when a system has multiple disks encrypted using the same passphrase. When examining a new GELI provider, the most recently used passphrase will be attempted before prompting for a passphrase; and whenever a passphrase is entered, it is cached for later reference. When the root disk is mounted, the cached passphrase is zeroed (triggered by the "mountroot" event), in order to minimize the possibility of leakage of passphrases. (After root is mounted, the "taste and prompt for passphrases on the console" code path is disabled, so there is no potential for a passphrase to be stored after the zeroing takes place.) This behaviour can be disabled by setting kern.geom.eli.boot_passcache=0. Reviewed by: pjd, dteske, allanjude MFC after: 7 days Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Tue Sep 16 05:45:38 2014 (r271663) +++ head/sys/geom/eli/g_eli.c Tue Sep 16 08:40:52 2014 (r271664) @@ -82,6 +82,24 @@ u_int g_eli_batch = 0; SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RWTUN, &g_eli_batch, 0, "Use crypto operations batching"); +/* + * Passphrase cached during boot, in order to be more user-friendly if + * there are multiple providers using the same passphrase. + */ +static char cached_passphrase[256]; +static u_int g_eli_boot_passcache = 1; +TUNABLE_INT("kern.geom.eli.boot_passcache", &g_eli_boot_passcache); +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, boot_passcache, CTLFLAG_RD, + &g_eli_boot_passcache, 0, + "Passphrases are cached during boot process for possible reuse"); +static void +zero_boot_passcache(void * dummy) +{ + + memset(cached_passphrase, 0, sizeof(cached_passphrase)); +} +EVENTHANDLER_DEFINE(mountroot, zero_boot_passcache, NULL, 0); + static eventhandler_tag g_eli_pre_sync = NULL; static int g_eli_destroy_geom(struct gctl_req *req, struct g_class *mp, @@ -1059,7 +1077,7 @@ g_eli_taste(struct g_class *mp, struct g tries = g_eli_tries; } - for (i = 0; i < tries; i++) { + for (i = 0; i <= tries; i++) { g_eli_crypto_hmac_init(&ctx, NULL, 0); /* @@ -1083,9 +1101,19 @@ g_eli_taste(struct g_class *mp, struct g /* Ask for the passphrase if defined. */ if (md.md_iterations >= 0) { - printf("Enter passphrase for %s: ", pp->name); - cngets(passphrase, sizeof(passphrase), - g_eli_visible_passphrase); + /* Try first with cached passphrase. */ + if (i == 0) { + if (!g_eli_boot_passcache) + continue; + memcpy(passphrase, cached_passphrase, + sizeof(passphrase)); + } else { + printf("Enter passphrase for %s: ", pp->name); + cngets(passphrase, sizeof(passphrase), + g_eli_visible_passphrase); + memcpy(cached_passphrase, passphrase, + sizeof(passphrase)); + } } /* @@ -1115,15 +1143,18 @@ g_eli_taste(struct g_class *mp, struct g error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); bzero(key, sizeof(key)); if (error == -1) { - if (i == tries - 1) { + if (i == tries) { G_ELI_DEBUG(0, "Wrong key for %s. No tries left.", pp->name); g_eli_keyfiles_clear(pp->name); return (NULL); } - G_ELI_DEBUG(0, "Wrong key for %s. Tries left: %u.", - pp->name, tries - i - 1); + if (i > 0) { + G_ELI_DEBUG(0, + "Wrong key for %s. Tries left: %u.", + pp->name, tries - i); + } /* Try again. */ continue; } else if (error > 0) { From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 09:22:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 315EB953; Tue, 16 Sep 2014 09:22:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D466D6A; Tue, 16 Sep 2014 09:22:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9Mhdv052550; Tue, 16 Sep 2014 09:22:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9Mhjn052549; Tue, 16 Sep 2014 09:22:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409160922.s8G9Mhjn052549@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Sep 2014 09:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271665 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 09:22:44 -0000 Author: tuexen Date: Tue Sep 16 09:22:43 2014 New Revision: 271665 URL: http://svnweb.freebsd.org/changeset/base/271665 Log: The MTU is handled as a 32-bit entity within the SCTP stack. This was reported by Peter Kasting from Google. MFC after: 3 days Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Tue Sep 16 08:40:52 2014 (r271664) +++ head/sys/netinet/sctp_os_bsd.h Tue Sep 16 09:22:43 2014 (r271665) @@ -322,7 +322,7 @@ typedef struct callout sctp_os_timer_t; /* MTU */ /*************************/ #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu -#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_mtu : 0) +#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((uint32_t)((rt != NULL) ? rt->rt_mtu : 0)) #define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0) #define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \ if (rt != NULL) \ From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 09:48:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3B1CE3B; Tue, 16 Sep 2014 09:48:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0242F5A; Tue, 16 Sep 2014 09:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9mOA6062739; Tue, 16 Sep 2014 09:48:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9mOKG062738; Tue, 16 Sep 2014 09:48:24 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160948.s8G9mOKG062738@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271666 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 09:48:25 -0000 Author: delphij Date: Tue Sep 16 09:48:24 2014 New Revision: 271666 URL: http://svnweb.freebsd.org/changeset/base/271666 Log: Fix Denial of Service in TCP packet processing. Submitted by: glebius Security: FreeBSD-SA-14:19.tcp Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Sep 16 09:22:43 2014 (r271665) +++ head/sys/netinet/tcp_input.c Tue Sep 16 09:48:24 2014 (r271666) @@ -2185,11 +2185,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 09:48:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0B2EF75; Tue, 16 Sep 2014 09:48:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C60AF5B; Tue, 16 Sep 2014 09:48:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9mZeg062802; Tue, 16 Sep 2014 09:48:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9mZnx062801; Tue, 16 Sep 2014 09:48:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160948.s8G9mZnx062801@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:48: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: r271667 - stable/10/sys/netinet 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 09:48:35 -0000 Author: delphij Date: Tue Sep 16 09:48:35 2014 New Revision: 271667 URL: http://svnweb.freebsd.org/changeset/base/271667 Log: Fix Denial of Service in TCP packet processing. Security: FreeBSD-SA-14:19.tcp Approved by: re (implicit, security advisory) Modified: stable/10/sys/netinet/tcp_input.c Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Tue Sep 16 09:48:24 2014 (r271666) +++ stable/10/sys/netinet/tcp_input.c Tue Sep 16 09:48:35 2014 (r271667) @@ -2176,11 +2176,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 09:49:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 850D5132; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70B29F65; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9nCgk062943; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9nCV3062942; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160949.s8G9nCV3062942@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:49: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: r271668 - in stable: 8/sys/netinet 9/sys/netinet 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 09:49:12 -0000 Author: delphij Date: Tue Sep 16 09:49:11 2014 New Revision: 271668 URL: http://svnweb.freebsd.org/changeset/base/271668 Log: Fix Denial of Service in TCP packet processing. Security: FreeBSD-SA-14:19.tcp Modified: stable/9/sys/netinet/tcp_input.c Changes in other areas also in this revision: Modified: stable/8/sys/netinet/tcp_input.c Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Tue Sep 16 09:48:35 2014 (r271667) +++ stable/9/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) @@ -2184,11 +2184,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 09:49:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7DC6134; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2269F66; Tue, 16 Sep 2014 09:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9nCjl062949; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9nC7A062948; Tue, 16 Sep 2014 09:49:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160949.s8G9nC7A062948@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271668 - in stable: 8/sys/netinet 9/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 09:49:13 -0000 Author: delphij Date: Tue Sep 16 09:49:11 2014 New Revision: 271668 URL: http://svnweb.freebsd.org/changeset/base/271668 Log: Fix Denial of Service in TCP packet processing. Security: FreeBSD-SA-14:19.tcp Modified: stable/8/sys/netinet/tcp_input.c Changes in other areas also in this revision: Modified: stable/9/sys/netinet/tcp_input.c Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Tue Sep 16 09:48:35 2014 (r271667) +++ stable/8/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) @@ -2092,11 +2092,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 09:50:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 255F0499; Tue, 16 Sep 2014 09:50:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7ACF7F; Tue, 16 Sep 2014 09:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8G9oMIs063280; Tue, 16 Sep 2014 09:50:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8G9oJR7063260; Tue, 16 Sep 2014 09:50:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409160950.s8G9oJR7063260@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 16 Sep 2014 09:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r271669 - in releng: 10.0 10.0/sys/conf 10.0/sys/netinet 8.4 8.4/sys/conf 8.4/sys/netinet 9.1 9.1/sys/conf 9.1/sys/netinet 9.2 9.2/sys/conf 9.2/sys/netinet 9.3 9.3/sys/conf 9.3/sys/netinet X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 09:50:23 -0000 Author: delphij Date: Tue Sep 16 09:50:19 2014 New Revision: 271669 URL: http://svnweb.freebsd.org/changeset/base/271669 Log: Fix Denial of Service in TCP packet processing. Security: FreeBSD-SA-14:19.tcp Approved by: so Modified: releng/10.0/UPDATING releng/10.0/sys/conf/newvers.sh releng/10.0/sys/netinet/tcp_input.c releng/8.4/UPDATING releng/8.4/sys/conf/newvers.sh releng/8.4/sys/netinet/tcp_input.c releng/9.1/UPDATING releng/9.1/sys/conf/newvers.sh releng/9.1/sys/netinet/tcp_input.c releng/9.2/UPDATING releng/9.2/sys/conf/newvers.sh releng/9.2/sys/netinet/tcp_input.c releng/9.3/UPDATING releng/9.3/sys/conf/newvers.sh releng/9.3/sys/netinet/tcp_input.c Modified: releng/10.0/UPDATING ============================================================================== --- releng/10.0/UPDATING Tue Sep 16 09:49:11 2014 (r271668) +++ releng/10.0/UPDATING Tue Sep 16 09:50:19 2014 (r271669) @@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20140916: p9 FreeBSD-SA-14:19.tcp + Fix Denial of Service in TCP packet processing. [SA-14:19] + 20140909: p8 FreeBSD-SA-14:18.openssl Fix OpenSSL multiple vulnerabilities. [SA-14:18] Modified: releng/10.0/sys/conf/newvers.sh ============================================================================== --- releng/10.0/sys/conf/newvers.sh Tue Sep 16 09:49:11 2014 (r271668) +++ releng/10.0/sys/conf/newvers.sh Tue Sep 16 09:50:19 2014 (r271669) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.0/sys/netinet/tcp_input.c ============================================================================== --- releng/10.0/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) +++ releng/10.0/sys/netinet/tcp_input.c Tue Sep 16 09:50:19 2014 (r271669) @@ -2202,11 +2202,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) Modified: releng/8.4/UPDATING ============================================================================== --- releng/8.4/UPDATING Tue Sep 16 09:49:11 2014 (r271668) +++ releng/8.4/UPDATING Tue Sep 16 09:50:19 2014 (r271669) @@ -15,6 +15,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20140916: p16 FreeBSD-SA-14:19.tcp + Fix Denial of Service in TCP packet processing. [SA-14:19] + 20140909: p15 FreeBSD-SA-14:18.openssl Fix OpenSSL multiple vulnerabilities. [SA-14:18] Modified: releng/8.4/sys/conf/newvers.sh ============================================================================== --- releng/8.4/sys/conf/newvers.sh Tue Sep 16 09:49:11 2014 (r271668) +++ releng/8.4/sys/conf/newvers.sh Tue Sep 16 09:50:19 2014 (r271669) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="RELEASE-p15" +BRANCH="RELEASE-p16" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.4/sys/netinet/tcp_input.c ============================================================================== --- releng/8.4/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) +++ releng/8.4/sys/netinet/tcp_input.c Tue Sep 16 09:50:19 2014 (r271669) @@ -2092,11 +2092,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) Modified: releng/9.1/UPDATING ============================================================================== --- releng/9.1/UPDATING Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.1/UPDATING Tue Sep 16 09:50:19 2014 (r271669) @@ -9,6 +9,9 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20140916: p19 FreeBSD-SA-14:19.tcp + Fix Denial of Service in TCP packet processing. [SA-14:19] + 20140909: p18 FreeBSD-SA-14:18.openssl Fix OpenSSL multiple vulnerabilities. [SA-14:18] Modified: releng/9.1/sys/conf/newvers.sh ============================================================================== --- releng/9.1/sys/conf/newvers.sh Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.1/sys/conf/newvers.sh Tue Sep 16 09:50:19 2014 (r271669) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.1" -BRANCH="RELEASE-p18" +BRANCH="RELEASE-p19" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.1/sys/netinet/tcp_input.c ============================================================================== --- releng/9.1/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.1/sys/netinet/tcp_input.c Tue Sep 16 09:50:19 2014 (r271669) @@ -2161,11 +2161,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) Modified: releng/9.2/UPDATING ============================================================================== --- releng/9.2/UPDATING Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.2/UPDATING Tue Sep 16 09:50:19 2014 (r271669) @@ -11,6 +11,9 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20140916: p12 FreeBSD-SA-14:19.tcp + Fix Denial of Service in TCP packet processing. [SA-14:19] + 20140909: p11 FreeBSD-SA-14:18.openssl Fix OpenSSL multiple vulnerabilities. [SA-14:18] Modified: releng/9.2/sys/conf/newvers.sh ============================================================================== --- releng/9.2/sys/conf/newvers.sh Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.2/sys/conf/newvers.sh Tue Sep 16 09:50:19 2014 (r271669) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.2" -BRANCH="RELEASE-p11" +BRANCH="RELEASE-p12" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.2/sys/netinet/tcp_input.c ============================================================================== --- releng/9.2/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.2/sys/netinet/tcp_input.c Tue Sep 16 09:50:19 2014 (r271669) @@ -2181,11 +2181,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) Modified: releng/9.3/UPDATING ============================================================================== --- releng/9.3/UPDATING Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.3/UPDATING Tue Sep 16 09:50:19 2014 (r271669) @@ -11,6 +11,9 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20140916: p2 FreeBSD-SA-14:19.tcp + Fix Denial of Service in TCP packet processing. [SA-14:19] + 20140909: p1 FreeBSD-SA-14:18.openssl Fix OpenSSL multiple vulnerabilities. [SA-14:18] Modified: releng/9.3/sys/conf/newvers.sh ============================================================================== --- releng/9.3/sys/conf/newvers.sh Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.3/sys/conf/newvers.sh Tue Sep 16 09:50:19 2014 (r271669) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.3" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.3/sys/netinet/tcp_input.c ============================================================================== --- releng/9.3/sys/netinet/tcp_input.c Tue Sep 16 09:49:11 2014 (r271668) +++ releng/9.3/sys/netinet/tcp_input.c Tue Sep 16 09:50:19 2014 (r271669) @@ -2181,11 +2181,7 @@ tcp_do_segment(struct mbuf *m, struct tc todrop = tp->rcv_nxt - th->th_seq; if (todrop > 0) { - /* - * If this is a duplicate SYN for our current connection, - * advance over it and pretend and it's not a SYN. - */ - if (thflags & TH_SYN && th->th_seq == tp->irs) { + if (thflags & TH_SYN) { thflags &= ~TH_SYN; th->th_seq++; if (th->th_urp > 1) From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 09:57:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 491007EF; Tue, 16 Sep 2014 09:57:11 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F255FCE; Tue, 16 Sep 2014 09:57:10 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4E85F25D37C3; Tue, 16 Sep 2014 09:57:08 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 61331C770C4; Tue, 16 Sep 2014 09:57:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id nqx224XUHRJw; Tue, 16 Sep 2014 09:57:05 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 05928C770C3; Tue, 16 Sep 2014 09:57:03 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271297 - head/sys/netinet From: "Bjoern A. Zeeb" In-Reply-To: Date: Tue, 16 Sep 2014 09:57:01 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <7196B9EB-B5E0-4656-80FE-2527B5F41308@FreeBSD.org> References: <201409090310.s893ALba076415@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1878.6) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 09:57:11 -0000 On 16 Sep 2014, at 01:49 , Adrian Chadd wrote: > On 15 September 2014 17:00, Rui Paulo wrote: >> On Sep 8, 2014, at 20:10, Adrian Chadd wrote: >>>=20 >>> The IPv6 part of this is missing - I'm going to do some re-juggling = of >>> where various parts of the RSS framework live before I add the IPv6 >>> code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch], >>> rather than living here.) >>=20 >> Any thoughts on how are you going to handle the IPv6 part? I would = probably avoid parsing any special IPv6 header type and provide RSS iff = the packet is IPv6 header + next header =3D (TCP|UDP). >=20 > I'm likely going to do exactly that for now and only support those > bits in the RSS config. The IPV6 _EXT bits can come later. Neither our driver independent soft-LRO nor any of the in-tree drivers = can currently deal if extension headers and punt anything to software to = my best knowledge; there is also very limited support for them in = hardware anyway. I did started prototyping two different strategies for =93library = functions=94 that could be used in various places in the stack but never = got to the point to properly evaluate them so far (and would probably = have to find them on a turned off machine currently). But yes, ignoring them for now will be ok, and once we do them we need = to do them everywhere in the stack anyway;-) =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 10:00:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88E84964 for ; Tue, 16 Sep 2014 10:00:18 +0000 (UTC) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id 1FC9F162 for ; Tue, 16 Sep 2014 10:00:17 +0000 (UTC) Received: (qmail 15811 invoked from network); 16 Sep 2014 10:00:10 -0000 Received: from 87.58.146.155 (HELO x2.osted.lan) (87.58.146.155) by relay00.pair.com with SMTP; 16 Sep 2014 10:00:10 -0000 X-pair-Authenticated: 87.58.146.155 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.5/8.14.5) with ESMTP id s8GA09DT097240; Tue, 16 Sep 2014 12:00:09 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.5/8.14.5/Submit) id s8GA0935097239; Tue, 16 Sep 2014 12:00:09 +0200 (CEST) (envelope-from pho) Date: Tue, 16 Sep 2014 12:00:09 +0200 From: Peter Holm To: John Baldwin Subject: Re: svn commit: r271635 - in head: lib/libc/sys sys/vm Message-ID: <20140916100009.GA96375@x2.osted.lan> References: <201409151720.s8FHKDFs099885@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409151720.s8FHKDFs099885@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 10:00:18 -0000 On Mon, Sep 15, 2014 at 05:20:13PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Sep 15 17:20:13 2014 > New Revision: 271635 > URL: http://svnweb.freebsd.org/changeset/base/271635 > > Log: > Add stricter checking of some mmap() arguments: > - Fail with EINVAL if an invalid protection mask is passed to mmap(). > - Fail with EINVAL if an unknown flag is passed to mmap(). > - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). > - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous > mappings. > > Reviewed by: alc, kib > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D698 > > Modified: > head/lib/libc/sys/mmap.2 > head/sys/vm/vm_mmap.c > I'm seem to have mdconfig(8) issues with this commit. /dev/md* appear to linger. http://people.freebsd.org/~pho/stress/log/md6.txt - Peter From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 10:57:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C4D0EA3; Tue, 16 Sep 2014 10:57:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED227AC1; Tue, 16 Sep 2014 10:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GAvt0H096105; Tue, 16 Sep 2014 10:57:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GAvtag096104; Tue, 16 Sep 2014 10:57:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409161057.s8GAvtag096104@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Sep 2014 10:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271670 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 10:57:56 -0000 Author: tuexen Date: Tue Sep 16 10:57:55 2014 New Revision: 271670 URL: http://svnweb.freebsd.org/changeset/base/271670 Log: Make a type conversion explicit. When compiling this code on Windows as part of the SCTP userland stack, this fixes a warning reported by Peter Kasting from Google. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Sep 16 09:50:19 2014 (r271669) +++ head/sys/netinet/sctp_output.c Tue Sep 16 10:57:55 2014 (r271670) @@ -11301,7 +11301,7 @@ sctp_send_hb(struct sctp_tcb *stcb, stru hb->heartbeat.hb_info.time_value_1 = now.tv_sec; hb->heartbeat.hb_info.time_value_2 = now.tv_usec; /* Did our user request this one, put it in */ - hb->heartbeat.hb_info.addr_family = net->ro._l_addr.sa.sa_family; + hb->heartbeat.hb_info.addr_family = (uint8_t) net->ro._l_addr.sa.sa_family; hb->heartbeat.hb_info.addr_len = net->ro._l_addr.sa.sa_len; if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { /* From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 11:07:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C96B435E; Tue, 16 Sep 2014 11:07:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4E0CBB3; Tue, 16 Sep 2014 11:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GB7Ped000888; Tue, 16 Sep 2014 11:07:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GB7Pdt000887; Tue, 16 Sep 2014 11:07:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409161107.s8GB7Pdt000887@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 16 Sep 2014 11:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271671 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 11:07:25 -0000 Author: glebius Date: Tue Sep 16 11:07:25 2014 New Revision: 271671 URL: http://svnweb.freebsd.org/changeset/base/271671 Log: FreeBSD-SA-14:19.tcp raised attention to the state of our stack towards blind SYN/RST spoofed attack. Originally our stack used in-window checks for incoming SYN/RST as proposed by RFC793. Later, circa 2003 the RST attack was mitigated using the technique described in P. Watson "Slipping in the window" paper [1]. After that, the checks were only relaxed for the sake of compatibility with some buggy TCP stacks. First, r192912 introduced the vulnerability, just fixed by aforementioned SA. Second, r167310 had slightly relaxed the default RST checks, instead of utilizing net.inet.tcp.insecure_rst sysctl. In 2010 a new technique for mitigation of these attacks was proposed in RFC5961 [2]. The idea is to send a "challenge ACK" packet to the peer, to verify that packet arrived isn't spoofed. If peer receives challenge ACK it should regenerate its RST or SYN with correct sequence number. This should not only protect against attacks, but also improve communication with broken stacks, so authors of reverted r167310 and r192912 won't be disappointed. [1] http://bandwidthco.com/whitepapers/netforensics/tcpip/TCP Reset Attacks.pdf [2] http://www.rfc-editor.org/rfc/rfc5961.txt Changes made: o Revert r167310. o Implement "challenge ACK" protection as specificed in RFC5961 against RST attack. On by default. - Carefully preserve r138098, which handles empty window edge case, not described by the RFC. - Update net.inet.tcp.insecure_rst description. o Implement "challenge ACK" protection as specificed in RFC5961 against SYN attack. On by default. - Provide net.inet.tcp.insecure_syn sysctl, to turn off RFC5961 protection. The changes were tested at Netflix. The tested box didn't show any anomalies compared to control box, except slightly increased number of TCP connection in LAST_ACK state. Reviewed by: rrs Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Sep 16 10:57:55 2014 (r271670) +++ head/sys/netinet/tcp_input.c Tue Sep 16 11:07:25 2014 (r271671) @@ -186,11 +186,17 @@ SYSCTL_VNET_INT(_net_inet_tcp_ecn, OID_A &VNET_NAME(tcp_ecn_maxretries), 0, "Max retries before giving up on ECN"); +VNET_DEFINE(int, tcp_insecure_syn) = 0; +#define V_tcp_insecure_syn VNET(tcp_insecure_syn) +SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, insecure_syn, CTLFLAG_RW, + &VNET_NAME(tcp_insecure_syn), 0, + "Follow RFC793 instead of RFC5961 criteria for accepting SYN packets"); + VNET_DEFINE(int, tcp_insecure_rst) = 0; #define V_tcp_insecure_rst VNET(tcp_insecure_rst) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_RW, &VNET_NAME(tcp_insecure_rst), 0, - "Follow the old (insecure) criteria for accepting RST packets"); + "Follow RFC793 instead of RFC5961 criteria for accepting RST packets"); VNET_DEFINE(int, tcp_recvspace) = 1024*64; #define V_tcp_recvspace VNET(tcp_recvspace) @@ -2044,98 +2050,83 @@ tcp_do_segment(struct mbuf *m, struct tc * Then check that at least some bytes of segment are within * receive window. If segment begins before rcv_nxt, * drop leading data (and SYN); if nothing left, just ack. - * - * - * If the RST bit is set, check the sequence number to see - * if this is a valid reset segment. - * RFC 793 page 37: - * In all states except SYN-SENT, all reset (RST) segments - * are validated by checking their SEQ-fields. A reset is - * valid if its sequence number is in the window. - * Note: this does not take into account delayed ACKs, so - * we should test against last_ack_sent instead of rcv_nxt. - * The sequence number in the reset segment is normally an - * echo of our outgoing acknowlegement numbers, but some hosts - * send a reset with the sequence number at the rightmost edge - * of our receive window, and we have to handle this case. - * Note 2: Paul Watson's paper "Slipping in the Window" has shown - * that brute force RST attacks are possible. To combat this, - * we use a much stricter check while in the ESTABLISHED state, - * only accepting RSTs where the sequence number is equal to - * last_ack_sent. In all other states (the states in which a - * RST is more likely), the more permissive check is used. - * If we have multiple segments in flight, the initial reset - * segment sequence numbers will be to the left of last_ack_sent, - * but they will eventually catch up. - * In any case, it never made sense to trim reset segments to - * fit the receive window since RFC 1122 says: - * 4.2.2.12 RST Segment: RFC-793 Section 3.4 - * - * A TCP SHOULD allow a received RST segment to include data. - * - * DISCUSSION - * It has been suggested that a RST segment could contain - * ASCII text that encoded and explained the cause of the - * RST. No standard has yet been established for such - * data. - * - * If the reset segment passes the sequence number test examine - * the state: - * SYN_RECEIVED STATE: - * If passive open, return to LISTEN state. - * If active open, inform user that connection was refused. - * ESTABLISHED, FIN_WAIT_1, FIN_WAIT_2, CLOSE_WAIT STATES: - * Inform user that connection was reset, and close tcb. - * CLOSING, LAST_ACK STATES: - * Close the tcb. - * TIME_WAIT STATE: - * Drop the segment - see Stevens, vol. 2, p. 964 and - * RFC 1337. */ if (thflags & TH_RST) { - if (SEQ_GEQ(th->th_seq, tp->last_ack_sent - 1) && - SEQ_LEQ(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) { - switch (tp->t_state) { - - case TCPS_SYN_RECEIVED: - so->so_error = ECONNREFUSED; - goto close; - - case TCPS_ESTABLISHED: - if (V_tcp_insecure_rst == 0 && - !(SEQ_GEQ(th->th_seq, tp->rcv_nxt - 1) && - SEQ_LEQ(th->th_seq, tp->rcv_nxt + 1)) && - !(SEQ_GEQ(th->th_seq, tp->last_ack_sent - 1) && - SEQ_LEQ(th->th_seq, tp->last_ack_sent + 1))) { - TCPSTAT_INC(tcps_badrst); - goto drop; - } - /* FALLTHROUGH */ - case TCPS_FIN_WAIT_1: - case TCPS_FIN_WAIT_2: - case TCPS_CLOSE_WAIT: - so->so_error = ECONNRESET; - close: - KASSERT(ti_locked == TI_WLOCKED, - ("tcp_do_segment: TH_RST 1 ti_locked %d", - ti_locked)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + /* + * RFC5961 Section 3.2 + * + * - RST drops connection only if SEG.SEQ == RCV.NXT. + * - If RST is in window, we send challenge ACK. + * + * Note: to take into account delayed ACKs, we should + * test against last_ack_sent instead of rcv_nxt. + * Note 2: we handle special case of closed window, not + * covered by the RFC. + */ + if ((SEQ_GEQ(th->th_seq, tp->last_ack_sent) && + SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) || + (tp->rcv_wnd == 0 && tp->last_ack_sent == th->th_seq)) { + + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + KASSERT(ti_locked == TI_WLOCKED, + ("%s: TH_RST ti_locked %d, th %p tp %p", + __func__, ti_locked, th, tp)); + KASSERT(tp->t_state != TCPS_SYN_SENT, + ("%s: TH_RST for TCPS_SYN_SENT th %p tp %p", + __func__, th, tp)); - tcp_state_change(tp, TCPS_CLOSED); + if (V_tcp_insecure_rst || + tp->last_ack_sent == th->th_seq) { TCPSTAT_INC(tcps_drops); - tp = tcp_close(tp); - break; + /* Drop the connection. */ + switch (tp->t_state) { + case TCPS_SYN_RECEIVED: + so->so_error = ECONNREFUSED; + goto close; + case TCPS_ESTABLISHED: + case TCPS_FIN_WAIT_1: + case TCPS_FIN_WAIT_2: + case TCPS_CLOSE_WAIT: + so->so_error = ECONNRESET; + close: + tcp_state_change(tp, TCPS_CLOSED); + /* FALLTHROUGH */ + default: + tp = tcp_close(tp); + } + } else { + TCPSTAT_INC(tcps_badrst); + /* Send challenge ACK. */ + tcp_respond(tp, mtod(m, void *), th, m, + tp->rcv_nxt, tp->snd_nxt, TH_ACK); + tp->last_ack_sent = tp->rcv_nxt; + m = NULL; + } + } + goto drop; + } - case TCPS_CLOSING: - case TCPS_LAST_ACK: - KASSERT(ti_locked == TI_WLOCKED, - ("tcp_do_segment: TH_RST 2 ti_locked %d", - ti_locked)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + /* + * RFC5961 Section 4.2 + * Send challenge ACK for any SYN in synchronized state. + */ + if ((thflags & TH_SYN) && tp->t_state != TCPS_SYN_SENT) { + KASSERT(ti_locked == TI_WLOCKED, + ("tcp_do_segment: TH_SYN ti_locked %d", ti_locked)); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - tp = tcp_close(tp); - break; - } + TCPSTAT_INC(tcps_badsyn); + if (V_tcp_insecure_syn && + SEQ_GEQ(th->th_seq, tp->last_ack_sent) && + SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) { + tp = tcp_drop(tp, ECONNRESET); + rstreason = BANDLIM_UNLIMITED; + } else { + /* Send challenge ACK. */ + tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, + tp->snd_nxt, TH_ACK); + tp->last_ack_sent = tp->rcv_nxt; + m = NULL; } goto drop; } @@ -2307,20 +2298,6 @@ tcp_do_segment(struct mbuf *m, struct tc } /* - * If a SYN is in the window, then this is an - * error and we send an RST and drop the connection. - */ - if (thflags & TH_SYN) { - KASSERT(ti_locked == TI_WLOCKED, - ("tcp_do_segment: TH_SYN ti_locked %d", ti_locked)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - - tp = tcp_drop(tp, ECONNRESET); - rstreason = BANDLIM_UNLIMITED; - goto drop; - } - - /* * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN * flag is on (half-synchronized state), then queue data for * later processing; else drop segment and return. From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 13:39:24 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F96CCF; Tue, 16 Sep 2014 13:39:24 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D7306E55; Tue, 16 Sep 2014 13:39:19 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA09786; Tue, 16 Sep 2014 16:39:17 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XTsyT-0004k9-Cs; Tue, 16 Sep 2014 16:39:17 +0300 Message-ID: <54183D4D.3050907@FreeBSD.org> Date: Tue, 16 Sep 2014 16:38:21 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: John Baldwin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, freebsd-java@FreeBSD.org Subject: Re: svn commit: r271635 - in head: lib/libc/sys sys/vm References: <201409151720.s8FHKDFs099885@svn.freebsd.org> In-Reply-To: <201409151720.s8FHKDFs099885@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 13:39:24 -0000 On 15/09/2014 20:20, John Baldwin wrote: > Author: jhb > Date: Mon Sep 15 17:20:13 2014 > New Revision: 271635 > URL: http://svnweb.freebsd.org/changeset/base/271635 > > Log: > Add stricter checking of some mmap() arguments: > - Fail with EINVAL if an invalid protection mask is passed to mmap(). > - Fail with EINVAL if an unknown flag is passed to mmap(). > - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). > - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous > mappings. This broke Java, at least java/openjdk7, for me: 25323 java CALL mmap(0,0x3000000,0x3,0x1042,0xffffffff,0) 25323 java RET mmap -1 errno 22 Invalid argument 25323 java CALL write(0x1,0x7fffffbfd450,0x2b) 25323 java GIO fd 1 wrote 43 bytes "Error occurred during initialization of VM " 25323 java RET write 43/0x2b 25323 java CALL write(0x1,0x80209a1e2,0x2d) 25323 java GIO fd 1 wrote 45 bytes "Could not reserve enough space for code cache" It seems that MAP_NORESERVE presence could be detected in sys/mman.h and then it is used for some reason. I guess that the port can be easily fixed, but this commit breaks compatibility with older binaries. Perhaps MAP_NORESERVE should be removed as well given that we do not actually implement it. > Reviewed by: alc, kib > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D698 > > Modified: > head/lib/libc/sys/mmap.2 > head/sys/vm/vm_mmap.c > > Modified: head/lib/libc/sys/mmap.2 > ============================================================================== > --- head/lib/libc/sys/mmap.2 Mon Sep 15 17:14:09 2014 (r271634) > +++ head/lib/libc/sys/mmap.2 Mon Sep 15 17:20:13 2014 (r271635) > @@ -28,7 +28,7 @@ > .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 > .\" $FreeBSD$ > .\" > -.Dd June 19, 2014 > +.Dd September 15, 2014 > .Dt MMAP 2 > .Os > .Sh NAME > @@ -372,6 +372,29 @@ The > argument > is not a valid open file descriptor. > .It Bq Er EINVAL > +An invalid value was passed in the > +.Fa prot > +argument. > +.It Bq Er EINVAL > +An undefined option was set in the > +.Fa flags > +argument. > +.It Bq Er EINVAL > +Both > +.Dv MAP_PRIVATE > +and > +.Dv MAP_SHARED > +were specified. > +.It Bq Er EINVAL > +None of > +.Dv MAP_ANON , > +.Dv MAP_PRIVATE , > +.Dv MAP_SHARED , > +or > +.Dv MAP_STACK > +was specified. > +At least one of these flags must be included. > +.It Bq Er EINVAL > .Dv MAP_FIXED > was specified and the > .Fa addr > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Mon Sep 15 17:14:09 2014 (r271634) > +++ head/sys/vm/vm_mmap.c Mon Sep 15 17:20:13 2014 (r271635) > @@ -203,17 +203,17 @@ sys_mmap(td, uap) > struct vnode *vp; > vm_offset_t addr; > vm_size_t size, pageoff; > - vm_prot_t cap_maxprot, prot, maxprot; > + vm_prot_t cap_maxprot, maxprot; > void *handle; > objtype_t handle_type; > - int align, error, flags; > + int align, error, flags, prot; > off_t pos; > struct vmspace *vms = td->td_proc->p_vmspace; > cap_rights_t rights; > > addr = (vm_offset_t) uap->addr; > size = uap->len; > - prot = uap->prot & VM_PROT_ALL; > + prot = uap->prot; > flags = uap->flags; > pos = uap->pos; > > @@ -244,8 +244,23 @@ sys_mmap(td, uap) > flags |= MAP_ANON; > pos = 0; > } > + /* XXX: MAP_RENAME, MAP_NORESERVE */ > + if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_HASSEMAPHORE | > + MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE | > + MAP_PREFAULT_READ | > +#ifdef MAP_32BIT > + MAP_32BIT | > +#endif > + MAP_ALIGNMENT_MASK)) != 0) > + return (EINVAL); > if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) > return (EINVAL); > + if ((flags & (MAP_ANON | MAP_SHARED | MAP_PRIVATE)) == 0 || > + (flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE)) > + return (EINVAL); > + if (prot != PROT_NONE && > + (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) > + return (EINVAL); > > /* > * Align the file position to a page boundary, > @@ -415,6 +430,8 @@ sys_mmap(td, uap) > map: > td->td_fpop = fp; > maxprot &= cap_maxprot; > + > + /* This relies on VM_PROT_* matching PROT_*. */ > error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot, > flags, handle_type, handle, pos); > td->td_fpop = NULL; > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 13:48:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB7248A3; Tue, 16 Sep 2014 13:48:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6710F74; Tue, 16 Sep 2014 13:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GDmkRO077082; Tue, 16 Sep 2014 13:48:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GDmkvQ077081; Tue, 16 Sep 2014 13:48:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409161348.s8GDmkvQ077081@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Sep 2014 13:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271672 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 13:48:46 -0000 Author: tuexen Date: Tue Sep 16 13:48:46 2014 New Revision: 271672 URL: http://svnweb.freebsd.org/changeset/base/271672 Log: Small cleanup which addresses a warning regaring the truncation of a 64-bit entity to a 32-bit entity. This issue was reported by Peter Kasting from Google. MFC after: 3 days Modified: head/sys/netinet/sctp_cc_functions.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Tue Sep 16 11:07:25 2014 (r271671) +++ head/sys/netinet/sctp_cc_functions.c Tue Sep 16 13:48:46 2014 (r271672) @@ -1130,12 +1130,9 @@ sctp_cwnd_update_after_packet_dropped(st uint32_t * bottle_bw, uint32_t * on_queue) { uint32_t bw_avail; - int rtt; unsigned int incr; int old_cwnd = net->cwnd; - /* need real RTT in msd for this calc */ - rtt = net->rtt / 1000; /* get bottle neck bw */ *bottle_bw = ntohl(cp->bottle_bw); /* and whats on queue */ @@ -1144,10 +1141,11 @@ sctp_cwnd_update_after_packet_dropped(st * adjust the on-queue if our flight is more it could be that the * router has not yet gotten data "in-flight" to it */ - if (*on_queue < net->flight_size) + if (*on_queue < net->flight_size) { *on_queue = net->flight_size; - /* calculate the available space */ - bw_avail = (*bottle_bw * rtt) / 1000; + } + /* rtt is measured in micro seconds, bottle_bw in bytes per second */ + bw_avail = (uint32_t) (((uint64_t) (*bottle_bw) * net->rtt) / (uint64_t) 1000000); if (bw_avail > *bottle_bw) { /* * Cap the growth to no more than the bottle neck. This can @@ -1167,7 +1165,6 @@ sctp_cwnd_update_after_packet_dropped(st int seg_inflight, seg_onqueue, my_portion; net->partial_bytes_acked = 0; - /* how much are we over queue size? */ incr = *on_queue - bw_avail; if (stcb->asoc.seen_a_sack_this_pkt) { From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 14:10:05 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 972CE4D2; Tue, 16 Sep 2014 14:10:05 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 28338285; Tue, 16 Sep 2014 14:10:03 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA10218; Tue, 16 Sep 2014 17:10:01 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XTtSD-0004m2-5v; Tue, 16 Sep 2014 17:10:01 +0300 Message-ID: <54184481.3060804@FreeBSD.org> Date: Tue, 16 Sep 2014 17:09:05 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: John Baldwin , freebsd-java@FreeBSD.org Subject: Re: svn commit: r271635 - in head: lib/libc/sys sys/vm References: <201409151720.s8FHKDFs099885@svn.freebsd.org> <54183D4D.3050907@FreeBSD.org> In-Reply-To: <54183D4D.3050907@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 14:10:05 -0000 On 16/09/2014 16:38, Andriy Gapon wrote: > On 15/09/2014 20:20, John Baldwin wrote: >> Author: jhb >> Date: Mon Sep 15 17:20:13 2014 >> New Revision: 271635 >> URL: http://svnweb.freebsd.org/changeset/base/271635 >> >> Log: >> Add stricter checking of some mmap() arguments: >> - Fail with EINVAL if an invalid protection mask is passed to mmap(). >> - Fail with EINVAL if an unknown flag is passed to mmap(). >> - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). >> - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous >> mappings. > > This broke Java, at least java/openjdk7, for me: > > 25323 java CALL > mmap(0,0x3000000,0x3,0x1042,0xffffffff,0) > 25323 java RET mmap -1 errno 22 Invalid argument > 25323 java CALL write(0x1,0x7fffffbfd450,0x2b) > 25323 java GIO fd 1 wrote 43 bytes > "Error occurred during initialization of VM > " > 25323 java RET write 43/0x2b > 25323 java CALL write(0x1,0x80209a1e2,0x2d) > 25323 java GIO fd 1 wrote 45 bytes > "Could not reserve enough space for code cache" > > It seems that MAP_NORESERVE presence could be detected in sys/mman.h and then it > is used for some reason. No, it's not auto-detected, it's explicitly used in hotspot/src/os/bsd/vm/os_bsd.cpp. > I guess that the port can be easily fixed, but this commit breaks compatibility > with older binaries. Perhaps MAP_NORESERVE should be removed as well given that > we do not actually implement it. > >> Reviewed by: alc, kib >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D698 >> >> Modified: >> head/lib/libc/sys/mmap.2 >> head/sys/vm/vm_mmap.c -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 14:20:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65566A2F; Tue, 16 Sep 2014 14:20:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FE4B3F3; Tue, 16 Sep 2014 14:20:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GEKYHl093928; Tue, 16 Sep 2014 14:20:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GEKXmW093923; Tue, 16 Sep 2014 14:20:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409161420.s8GEKXmW093923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Sep 2014 14:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271673 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 14:20:34 -0000 Author: tuexen Date: Tue Sep 16 14:20:33 2014 New Revision: 271673 URL: http://svnweb.freebsd.org/changeset/base/271673 Log: Use a consistent type for the number of HMAC algorithms. This fixes a bug which resulted in a warning on the userland stack, when compiled on Windows. Thanks to Peter Kasting from Google for reporting the issue and provinding a potential fix. MFC after: 3 days Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Tue Sep 16 13:48:46 2014 (r271672) +++ head/sys/netinet/sctp_auth.c Tue Sep 16 14:20:33 2014 (r271673) @@ -631,7 +631,7 @@ sctp_copy_skeylist(const struct sctp_key sctp_hmaclist_t * -sctp_alloc_hmaclist(uint8_t num_hmacs) +sctp_alloc_hmaclist(uint16_t num_hmacs) { sctp_hmaclist_t *new_list; int alloc_size; @@ -1438,8 +1438,8 @@ sctp_auth_get_cookie_params(struct sctp_ p_random = (struct sctp_auth_random *)phdr; random_len = plen - sizeof(*p_random); } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; Modified: head/sys/netinet/sctp_auth.h ============================================================================== --- head/sys/netinet/sctp_auth.h Tue Sep 16 13:48:46 2014 (r271672) +++ head/sys/netinet/sctp_auth.h Tue Sep 16 14:20:33 2014 (r271673) @@ -154,7 +154,7 @@ sctp_auth_key_release(struct sctp_tcb *s /* hmac list handling */ -extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint8_t num_hmacs); +extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint16_t num_hmacs); extern void sctp_free_hmaclist(sctp_hmaclist_t * list); extern int sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id); extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t * list); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Sep 16 13:48:46 2014 (r271672) +++ head/sys/netinet/sctp_pcb.c Tue Sep 16 14:20:33 2014 (r271673) @@ -6509,8 +6509,8 @@ sctp_load_addresses_from_init(struct sct } got_random = 1; } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Sep 16 13:48:46 2014 (r271672) +++ head/sys/netinet/sctp_usrreq.c Tue Sep 16 14:20:33 2014 (r271673) @@ -4208,12 +4208,13 @@ sctp_setopt(struct socket *so, int optna uint32_t i; SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, optsize); - if (optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) { + if ((optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) || + (shmac->shmac_number_of_idents > 0xffff)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } - hmaclist = sctp_alloc_hmaclist(shmac->shmac_number_of_idents); + hmaclist = sctp_alloc_hmaclist((uint16_t) shmac->shmac_number_of_idents); if (hmaclist == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM); error = ENOMEM; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 14:39:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6F15F19; Tue, 16 Sep 2014 14:39:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91577833; Tue, 16 Sep 2014 14:39:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GEdOu3000781; Tue, 16 Sep 2014 14:39:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GEdOCr000780; Tue, 16 Sep 2014 14:39:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409161439.s8GEdOCr000780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 16 Sep 2014 14:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271674 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 14:39:24 -0000 Author: tuexen Date: Tue Sep 16 14:39:24 2014 New Revision: 271674 URL: http://svnweb.freebsd.org/changeset/base/271674 Log: Add a explict cast to silence a warning when building the userland stack on Windows. This issue was reported by Peter Kasting from Google. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Sep 16 14:20:33 2014 (r271673) +++ head/sys/netinet/sctputil.c Tue Sep 16 14:39:24 2014 (r271674) @@ -2403,8 +2403,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + (uint64_t) now.tv_usec; - /* computer rtt in ms */ - rtt = net->rtt / 1000; + /* compute rtt in ms */ + rtt = (int32_t) (net->rtt / 1000); if ((asoc->cc_functions.sctp_rtt_calculated) && (rtt_from_sack == SCTP_RTT_FROM_DATA)) { /* * Tell the CC module that a new update has just occurred From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 15:28:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB6599BE; Tue, 16 Sep 2014 15:28:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4558D1E; Tue, 16 Sep 2014 15:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GFSKni026327; Tue, 16 Sep 2014 15:28:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GFSKo2026324; Tue, 16 Sep 2014 15:28:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409161528.s8GFSKo2026324@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 16 Sep 2014 15:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271675 - in head: sys/netinet tests/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 15:28:21 -0000 Author: asomers Date: Tue Sep 16 15:28:19 2014 New Revision: 271675 URL: http://svnweb.freebsd.org/changeset/base/271675 Log: Fix source address selection on unbound sockets in the presence of multiple fibs. Use the mbuf's or the socket's fib instead of RT_ALL_FIBS. Fixes PR 187553. Also fixes netperf's UDP_STREAM test on a nondefault fib. sys/netinet/ip_output.c In ip_output, lookup the source address using the mbuf's fib instead of RT_ALL_FIBS. sys/netinet/in_pcb.c in in_pcbladdr, lookup the source address using the socket's fib, because we don't seem to have the mbuf fib. They should be the same, though. tests/sys/net/fibs_test.sh Clear the expected failure on udp_dontroute. PR: 187553 CR: https://reviews.freebsd.org/D772 MFC after: 3 weeks Sponsored by: Spectra Logic Modified: head/sys/netinet/in_pcb.c head/sys/netinet/ip_output.c head/tests/sys/netinet/fibs_test.sh Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Sep 16 14:39:24 2014 (r271674) +++ head/sys/netinet/in_pcb.c Tue Sep 16 15:28:19 2014 (r271675) @@ -793,10 +793,10 @@ in_pcbladdr(struct inpcb *inp, struct in struct ifnet *ifp; ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin, - RT_ALL_FIBS)); + inp->inp_socket->so_fibnum)); if (ia == NULL) ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0, - RT_ALL_FIBS)); + inp->inp_socket->so_fibnum)); if (ia == NULL) { error = ENETUNREACH; goto done; @@ -911,10 +911,11 @@ in_pcbladdr(struct inpcb *inp, struct in sain.sin_len = sizeof(struct sockaddr_in); sain.sin_addr.s_addr = faddr->s_addr; - ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain), RT_ALL_FIBS)); + ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain), + inp->inp_socket->so_fibnum)); if (ia == NULL) ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0, - RT_ALL_FIBS)); + inp->inp_socket->so_fibnum)); if (ia == NULL) ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue Sep 16 14:39:24 2014 (r271674) +++ head/sys/netinet/ip_output.c Tue Sep 16 15:28:19 2014 (r271675) @@ -236,9 +236,9 @@ again: */ if (flags & IP_SENDONES) { if ((ia = ifatoia(ifa_ifwithbroadaddr(sintosa(dst), - RT_ALL_FIBS))) == NULL && + M_GETFIB(m)))) == NULL && (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), - RT_ALL_FIBS))) == NULL) { + M_GETFIB(m)))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; @@ -251,9 +251,9 @@ again: isbroadcast = 1; } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), - RT_ALL_FIBS))) == NULL && + M_GETFIB(m)))) == NULL && (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0, - RT_ALL_FIBS))) == NULL) { + M_GETFIB(m)))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Tue Sep 16 14:39:24 2014 (r271674) +++ head/tests/sys/netinet/fibs_test.sh Tue Sep 16 15:28:19 2014 (r271675) @@ -366,7 +366,6 @@ udp_dontroute_head() udp_dontroute_body() { - atf_expect_fail "kern/187553 Source address selection for UDP packets with SO_DONTROUTE uses the default FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib ADDR0="192.0.2.2" From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 15:31:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A016B2F; Tue, 16 Sep 2014 15:31:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E998ADBE; Tue, 16 Sep 2014 15:31:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GFVCiP027733; Tue, 16 Sep 2014 15:31:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GFVC9e027732; Tue, 16 Sep 2014 15:31:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161531.s8GFVC9e027732@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 15:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271676 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 15:31:13 -0000 Author: gjb Date: Tue Sep 16 15:31:12 2014 New Revision: 271676 URL: http://svnweb.freebsd.org/changeset/base/271676 Log: Catch up with Crochet changes to fix the BEAGLEBONE build. Tested on: stable/10@r271618 MFC after: 3 days X-10.1-MFC: yes Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Tue Sep 16 15:28:19 2014 (r271675) +++ head/release/arm/release.sh Tue Sep 16 15:31:12 2014 (r271676) @@ -44,8 +44,8 @@ before_build() { case ${KERNEL} in BEAGLEBONE) WANT_UBOOT=1 - KNOWNHASH="4150e5a4480707c55a8d5b4570262e43af68d8ed3bdc0a433d8e7df47989a69e" - UBOOT_VERSION="u-boot-2013.04" + KNOWNHASH="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31" + UBOOT_VERSION="u-boot-2014.04" ;; PANDABOARD) WANT_UBOOT=1 From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 15:31:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33839C80; Tue, 16 Sep 2014 15:31:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E5D7DD0; Tue, 16 Sep 2014 15:31:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GFVoa6030231; Tue, 16 Sep 2014 15:31:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GFVoxm030230; Tue, 16 Sep 2014 15:31:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161531.s8GFVoxm030230@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 15:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271677 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 15:31:51 -0000 Author: gjb Date: Tue Sep 16 15:31:50 2014 New Revision: 271677 URL: http://svnweb.freebsd.org/changeset/base/271677 Log: Catch up with Crochet changes to fix the WANDBOARD-QUAD build. Tested on: stable/10@r271618 MFC after: 3 days X-10.1-MFC: yes X-MFC-With: r271676 Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Tue Sep 16 15:31:12 2014 (r271676) +++ head/release/arm/release.sh Tue Sep 16 15:31:50 2014 (r271677) @@ -54,8 +54,8 @@ before_build() { ;; WANDBOARD-QUAD) WANT_UBOOT=1 - KNOWNHASH="0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55" - UBOOT_VERSION="u-boot-2013.10" + KNOWNHASH="b4f83b8db325c21671a997198ec3a373e2e00dde2fcf17be9b9afd7cfd727f56" + UBOOT_VERSION="u-boot-2014.07" ;; *) # Fallthrough. From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 15:35:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3213720D; Tue, 16 Sep 2014 15:35:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 114A3ED1; Tue, 16 Sep 2014 15:35:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GFZEiK030774; Tue, 16 Sep 2014 15:35:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GFZEC6030769; Tue, 16 Sep 2014 15:35:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161535.s8GFZEC6030769@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 15:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271678 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 15:35:15 -0000 Author: gjb Date: Tue Sep 16 15:35:13 2014 New Revision: 271678 URL: http://svnweb.freebsd.org/changeset/base/271678 Log: Set a static revision of the Crochet checkout to avoid surprise build failures. MFC after: 3 days X-10.1-MFC: yes X-MFC-With: r271676, r271677 Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/WANDBOARD-QUAD.conf head/release/arm/ZEDBOARD.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Tue Sep 16 15:31:50 2014 (r271677) +++ head/release/arm/BEAGLEBONE.conf Tue Sep 16 15:35:13 2014 (r271678) @@ -33,5 +33,5 @@ load_target_env() { export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="BEAGLEBONE" export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" - export CROCHETBRANCH="trunk" + export CROCHETBRANCH="trunk@r744" } Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Tue Sep 16 15:31:50 2014 (r271677) +++ head/release/arm/PANDABOARD.conf Tue Sep 16 15:35:13 2014 (r271678) @@ -33,5 +33,5 @@ load_target_env() { export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="PANDABOARD" export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" - export CROCHETBRANCH="trunk" + export CROCHETBRANCH="trunk@r744" } Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Tue Sep 16 15:31:50 2014 (r271677) +++ head/release/arm/RPI-B.conf Tue Sep 16 15:35:13 2014 (r271678) @@ -33,7 +33,7 @@ load_target_env() { export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="RPI-B" export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" - export CROCHETBRANCH="trunk" + export CROCHETBRANCH="trunk@r744" export UBOOTSRC="https://github.com/gonzoua/u-boot-pi" export UBOOTBRANCH="trunk" export UBOOTDIR="/tmp/crochet/u-boot-rpi" Modified: head/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- head/release/arm/WANDBOARD-QUAD.conf Tue Sep 16 15:31:50 2014 (r271677) +++ head/release/arm/WANDBOARD-QUAD.conf Tue Sep 16 15:35:13 2014 (r271678) @@ -33,5 +33,5 @@ load_target_env() { export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="WANDBOARD-QUAD" export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" - export CROCHETBRANCH="trunk" + export CROCHETBRANCH="trunk@r744" } Modified: head/release/arm/ZEDBOARD.conf ============================================================================== --- head/release/arm/ZEDBOARD.conf Tue Sep 16 15:31:50 2014 (r271677) +++ head/release/arm/ZEDBOARD.conf Tue Sep 16 15:35:13 2014 (r271678) @@ -32,5 +32,5 @@ load_target_env() { export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" export KERNEL="ZEDBOARD" export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" - export CROCHETBRANCH="trunk" + export CROCHETBRANCH="trunk@r744" } From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 15:45:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFF1468B; Tue, 16 Sep 2014 15:45:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D96229E; Tue, 16 Sep 2014 15:45:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GFjrfX035442; Tue, 16 Sep 2014 15:45:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GFjreh035440; Tue, 16 Sep 2014 15:45:53 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409161545.s8GFjreh035440@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 16 Sep 2014 15:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271679 - head/sys/dev/altera/atse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 15:45:54 -0000 Author: bz Date: Tue Sep 16 15:45:53 2014 New Revision: 271679 URL: http://svnweb.freebsd.org/changeset/base/271679 Log: Merge atse(4) interrupt handling and race condition fixes from cheribsd: commit 8bd88585ed8e3f7def0d780a1bc30d96fe642b9c Rework atse_rx_cycles handling: count packets instead of fills, and use the limit only when polling, not when in interrupt mode. Otherwise, we may stop reading the FIFO midpacket and clear the event mask even though the FIFO still has data to read, which could stall receive when a large packet arrives. Add a comment about races in the Altera FIFO interface: we may need to do a little more work to handle races than we are. commit 20b39086cc612f8874dc9e6ef4c0c2eb777ba92a Use 'sizeof(data)' rather than '4' when checking an mbuf bound, as is the case for adjusting length/etc. commit e18953174a265f40e9ba60d76af7d288927f5382 Break out atse_intr() into two separate routines, one for each of the two interrupt sources: receive and transmit. commit 6deedb43246ab3f9f597918361831fbab7fac4ce For the RX interrupt, take interest only in ALMOSTEMPTY and OVERFLOW. For the TX interrupt, take interest only in ALMOSTFULL and UNDERFLOW. Perform TX atse_start_locked() once rather than twice in TX interrupt handling -- and only if !FULL, rather than unconditionally. commit 12601972ba08d4380201a74f5b967bdaeb23092c Experimentation suggests that the Altera Triple-Speed Ethernet documentation is incorrect and bits in the event and interrupt-enable registers are not irrationally rearranged relative to the status register. commit 3cff2ffad769289fce3a728152e7be09405385d8 Substantially rework interrupt handling in the atse(4) driver: - Introduce a new macro ATSE_TX_PENDING() which checks whether there is any pending data to transmit, either in an in-progress packet or in the TX queue. - Introduce new ATSE_RX_STATUS_READ() and ATSE_TX_STAUTS_WRITE() macros that query the FIFO status registers rather than event registers, offering level- rather than edge-triggered FIFO conditions. - For RX, interrupt only on full/overflow/underflow; for TX, interrupt only on empty/overflow/underflow. - Add new ATSE_RX_INTR_READ() and ATSE_RX_INTR_WRITE() macros useful for debugging interrupt behaviour. - Add a debug.atse_intr_debug_enable sysctl that causes various pieces of FIFO state to be printed out on each RX or TX interrupt. This is disabled by default but good to turn on if the interface appears to wedge. Also print debugging information when polling. - In the watchdog handler, do receive, not just transmit, processing, to ensure that the rx, not just tx, queue is being handled -- and, in particular, will be drained such that interrupts can resume. - Rework both atse_rx_intr() and atse_tx_intr() to eliminate many race conditions, and add comments on why various things are in various orders. Interactions between modifications to the event and interrupt masks are quite subtle indeed, and we must actively check for a number of races (e.g., event mask cleared; packet arrives; interrupts enabled). We also now use the status registers rather than event registers for FIFO status checks to avoid other races; we continue to use event registers for underflow/overflow. With this change, interrupt-driven operation of atse appears (for the time being) robust. commit 3393bbff5c68a4e61699f9b4a62af5d2a5f918f8 atse: Fix build after 3cff2ffa Obtained from: cheribsd Submitted by: rwatson, emaste Sponsored by: DARPA/AFRL MFC after: 3 days Modified: head/sys/dev/altera/atse/a_api.h head/sys/dev/altera/atse/if_atse.c Modified: head/sys/dev/altera/atse/a_api.h ============================================================================== --- head/sys/dev/altera/atse/a_api.h Tue Sep 16 15:35:13 2014 (r271678) +++ head/sys/dev/altera/atse/a_api.h Tue Sep 16 15:45:53 2014 (r271679) @@ -69,20 +69,20 @@ #define A_ONCHIP_FIFO_MEM_CORE_STATUS_UNDERFLOW (1<<5) /* Table 16-6. Event Bit Field Descriptions. */ -/* XXX Datasheet has weird bit fields. Validate. */ -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY (1<<0) -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_FULL (1<<1) -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTEMPTY (1<<2) -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTFULL (1<<3) +/* XXX Datasheet has incorrect bit fields. Validate. */ +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_FULL (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTFULL (1<<2) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTEMPTY (1<<3) #define A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW (1<<4) #define A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW (1<<5) /* Table 16-7. InterruptEnable Bit Field Descriptions. */ -/* XXX Datasheet has weird bit fields. Validate. */ -#define A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY (1<<0) -#define A_ONCHIP_FIFO_MEM_CORE_INTR_FULL (1<<1) -#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTEMPTY (1<<2) -#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTFULL (1<<3) +/* XXX Datasheet has incorrect bit fields. Validate. */ +#define A_ONCHIP_FIFO_MEM_CORE_INTR_FULL (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTFULL (1<<2) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTEMPTY (1<<3) #define A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW (1<<4) #define A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW (1<<5) #define A_ONCHIP_FIFO_MEM_CORE_INTR_ALL \ Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Tue Sep 16 15:35:13 2014 (r271678) +++ head/sys/dev/altera/atse/if_atse.c Tue Sep 16 15:45:53 2014 (r271679) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012,2013 Bjoern A. Zeeb + * Copyright (c) 2014 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -103,6 +104,11 @@ static poll_handler_t atse_poll; static int atse_ethernet_option_bits_flag = ATSE_ETHERNET_OPTION_BITS_UNDEF; static uint8_t atse_ethernet_option_bits[ALTERA_ETHERNET_OPTION_BITS_LEN]; +static int atse_intr_debug_enable = 0; +SYSCTL_INT(_debug, OID_AUTO, atse_intr_debug_enable, CTLFLAG_RW, + &atse_intr_debug_enable, 0, + "Extra debugging output for atse interrupts"); + /* * Softc and critical resource locking. */ @@ -110,6 +116,9 @@ static uint8_t atse_ethernet_option_bits #define ATSE_UNLOCK(_sc) mtx_unlock(&(_sc)->atse_mtx) #define ATSE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->atse_mtx, MA_OWNED) +#define ATSE_TX_PENDING(sc) (sc->atse_tx_m != NULL || \ + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + #ifdef DEBUG #define DPRINTF(format, ...) printf(format, __VA_ARGS__) #else @@ -169,6 +178,16 @@ a_onchip_fifo_mem_core_read(struct resou A_ONCHIP_FIFO_MEM_CORE_METADATA, \ "RXM", __func__, __LINE__) +#define ATSE_RX_STATUS_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_I_STATUS, \ + "RX_EVENT", __func__, __LINE__) + +#define ATSE_TX_STATUS_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_I_STATUS, \ + "TX_EVENT", __func__, __LINE__) + #define ATSE_RX_EVENT_READ(sc) \ a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ @@ -208,24 +227,41 @@ a_onchip_fifo_mem_core_read(struct resou val4, "TX_EVENT", __func__, __LINE__); \ } while(0) +#define ATSE_RX_EVENTS (A_ONCHIP_FIFO_MEM_CORE_INTR_FULL | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) #define ATSE_RX_INTR_ENABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_rxc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - A_ONCHIP_FIFO_MEM_CORE_INTR_ALL, \ + ATSE_RX_EVENTS, \ "RX_INTR", __func__, __LINE__) /* XXX-BZ review later. */ #define ATSE_RX_INTR_DISABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_rxc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, 0, \ "RX_INTR", __func__, __LINE__) +#define ATSE_RX_INTR_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ + "RX_INTR", __func__, __LINE__) + +#define ATSE_TX_EVENTS (A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) #define ATSE_TX_INTR_ENABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_txc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - A_ONCHIP_FIFO_MEM_CORE_INTR_ALL, \ + ATSE_TX_EVENTS, \ "TX_INTR", __func__, __LINE__) /* XXX-BZ review later. */ #define ATSE_TX_INTR_DISABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_txc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, 0, \ "TX_INTR", __func__, __LINE__) +#define ATSE_TX_INTR_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ + "TX_INTR", __func__, __LINE__) + +static int atse_rx_locked(struct atse_softc *sc); /* * Register space access macros. @@ -985,6 +1021,11 @@ atse_init(void *xsc) { struct atse_softc *sc; + /* + * XXXRW: There is some argument that we should immediately do RX + * processing after enabling interrupts, or one may not fire if there + * are buffered packets. + */ sc = (struct atse_softc *)xsc; ATSE_LOCK(sc); atse_init_locked(sc); @@ -1082,6 +1123,33 @@ atse_ioctl(struct ifnet *ifp, u_long com } static void +atse_intr_debug(struct atse_softc *sc, const char *intrname) +{ + uint32_t rxs, rxe, rxi, rxf, txs, txe, txi, txf; + + if (!atse_intr_debug_enable) + return; + + rxs = ATSE_RX_STATUS_READ(sc); + rxe = ATSE_RX_EVENT_READ(sc); + rxi = ATSE_RX_INTR_READ(sc); + rxf = ATSE_RX_READ_FILL_LEVEL(sc); + + txs = ATSE_TX_STATUS_READ(sc); + txe = ATSE_TX_EVENT_READ(sc); + txi = ATSE_TX_INTR_READ(sc); + txf = ATSE_TX_READ_FILL_LEVEL(sc); + + printf( + "%s - %s: " + "rxs 0x%x rxe 0x%x rxi 0x%x rxf 0x%x " + "txs 0x%x txe 0x%x txi 0x%x txf 0x%x\n", + __func__, intrname, + rxs, rxe, rxi, rxf, + txs, txe, txi, txf); +} + +static void atse_watchdog(struct atse_softc *sc) { @@ -1093,9 +1161,12 @@ atse_watchdog(struct atse_softc *sc) device_printf(sc->atse_dev, "watchdog timeout\n"); sc->atse_ifp->if_oerrors++; + atse_intr_debug(sc, "poll"); + sc->atse_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; atse_init_locked(sc); + atse_rx_locked(sc); if (!IFQ_DRV_IS_EMPTY(&sc->atse_ifp->if_snd)) atse_start_locked(sc->atse_ifp); } @@ -1169,10 +1240,6 @@ atse_rx_locked(struct atse_softc *sc) meta = 0; do { outer: - if (sc->atse_rx_cycles <= 0) - return (rx_npkts); - sc->atse_rx_cycles--; - if (sc->atse_rx_m == NULL) { m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) @@ -1238,7 +1305,8 @@ outer: data = ATSE_RX_DATA_READ(sc); #endif /* Make sure to not overflow the mbuf data size. */ - if (sc->atse_rx_buf_len >= sc->atse_rx_m->m_len - 4) { + if (sc->atse_rx_buf_len >= sc->atse_rx_m->m_len - + sizeof(data)) { /* * XXX-BZ Error. We need more mbufs and are * not setup for this yet. @@ -1275,15 +1343,19 @@ outer: if (sc->atse_flags & ATSE_FLAGS_ERROR) { sc->atse_flags &= ~ATSE_FLAGS_ERROR; m_freem(m); - /* Need to start with a new packet. */ - goto outer; + } else { + m->m_pkthdr.rcvif = ifp; + ATSE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + ATSE_LOCK(sc); } - - m->m_pkthdr.rcvif = ifp; - - ATSE_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - ATSE_LOCK(sc); +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + if (sc->atse_rx_cycles <= 0) + return (rx_npkts); + sc->atse_rx_cycles--; + } +#endif goto outer; /* Need a new mbuf. */ } else { sc->atse_rx_buf_len += sizeof(data); @@ -1291,7 +1363,7 @@ outer: } /* for */ /* XXX-BZ could optimize in case of another packet waiting. */ - } while ((meta & A_ONCHIP_FIFO_MEM_CORE_EOP) == 0 || fill > 0); + } while (fill > 0); return (rx_npkts); } @@ -1317,11 +1389,11 @@ atse_ifmedia_sts(struct ifnet *ifp, stru } static void -atse_intr(void *arg) +atse_rx_intr(void *arg) { struct atse_softc *sc; struct ifnet *ifp; - uint32_t rx, tx; + uint32_t rxe; sc = (struct atse_softc *)arg; ifp = sc->atse_ifp; @@ -1334,54 +1406,94 @@ atse_intr(void *arg) } #endif - ATSE_RX_INTR_DISABLE(sc); - ATSE_TX_INTR_DISABLE(sc); - - rx = ATSE_RX_EVENT_READ(sc); - tx = ATSE_TX_EVENT_READ(sc); - if (rx != 0) { - if (rx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| - A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { - /* XXX-BZ ERROR HANDLING. */ - atse_update_rx_err(sc, ((rx & - A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> - A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; - } - if ((rx & A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY) != 0) { - sc->atse_rx_cycles = RX_CYCLES_IN_INTR; - atse_rx_locked(sc); - } + atse_intr_debug(sc, "rx"); + rxe = ATSE_RX_EVENT_READ(sc); + if (rxe & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| + A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { + /* XXX-BZ ERROR HANDLING. */ + atse_update_rx_err(sc, ((rxe & + A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> + A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); + ifp->if_ierrors++; } - if (tx != 0) { - /* XXX-BZ build histogram. */ - if (tx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| - A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { - /* XXX-BZ ERROR HANDLING. */ - ifp->if_oerrors++; - } - if (tx & A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY) - sc->atse_watchdog_timer = 0; + + /* + * There is considerable subtlety in the race-free handling of rx + * interrupts: we must disable interrupts whenever we manipulate the + * FIFO to prevent further interrupts from firing before we are done; + * we must clear the event after processing to prevent the event from + * being immediately reposted due to data remaining; we must clear the + * event mask before reenabling interrupts or risk missing a positive + * edge; and we must recheck everything after completing in case the + * event posted between clearing events and reenabling interrupts. If + * a race is experienced, we must restart the whole mechanism. + */ + do { + ATSE_RX_INTR_DISABLE(sc); #if 0 - if (tx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY| - A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTEMPTY)) - atse_start_locked(ifp); + sc->atse_rx_cycles = RX_CYCLES_IN_INTR; #endif - } + atse_rx_locked(sc); + ATSE_RX_EVENT_CLEAR(sc); - /* Clear events before re-enabling intrs. */ - ATSE_TX_EVENT_CLEAR(sc); - ATSE_RX_EVENT_CLEAR(sc); + /* Disable interrupts if interface is down. */ + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ATSE_RX_INTR_ENABLE(sc); + } while (!(ATSE_RX_STATUS_READ(sc) & + A_ONCHIP_FIFO_MEM_CORE_STATUS_EMPTY)); + ATSE_UNLOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - /* Re-enable interrupts. */ - ATSE_RX_INTR_ENABLE(sc); - ATSE_TX_INTR_ENABLE(sc); +} - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - atse_start_locked(ifp); +static void +atse_tx_intr(void *arg) +{ + struct atse_softc *sc; + struct ifnet *ifp; + uint32_t txe; + + sc = (struct atse_softc *)arg; + ifp = sc->atse_ifp; + + ATSE_LOCK(sc); +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + ATSE_UNLOCK(sc); + return; + } +#endif + + /* XXX-BZ build histogram. */ + atse_intr_debug(sc, "tx"); + txe = ATSE_TX_EVENT_READ(sc); + if (txe & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| + A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { + /* XXX-BZ ERROR HANDLING. */ + ifp->if_oerrors++; } + /* + * There is also considerable subtlety in the race-free handling of + * tx interrupts: all processing occurs with interrupts disabled to + * prevent spurious refiring while transmit is in progress (which + * could occur if the FIFO drains while sending -- quite likely); we + * must not clear the event mask until after we've sent, also to + * prevent spurious refiring; once we've cleared the event mask we can + * reenable interrupts, but there is a possible race between clear and + * enable, so we must recheck and potentially repeat the whole process + * if it is detected. + */ + do { + ATSE_TX_INTR_DISABLE(sc); + sc->atse_watchdog_timer = 0; + atse_start_locked(ifp); + ATSE_TX_EVENT_CLEAR(sc); + + /* Disable interrupts if interface is down. */ + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ATSE_TX_INTR_ENABLE(sc); + } while (ATSE_TX_PENDING(sc) && + !(ATSE_TX_STATUS_READ(sc) & A_ONCHIP_FIFO_MEM_CORE_STATUS_FULL)); ATSE_UNLOCK(sc); } @@ -1422,7 +1534,7 @@ atse_poll(struct ifnet *ifp, enum poll_c /* XXX-BZ ERROR HANDLING. */ ifp->if_oerrors++; } - if (tx & A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY) + if (ATSE_TX_READ_FILL_LEVEL(sc) == 0) sc->atse_watchdog_timer = 0; #if 0 @@ -1719,7 +1831,7 @@ atse_attach(device_t dev) /* Hook up interrupts. */ if (sc->atse_rx_irq_res != NULL) { error = bus_setup_intr(dev, sc->atse_rx_irq_res, INTR_TYPE_NET | - INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_rx_intrhand); + INTR_MPSAFE, NULL, atse_rx_intr, sc, &sc->atse_rx_intrhand); if (error != 0) { device_printf(dev, "enabling RX IRQ failed\n"); ether_ifdetach(ifp); @@ -1729,7 +1841,7 @@ atse_attach(device_t dev) if (sc->atse_tx_irq_res != NULL) { error = bus_setup_intr(dev, sc->atse_tx_irq_res, INTR_TYPE_NET | - INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_tx_intrhand); + INTR_MPSAFE, NULL, atse_tx_intr, sc, &sc->atse_tx_intrhand); if (error != 0) { bus_teardown_intr(dev, sc->atse_rx_irq_res, sc->atse_rx_intrhand); From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 16:10:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 147BA19C for ; Tue, 16 Sep 2014 16:10:14 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E687034E for ; Tue, 16 Sep 2014 16:10:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GGADuh088966 for ; Tue, 16 Sep 2014 16:10:13 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8GGADdI088962 for svn-src-all@freebsd.org; Tue, 16 Sep 2014 16:10:13 GMT (envelope-from bdrewery) Received: (qmail 72404 invoked from network); 16 Sep 2014 11:10:09 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@10.10.1.90) by sweb.xzibition.com with ESMTPA; 16 Sep 2014 11:10:09 -0500 Message-ID: <541860E1.30800@FreeBSD.org> Date: Tue, 16 Sep 2014 11:10:09 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Glen Barber Subject: Re: svn commit: r271664 - head/sys/geom/eli References: <201409160840.s8G8eqR7033140@svn.freebsd.org> In-Reply-To: <201409160840.s8G8eqR7033140@svn.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 16:10:14 -0000 Relnotes: yes! On 9/16/14, 3:40 AM, Colin Percival wrote: > Author: cperciva > Date: Tue Sep 16 08:40:52 2014 > New Revision: 271664 > URL: http://svnweb.freebsd.org/changeset/base/271664 > > Log: > Cache GELI passphrases entered at the console during the boot process, > in order to improve user-friendliness when a system has multiple disks > encrypted using the same passphrase. > > When examining a new GELI provider, the most recently used passphrase > will be attempted before prompting for a passphrase; and whenever a > passphrase is entered, it is cached for later reference. When the root > disk is mounted, the cached passphrase is zeroed (triggered by the > "mountroot" event), in order to minimize the possibility of leakage > of passphrases. (After root is mounted, the "taste and prompt for > passphrases on the console" code path is disabled, so there is no > potential for a passphrase to be stored after the zeroing takes place.) > > This behaviour can be disabled by setting kern.geom.eli.boot_passcache=0. > > Reviewed by: pjd, dteske, allanjude > MFC after: 7 days > > Modified: > head/sys/geom/eli/g_eli.c > > Modified: head/sys/geom/eli/g_eli.c > ============================================================================== > --- head/sys/geom/eli/g_eli.c Tue Sep 16 05:45:38 2014 (r271663) > +++ head/sys/geom/eli/g_eli.c Tue Sep 16 08:40:52 2014 (r271664) > @@ -82,6 +82,24 @@ u_int g_eli_batch = 0; > SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RWTUN, &g_eli_batch, 0, > "Use crypto operations batching"); > > +/* > + * Passphrase cached during boot, in order to be more user-friendly if > + * there are multiple providers using the same passphrase. > + */ > +static char cached_passphrase[256]; > +static u_int g_eli_boot_passcache = 1; > +TUNABLE_INT("kern.geom.eli.boot_passcache", &g_eli_boot_passcache); > +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, boot_passcache, CTLFLAG_RD, > + &g_eli_boot_passcache, 0, > + "Passphrases are cached during boot process for possible reuse"); > +static void > +zero_boot_passcache(void * dummy) > +{ > + > + memset(cached_passphrase, 0, sizeof(cached_passphrase)); > +} > +EVENTHANDLER_DEFINE(mountroot, zero_boot_passcache, NULL, 0); > + > static eventhandler_tag g_eli_pre_sync = NULL; > > static int g_eli_destroy_geom(struct gctl_req *req, struct g_class *mp, > @@ -1059,7 +1077,7 @@ g_eli_taste(struct g_class *mp, struct g > tries = g_eli_tries; > } > > - for (i = 0; i < tries; i++) { > + for (i = 0; i <= tries; i++) { > g_eli_crypto_hmac_init(&ctx, NULL, 0); > > /* > @@ -1083,9 +1101,19 @@ g_eli_taste(struct g_class *mp, struct g > > /* Ask for the passphrase if defined. */ > if (md.md_iterations >= 0) { > - printf("Enter passphrase for %s: ", pp->name); > - cngets(passphrase, sizeof(passphrase), > - g_eli_visible_passphrase); > + /* Try first with cached passphrase. */ > + if (i == 0) { > + if (!g_eli_boot_passcache) > + continue; > + memcpy(passphrase, cached_passphrase, > + sizeof(passphrase)); > + } else { > + printf("Enter passphrase for %s: ", pp->name); > + cngets(passphrase, sizeof(passphrase), > + g_eli_visible_passphrase); > + memcpy(cached_passphrase, passphrase, > + sizeof(passphrase)); > + } > } > > /* > @@ -1115,15 +1143,18 @@ g_eli_taste(struct g_class *mp, struct g > error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); > bzero(key, sizeof(key)); > if (error == -1) { > - if (i == tries - 1) { > + if (i == tries) { > G_ELI_DEBUG(0, > "Wrong key for %s. No tries left.", > pp->name); > g_eli_keyfiles_clear(pp->name); > return (NULL); > } > - G_ELI_DEBUG(0, "Wrong key for %s. Tries left: %u.", > - pp->name, tries - i - 1); > + if (i > 0) { > + G_ELI_DEBUG(0, > + "Wrong key for %s. Tries left: %u.", > + pp->name, tries - i); > + } > /* Try again. */ > continue; > } else if (error > 0) { > -- Regards, Bryan Drewery From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 17:07:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 991F1AD4; Tue, 16 Sep 2014 17:07:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83EADCF5; Tue, 16 Sep 2014 17:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GH7WWa074002; Tue, 16 Sep 2014 17:07:32 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GH7Wla074001; Tue, 16 Sep 2014 17:07:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201409161707.s8GH7Wla074001@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 16 Sep 2014 17:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271680 - head/sys/dev/usb/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 17:07:32 -0000 Author: brooks Date: Tue Sep 16 17:07:32 2014 New Revision: 271680 URL: http://svnweb.freebsd.org/changeset/base/271680 Log: Fix some extra whitespace noticed when reviewing git diffs. Modified: head/sys/dev/usb/misc/uled.c Modified: head/sys/dev/usb/misc/uled.c ============================================================================== --- head/sys/dev/usb/misc/uled.c Tue Sep 16 15:45:53 2014 (r271679) +++ head/sys/dev/usb/misc/uled.c Tue Sep 16 17:07:32 2014 (r271680) @@ -231,7 +231,7 @@ uled_close(struct usb_fifo *fifo, int ff sc->sc_state &= ~ULED_ENABLED; } } - + static int uled_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags) { From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 17:08:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 4C932C2A; Tue, 16 Sep 2014 17:08:22 +0000 (UTC) Date: Tue, 16 Sep 2014 17:08:22 +0000 From: Alexey Dokuchaev To: Bryan Drewery Subject: Re: svn commit: r271664 - head/sys/geom/eli Message-ID: <20140916170822.GB69675@FreeBSD.org> References: <201409160840.s8G8eqR7033140@svn.freebsd.org> <541860E1.30800@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <541860E1.30800@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 17:08:22 -0000 On Tue, Sep 16, 2014 at 11:10:09AM -0500, Bryan Drewery wrote: > Relnotes: yes! > > [ lots of lines irrelevant to the point trimmed ] Overquoting: no! ./danfe From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 17:09:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BCB6D85 for ; Tue, 16 Sep 2014 17:09:23 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E133D12 for ; Tue, 16 Sep 2014 17:09:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GH9NIA009207 for ; Tue, 16 Sep 2014 17:09:23 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8GH9NlB009200 for svn-src-all@freebsd.org; Tue, 16 Sep 2014 17:09:23 GMT (envelope-from bdrewery) Received: (qmail 86908 invoked from network); 16 Sep 2014 12:09:21 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@10.10.1.90) by sweb.xzibition.com with ESMTPA; 16 Sep 2014 12:09:21 -0500 Message-ID: <54186EC1.8050909@FreeBSD.org> Date: Tue, 16 Sep 2014 12:09:21 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r271664 - head/sys/geom/eli References: <201409160840.s8G8eqR7033140@svn.freebsd.org> <541860E1.30800@FreeBSD.org> <20140916170822.GB69675@FreeBSD.org> In-Reply-To: <20140916170822.GB69675@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 17:09:23 -0000 On 9/16/14, 12:08 PM, Alexey Dokuchaev wrote: > On Tue, Sep 16, 2014 at 11:10:09AM -0500, Bryan Drewery wrote: >> Relnotes: yes! >> >> [ lots of lines irrelevant to the point trimmed ] > > Overquoting: no! > > ./danfe > Useless replies cc'ing everyone: No! -- Regards, Bryan Drewery From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 17:21:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED07240E; Tue, 16 Sep 2014 17:21:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8437E5E; Tue, 16 Sep 2014 17:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GHL6DU082348; Tue, 16 Sep 2014 17:21:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GHL6hf082347; Tue, 16 Sep 2014 17:21:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409161721.s8GHL6hf082347@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 Sep 2014 17:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271681 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 17:21:07 -0000 Author: jhb Date: Tue Sep 16 17:21:06 2014 New Revision: 271681 URL: http://svnweb.freebsd.org/changeset/base/271681 Log: Permit MAP_RENAME and MAP_NORESERVE for now. These flags should be removed, but at least Chromium and OpenJDK use MAP_NORESERVE. Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Tue Sep 16 17:07:32 2014 (r271680) +++ head/sys/vm/vm_mmap.c Tue Sep 16 17:21:06 2014 (r271681) @@ -244,10 +244,9 @@ sys_mmap(td, uap) flags |= MAP_ANON; pos = 0; } - /* XXX: MAP_RENAME, MAP_NORESERVE */ - if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_HASSEMAPHORE | - MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE | - MAP_PREFAULT_READ | + if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_RENAME | + MAP_NORESERVE | MAP_HASSEMAPHORE | MAP_STACK | MAP_NOSYNC | + MAP_ANON | MAP_EXCL | MAP_NOCORE | MAP_PREFAULT_READ | #ifdef MAP_32BIT MAP_32BIT | #endif From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 17:42:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B36CE1B; Tue, 16 Sep 2014 17:42:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA6211BB; Tue, 16 Sep 2014 17:42:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GHgb8C092552; Tue, 16 Sep 2014 17:42:37 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GHgbNU092551; Tue, 16 Sep 2014 17:42:37 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409161742.s8GHgbNU092551@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Tue, 16 Sep 2014 17:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271682 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 17:42:38 -0000 Author: dumbbell Date: Tue Sep 16 17:42:37 2014 New Revision: 271682 URL: http://svnweb.freebsd.org/changeset/base/271682 Log: vt(4): Fix a LOR which occurs during a call to vt_upgrade() Reported by: kib@ Review: https://reviews.freebsd.org/D785 Reviewed by: ray@ Approved by: ray@ MFC after: 2 days Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Sep 16 17:21:06 2014 (r271681) +++ head/sys/dev/vt/vt_core.c Tue Sep 16 17:42:37 2014 (r271682) @@ -2405,7 +2405,6 @@ vt_allocate(struct vt_driver *drv, void main_vd->vd_driver->vd_name, drv->vd_name); } vd = main_vd; - VT_LOCK(vd); if (vd->vd_flags & VDF_ASYNC) { /* Stop vt_flush periodic task. */ @@ -2421,6 +2420,7 @@ vt_allocate(struct vt_driver *drv, void * Reset VDF_TEXTMODE flag, driver who require that flag (vt_vga) will * set it. */ + VT_LOCK(vd); vd->vd_flags &= ~VDF_TEXTMODE; vd->vd_driver = drv; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 17:47:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1296CD; Tue, 16 Sep 2014 17:47:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B9A91E4; Tue, 16 Sep 2014 17:47:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GHlDgX093265; Tue, 16 Sep 2014 17:47:13 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GHlD4M093264; Tue, 16 Sep 2014 17:47:13 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409161747.s8GHlD4M093264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 16 Sep 2014 17:47: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: r271683 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 17:47:13 -0000 Author: smh Date: Tue Sep 16 17:47:13 2014 New Revision: 271683 URL: http://svnweb.freebsd.org/changeset/base/271683 Log: MFC 265253: Don't treat TRIM requests returning ENOTSUP as an unexpected error Approved by: re (gjb) Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Sep 16 17:42:37 2014 (r271682) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Sep 16 17:47:13 2014 (r271683) @@ -2738,7 +2738,10 @@ zio_vdev_io_done(zio_t *zio) zio->io_error = zio_handle_label_injection(zio, EIO); if (zio->io_error) { - if (!vdev_accessible(vd, zio)) { + if (zio->io_error == ENOTSUP && + zio->io_type == ZIO_TYPE_FREE) { + /* Not all devices support TRIM. */ + } else if (!vdev_accessible(vd, zio)) { zio->io_error = SET_ERROR(ENXIO); } else { unexpected_error = B_TRUE; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 18:02:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A51025FA; Tue, 16 Sep 2014 18:02:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F66C3FD; Tue, 16 Sep 2014 18:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GI2PXr002314; Tue, 16 Sep 2014 18:02:25 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GI2OYx002306; Tue, 16 Sep 2014 18:02:24 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409161802.s8GI2OYx002306@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Tue, 16 Sep 2014 18:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271684 - in head/sys: dev/vt/hw/efifb dev/vt/hw/fb powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 18:02:25 -0000 Author: dumbbell Date: Tue Sep 16 18:02:24 2014 New Revision: 271684 URL: http://svnweb.freebsd.org/changeset/base/271684 Log: vt(4): Use vt_fb_drawrect() and vt_fb_setpixel() in all vt_fb-derivative Review: https://reviews.freebsd.org/D789 Reviewed by: nwhitehorn Approved by: nwhitehorn MFC after: 2 days Modified: head/sys/dev/vt/hw/efifb/efifb.c head/sys/dev/vt/hw/fb/vt_early_fb.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/hw/fb/vt_fb.h head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Tue Sep 16 17:47:13 2014 (r271683) +++ head/sys/dev/vt/hw/efifb/efifb.c Tue Sep 16 18:02:24 2014 (r271684) @@ -62,6 +62,8 @@ static struct vt_driver vt_efifb_driver .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_early_fb.c Tue Sep 16 17:47:13 2014 (r271683) +++ head/sys/dev/vt/hw/fb/vt_early_fb.c Tue Sep 16 18:02:24 2014 (r271684) @@ -61,6 +61,8 @@ static struct vt_driver vt_fb_early_driv .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_priority = VD_PRIORITY_GENERIC, }; Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Tue Sep 16 17:47:13 2014 (r271683) +++ head/sys/dev/vt/hw/fb/vt_fb.c Tue Sep 16 18:02:24 2014 (r271684) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -static vd_drawrect_t vt_fb_drawrect; -static vd_setpixel_t vt_fb_setpixel; - static struct vt_driver vt_fb_driver = { .vd_name = "fb", .vd_init = vt_fb_init, @@ -146,7 +143,7 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff return (EINVAL); } -static void +void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color) { struct fb_info *info; @@ -181,7 +178,7 @@ vt_fb_setpixel(struct vt_device *vd, int } -static void +void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, term_color_t color) { Modified: head/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.h Tue Sep 16 17:47:13 2014 (r271683) +++ head/sys/dev/vt/hw/fb/vt_fb.h Tue Sep 16 18:02:24 2014 (r271684) @@ -40,6 +40,8 @@ vd_init_t vt_fb_init; vd_blank_t vt_fb_blank; vd_bitblt_text_t vt_fb_bitblt_text; vd_bitblt_bmp_t vt_fb_bitblt_bitmap; +vd_drawrect_t vt_fb_drawrect; +vd_setpixel_t vt_fb_setpixel; vd_postswitch_t vt_fb_postswitch; vd_fb_ioctl_t vt_fb_ioctl; vd_fb_mmap_t vt_fb_mmap; Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Tue Sep 16 17:47:13 2014 (r271683) +++ head/sys/powerpc/ps3/ps3_syscons.c Tue Sep 16 18:02:24 2014 (r271684) @@ -78,6 +78,8 @@ static struct vt_driver vt_ps3fb_driver .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 19:08:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 434BBC36; Tue, 16 Sep 2014 19:08:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22E55D7E; Tue, 16 Sep 2014 19:08:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJ8uYK031419; Tue, 16 Sep 2014 19:08:56 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJ8tZ3031411; Tue, 16 Sep 2014 19:08:55 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409161908.s8GJ8tZ3031411@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 16 Sep 2014 19:08: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: r271685 - stable/10/usr.sbin/bhyve 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 19:08:56 -0000 Author: grehan Date: Tue Sep 16 19:08:54 2014 New Revision: 271685 URL: http://svnweb.freebsd.org/changeset/base/271685 Log: MFC virtio-net changes. Re-tested with NetBSD/amd64 5.2.2, 6.1.4 and 7-beta. r271299: Add a callback to be notified about negotiated features. r271338: Allow vtnet operation without merged rx buffers. NetBSD's virtio-net implementation doesn't negotiate the merged rx-buffers feature. To support this, check to see if the feature was negotiated, and then adjust the operation of the receive path accordingly by using a larger iovec, and a smaller rx header. In addition, ignore writes to the (read-only) status byte. Approved by: re (glebius) Obtained from: Vincenzo Maffione, Universita` di Pisa (r271299) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/pci_virtio_net.c stable/10/usr.sbin/bhyve/pci_virtio_rnd.c stable/10/usr.sbin/bhyve/virtio.c stable/10/usr.sbin/bhyve/virtio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Tue Sep 16 19:08:54 2014 (r271685) @@ -133,6 +133,7 @@ static struct virtio_consts vtblk_vi_con pci_vtblk_notify, /* device-wide qnotify */ pci_vtblk_cfgread, /* read PCI config */ pci_vtblk_cfgwrite, /* write PCI config */ + NULL, /* apply negotiated features */ VTBLK_S_HOSTCAPS, /* our capabilities */ }; Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Tue Sep 16 19:08:54 2014 (r271685) @@ -135,11 +135,14 @@ struct pci_vtnet_softc { int vsc_rx_ready; volatile int resetting; /* set and checked outside lock */ - uint32_t vsc_features; + uint64_t vsc_features; /* negotiated features */ + struct virtio_net_config vsc_config; pthread_mutex_t rx_mtx; int rx_in_progress; + int rx_vhdrlen; + int rx_merge; /* merged rx bufs in use */ pthread_t tx_tid; pthread_mutex_t tx_mtx; @@ -151,6 +154,7 @@ static void pci_vtnet_reset(void *); /* static void pci_vtnet_notify(void *, struct vqueue_info *); */ static int pci_vtnet_cfgread(void *, int, int, uint32_t *); static int pci_vtnet_cfgwrite(void *, int, int, uint32_t); +static void pci_vtnet_neg_features(void *, uint64_t); static struct virtio_consts vtnet_vi_consts = { "vtnet", /* our name */ @@ -160,6 +164,7 @@ static struct virtio_consts vtnet_vi_con NULL, /* device-wide qnotify -- not used */ pci_vtnet_cfgread, /* read PCI config */ pci_vtnet_cfgwrite, /* write PCI config */ + pci_vtnet_neg_features, /* apply negotiated features */ VTNET_S_HOSTCAPS, /* our capabilities */ }; @@ -212,6 +217,8 @@ pci_vtnet_reset(void *vsc) pci_vtnet_rxwait(sc); sc->vsc_rx_ready = 0; + sc->rx_merge = 1; + sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); /* now reset rings, MSI-X vectors, and negotiated capabilities */ vi_reset_dev(&sc->vsc_vs); @@ -253,14 +260,34 @@ pci_vtnet_tap_tx(struct pci_vtnet_softc */ static uint8_t dummybuf[2048]; +static __inline struct iovec * +rx_iov_trim(struct iovec *iov, int *niov, int tlen) +{ + struct iovec *riov; + + /* XXX short-cut: assume first segment is >= tlen */ + assert(iov[0].iov_len >= tlen); + + iov[0].iov_len -= tlen; + if (iov[0].iov_len == 0) { + assert(*niov > 1); + *niov -= 1; + riov = &iov[1]; + } else { + iov[0].iov_base = (void *)((uintptr_t)iov[0].iov_base + tlen); + riov = &iov[0]; + } + + return (riov); +} + static void pci_vtnet_tap_rx(struct pci_vtnet_softc *sc) { + struct iovec iov[VTNET_MAXSEGS], *riov; struct vqueue_info *vq; - struct virtio_net_rxhdr *vrx; - uint8_t *buf; - int len; - struct iovec iov; + void *vrx; + int len, n; /* * Should never be called without a valid tap fd @@ -296,21 +323,19 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc do { /* - * Get descriptor chain, which should have just - * one descriptor in it. - * ??? allow guests to use multiple descs? + * Get descriptor chain. */ - assert(vq_getchain(vq, &iov, 1, NULL) == 1); + n = vq_getchain(vq, iov, VTNET_MAXSEGS, NULL); + assert(n >= 1 && n <= VTNET_MAXSEGS); /* * Get a pointer to the rx header, and use the * data immediately following it for the packet buffer. */ - vrx = iov.iov_base; - buf = (uint8_t *)(vrx + 1); + vrx = iov[0].iov_base; + riov = rx_iov_trim(iov, &n, sc->rx_vhdrlen); - len = read(sc->vsc_tapfd, buf, - iov.iov_len - sizeof(struct virtio_net_rxhdr)); + len = readv(sc->vsc_tapfd, riov, n); if (len < 0 && errno == EWOULDBLOCK) { /* @@ -323,16 +348,21 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc /* * The only valid field in the rx packet header is the - * number of buffers, which is always 1 without TSO - * support. + * number of buffers if merged rx bufs were negotiated. */ - memset(vrx, 0, sizeof(struct virtio_net_rxhdr)); - vrx->vrh_bufs = 1; + memset(vrx, 0, sc->rx_vhdrlen); + + if (sc->rx_merge) { + struct virtio_net_rxhdr *vrxh; + + vrxh = vrx; + vrxh->vrh_bufs = 1; + } /* * Release this chain and handle more chains. */ - vq_relchain(vq, len + sizeof(struct virtio_net_rxhdr)); + vq_relchain(vq, len + sc->rx_vhdrlen); } while (vq_has_descs(vq)); /* Interrupt if needed, including for NOTIFY_ON_EMPTY. */ @@ -623,6 +653,8 @@ pci_vtnet_init(struct vmctx *ctx, struct sc->resetting = 0; + sc->rx_merge = 1; + sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); sc->rx_in_progress = 0; pthread_mutex_init(&sc->rx_mtx, NULL); @@ -656,9 +688,10 @@ pci_vtnet_cfgwrite(void *vsc, int offset ptr = &sc->vsc_config.mac[offset]; memcpy(ptr, &value, size); } else { + /* silently ignore other writes */ DPRINTF(("vtnet: write to readonly reg %d\n\r", offset)); - return (1); } + return (0); } @@ -673,6 +706,20 @@ pci_vtnet_cfgread(void *vsc, int offset, return (0); } +static void +pci_vtnet_neg_features(void *vsc, uint64_t negotiated_features) +{ + struct pci_vtnet_softc *sc = vsc; + + sc->vsc_features = negotiated_features; + + if (!(sc->vsc_features & VIRTIO_NET_F_MRG_RXBUF)) { + sc->rx_merge = 0; + /* non-merge rx header is 2 bytes shorter */ + sc->rx_vhdrlen -= 2; + } +} + struct pci_devemu pci_de_vnet = { .pe_emu = "virtio-net", .pe_init = pci_vtnet_init, Modified: stable/10/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Tue Sep 16 19:08:54 2014 (r271685) @@ -80,6 +80,7 @@ static struct virtio_consts vtrnd_vi_con pci_vtrnd_notify, /* device-wide qnotify */ NULL, /* read virtio config */ NULL, /* write virtio config */ + NULL, /* apply negotiated features */ 0, /* our capabilities */ }; Modified: stable/10/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.c Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/virtio.c Tue Sep 16 19:08:54 2014 (r271685) @@ -694,6 +694,9 @@ bad: switch (offset) { case VTCFG_R_GUESTCAP: vs->vs_negotiated_caps = value & vc->vc_hv_caps; + if (vc->vc_apply_features) + (*vc->vc_apply_features)(DEV_SOFTC(vs), + vs->vs_negotiated_caps); break; case VTCFG_R_PFN: if (vs->vs_curq >= vc->vc_nvq) Modified: stable/10/usr.sbin/bhyve/virtio.h ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.h Tue Sep 16 18:02:24 2014 (r271684) +++ stable/10/usr.sbin/bhyve/virtio.h Tue Sep 16 19:08:54 2014 (r271685) @@ -352,6 +352,8 @@ struct virtio_consts { /* called to read config regs */ int (*vc_cfgwrite)(void *, int, int, uint32_t); /* called to write config regs */ + void (*vc_apply_features)(void *, uint64_t); + /* called to apply negotiated features */ uint64_t vc_hv_caps; /* hypervisor-provided capabilities */ }; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 19:20:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46E5CFBA; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31B3DE86; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJK7uu036457; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJK7vh036456; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161920.s8GJK7vh036456@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:20: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: r271686 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 19:20:07 -0000 Author: gjb Date: Tue Sep 16 19:20:06 2014 New Revision: 271686 URL: http://svnweb.freebsd.org/changeset/base/271686 Log: Bump __FreeBSD_version after SA-14:19.tcp Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/8/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Tue Sep 16 19:08:54 2014 (r271685) +++ stable/10/sys/sys/param.h Tue Sep 16 19:20:06 2014 (r271686) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000715 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000716 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 19:20:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D2CBFB9; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC0EDE85; Tue, 16 Sep 2014 19:20:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJK6PN036451; Tue, 16 Sep 2014 19:20:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJK6Nw036450; Tue, 16 Sep 2014 19:20:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161920.s8GJK6Nw036450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271686 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 19:20:07 -0000 Author: gjb Date: Tue Sep 16 19:20:06 2014 New Revision: 271686 URL: http://svnweb.freebsd.org/changeset/base/271686 Log: Bump __FreeBSD_version after SA-14:19.tcp Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Tue Sep 16 19:08:54 2014 (r271685) +++ stable/8/sys/sys/param.h Tue Sep 16 19:20:06 2014 (r271686) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 804504 /* Master, propagated to newvers */ +#define __FreeBSD_version 804505 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 19:20:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA4DEFBC; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D58A4E88; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJK71U036469; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJK7aS036468; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161920.s8GJK7aS036468@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:20: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: r271686 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 19:20:08 -0000 Author: gjb Date: Tue Sep 16 19:20:06 2014 New Revision: 271686 URL: http://svnweb.freebsd.org/changeset/base/271686 Log: Bump __FreeBSD_version after SA-14:19.tcp Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/8/sys/sys/param.h Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Tue Sep 16 19:08:54 2014 (r271685) +++ stable/9/sys/sys/param.h Tue Sep 16 19:20:06 2014 (r271686) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 903503 /* Master, propagated to newvers */ +#define __FreeBSD_version 903504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 19:20:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98099FBB; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 837A4E87; Tue, 16 Sep 2014 19:20:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJK74b036463; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJK7IP036462; Tue, 16 Sep 2014 19:20:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161920.s8GJK7IP036462@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271686 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 19:20:07 -0000 Author: gjb Date: Tue Sep 16 19:20:06 2014 New Revision: 271686 URL: http://svnweb.freebsd.org/changeset/base/271686 Log: Bump __FreeBSD_version after SA-14:19.tcp Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/param.h Changes in other areas also in this revision: Modified: stable/10/sys/sys/param.h stable/8/sys/sys/param.h stable/9/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Sep 16 19:08:54 2014 (r271685) +++ head/sys/sys/param.h Tue Sep 16 19:20:06 2014 (r271686) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100033 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100034 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 19:25:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29A2462E; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1429DF62; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJPRW3040575; Tue, 16 Sep 2014 19:25:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJPRT6040574; Tue, 16 Sep 2014 19:25:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161925.s8GJPRT6040574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:25: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: r271687 - in stable: 10/release/doc/en_US.ISO8859-1/errata 9/release/doc/en_US.ISO8859-1/errata 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 19:25:28 -0000 Author: gjb Date: Tue Sep 16 19:25:27 2014 New Revision: 271687 URL: http://svnweb.freebsd.org/changeset/base/271687 Log: Document SA-14:19 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Changes in other areas also in this revision: Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:20:06 2014 (r271686) +++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:25:27 2014 (r271687) @@ -227,6 +227,13 @@ 9 September 2014 Multiple vulnerabilities + + + SA-14:19.tcp + 16 September 2014 + Denial of Service in TCP packet + processing. + From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 19:25:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B4362F; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F93BF63; Tue, 16 Sep 2014 19:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GJPS3L040581; Tue, 16 Sep 2014 19:25:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GJPSl4040580; Tue, 16 Sep 2014 19:25:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409161925.s8GJPSl4040580@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Sep 2014 19:25:28 +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: r271687 - in stable: 10/release/doc/en_US.ISO8859-1/errata 9/release/doc/en_US.ISO8859-1/errata 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 19:25:28 -0000 Author: gjb Date: Tue Sep 16 19:25:27 2014 New Revision: 271687 URL: http://svnweb.freebsd.org/changeset/base/271687 Log: Document SA-14:19 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:20:06 2014 (r271686) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Tue Sep 16 19:25:27 2014 (r271687) @@ -105,6 +105,13 @@ 9 September 2014 Multiple vulnerabilities + + + SA-14:19.tcp + 16 September 2014 + Denial of Service in TCP packet + processing. + From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 20:02:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD270330; Tue, 16 Sep 2014 20:02:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8C093F0; Tue, 16 Sep 2014 20:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GK2GaX058967; Tue, 16 Sep 2014 20:02:16 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GK2GNw058965; Tue, 16 Sep 2014 20:02:16 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409162002.s8GK2GNw058965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 16 Sep 2014 20:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271688 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 20:02:16 -0000 Author: sbruno Date: Tue Sep 16 20:02:16 2014 New Revision: 271688 URL: http://svnweb.freebsd.org/changeset/base/271688 Log: Add proper disable/enable hooks to the default scripts so that this is only run when asked for by the user. Right now, hv_kvpd is run on every boot. Don't do that. Add hv_kvpd_enable= for this script to be run. MFC with 271493 MFC after: 2 weeks Relnotes: yes Modified: head/etc/defaults/rc.conf head/etc/rc.d/hv_kvpd Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Sep 16 19:25:27 2014 (r271687) +++ head/etc/defaults/rc.conf Tue Sep 16 20:02:16 2014 (r271688) @@ -684,6 +684,8 @@ jail_enable="NO" # Set to NO to disable jail_parallel_start="NO" # Start jails in the background jail_list="" # Space separated list of names of jails +hv_kvpd_enable="NO" # Start the Hyper-V key-value Pair Driver hv_kvp(4) + ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## ### scripts to source rc_conf_files overrides safely. ## Modified: head/etc/rc.d/hv_kvpd ============================================================================== --- head/etc/rc.d/hv_kvpd Tue Sep 16 19:25:27 2014 (r271687) +++ head/etc/rc.d/hv_kvpd Tue Sep 16 20:02:16 2014 (r271688) @@ -8,6 +8,7 @@ . /etc/rc.subr name="hv_kvp_daemon" +rcvar="kp_kvpd_enable" command="/usr/sbin/${name}" required_dirs="/var/db/hyperv" From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 20:48:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38D934D0; Tue, 16 Sep 2014 20:48:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24CBEA6D; Tue, 16 Sep 2014 20:48:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GKmETZ078975; Tue, 16 Sep 2014 20:48:14 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GKmEbQ078974; Tue, 16 Sep 2014 20:48:14 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409162048.s8GKmEbQ078974@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 16 Sep 2014 20:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271689 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 20:48:14 -0000 Author: sbruno Date: Tue Sep 16 20:48:13 2014 New Revision: 271689 URL: http://svnweb.freebsd.org/changeset/base/271689 Log: Such typo, many email, very spelling. wow. MFC with 271688 271493 Submitted by: ngie ian MFC after: 2 weeks Relnotes: yes Modified: head/etc/rc.d/hv_kvpd Modified: head/etc/rc.d/hv_kvpd ============================================================================== --- head/etc/rc.d/hv_kvpd Tue Sep 16 20:02:16 2014 (r271688) +++ head/etc/rc.d/hv_kvpd Tue Sep 16 20:48:13 2014 (r271689) @@ -8,7 +8,7 @@ . /etc/rc.subr name="hv_kvp_daemon" -rcvar="kp_kvpd_enable" +rcvar="hv_kvpd_enable" command="/usr/sbin/${name}" required_dirs="/var/db/hyperv" From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 21:26:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56B56348; Tue, 16 Sep 2014 21:26:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41C5FE44; Tue, 16 Sep 2014 21:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GLQPm3097600; Tue, 16 Sep 2014 21:26:25 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GLQP1C097599; Tue, 16 Sep 2014 21:26:25 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201409162126.s8GLQP1C097599@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Tue, 16 Sep 2014 21:26: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: r271690 - stable/10/sys/netinet/cc 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 21:26:25 -0000 Author: lstewart Date: Tue Sep 16 21:26:24 2014 New Revision: 271690 URL: http://svnweb.freebsd.org/changeset/base/271690 Log: MFC r270160: Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage Approved by: re(gjb) Modified: stable/10/sys/netinet/cc/cc_cdg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/10/sys/netinet/cc/cc_cdg.c Tue Sep 16 20:48:13 2014 (r271689) +++ stable/10/sys/netinet/cc/cc_cdg.c Tue Sep 16 21:26:24 2014 (r271690) @@ -221,6 +221,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_ba /* Function prototypes. */ static int cdg_mod_init(void); +static int cdg_mod_destroy(void); static void cdg_conn_init(struct cc_var *ccv); static int cdg_cb_init(struct cc_var *ccv); static void cdg_cb_destroy(struct cc_var *ccv); @@ -234,7 +235,8 @@ struct cc_algo cdg_cc_algo = { .cb_destroy = cdg_cb_destroy, .cb_init = cdg_cb_init, .conn_init = cdg_conn_init, - .cong_signal = cdg_cong_signal + .cong_signal = cdg_cong_signal, + .mod_destroy = cdg_mod_destroy }; /* Vnet created and being initialised. */ @@ -278,6 +280,14 @@ cdg_mod_init(void) } static int +cdg_mod_destroy(void) +{ + + uma_zdestroy(qdiffsample_zone); + return (0); +} + +static int cdg_cb_init(struct cc_var *ccv) { struct cdg *cdg_data; From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 21:48:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CC6C918; Tue, 16 Sep 2014 21:48:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D40CBC; Tue, 16 Sep 2014 21:48:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GLmned007241; Tue, 16 Sep 2014 21:48:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GLmnYE007240; Tue, 16 Sep 2014 21:48:49 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409162148.s8GLmnYE007240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 16 Sep 2014 21:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271691 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 21:48:49 -0000 Author: melifaro Date: Tue Sep 16 21:48:48 2014 New Revision: 271691 URL: http://svnweb.freebsd.org/changeset/base/271691 Log: * Fix if_omcast handling * Convert if_oerrors to pcpu. Suggested by: glebius MFC after: 2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Sep 16 21:26:24 2014 (r271690) +++ head/sys/net/if_vlan.c Tue Sep 16 21:48:48 2014 (r271691) @@ -104,14 +104,15 @@ struct vlan_mc_entry { struct ifvlan { struct ifvlantrunk *ifv_trunk; struct ifnet *ifv_ifp; - void *ifv_cookie; counter_u64_t ifv_ipackets; counter_u64_t ifv_ibytes; counter_u64_t ifv_opackets; counter_u64_t ifv_obytes; counter_u64_t ifv_omcasts; + counter_u64_t ifv_oerrors; #define TRUNK(ifv) ((ifv)->ifv_trunk) #define PARENT(ifv) ((ifv)->ifv_trunk->parent) + void *ifv_cookie; int ifv_pflags; /* special flags we have set on parent */ struct ifv_linkmib { int ifvm_encaplen; /* encapsulation length */ @@ -959,6 +960,7 @@ vlan_clone_create(struct if_clone *ifc, ifv->ifv_ibytes = counter_u64_alloc(M_WAITOK); ifv->ifv_obytes = counter_u64_alloc(M_WAITOK); ifv->ifv_omcasts = counter_u64_alloc(M_WAITOK); + ifv->ifv_oerrors = counter_u64_alloc(M_WAITOK); ifp->if_softc = ifv; /* @@ -1026,6 +1028,7 @@ vlan_clone_destroy(struct if_clone *ifc, counter_u64_free(ifv->ifv_ibytes); counter_u64_free(ifv->ifv_obytes); counter_u64_free(ifv->ifv_omcasts); + counter_u64_free(ifv->ifv_oerrors); free(ifv, M_VLAN); ifc_free_unit(ifc, unit); @@ -1063,7 +1066,7 @@ vlan_transmit(struct ifnet *ifp, struct */ if (!UP_AND_RUNNING(p)) { m_freem(m); - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); return (ENETDOWN); } @@ -1090,7 +1093,7 @@ vlan_transmit(struct ifnet *ifp, struct if (n > 0) { if_printf(ifp, "cannot pad short frame\n"); - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); m_freem(m); return (0); } @@ -1110,7 +1113,7 @@ vlan_transmit(struct ifnet *ifp, struct m = ether_vlanencap(m, ifv->ifv_vid); if (m == NULL) { if_printf(ifp, "unable to prepend VLAN header\n"); - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); return (0); } } @@ -1122,9 +1125,9 @@ vlan_transmit(struct ifnet *ifp, struct if (error == 0) { counter_u64_add(ifv->ifv_opackets, 1); counter_u64_add(ifv->ifv_obytes, len); - counter_u64_add(ifv->ifv_omcasts, 1); + counter_u64_add(ifv->ifv_omcasts, mcast); } else - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); return (error); } @@ -1146,6 +1149,8 @@ vlan_get_counter(struct ifnet *ifp, ifne return (counter_u64_fetch(ifv->ifv_obytes)); case IFCOUNTER_OMCASTS: return (counter_u64_fetch(ifv->ifv_omcasts)); + case IFCOUNTER_OERRORS: + return (counter_u64_fetch(ifv->ifv_oerrors)); default: return (if_get_counter_compat(ifp, cnt)); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 21:51:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D80ACA3; Tue, 16 Sep 2014 21:51:14 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0278E6; Tue, 16 Sep 2014 21:51:13 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XTwfn-000FfC-Qp; Tue, 16 Sep 2014 21:36:15 +0400 Message-ID: <5418B088.8060603@FreeBSD.org> Date: Wed, 17 Sep 2014 01:50:00 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r271538 - head/sys/net References: <201409131813.s8DID8vR061538@svn.freebsd.org> <20140915105653.GR60617@FreeBSD.org> In-Reply-To: <20140915105653.GR60617@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 21:51:14 -0000 On 15.09.2014 14:56, Gleb Smirnoff wrote: > On Sat, Sep 13, 2014 at 06:13:08PM +0000, Alexander V. Chernikov wrote: > A> @@ -1099,15 +1117,39 @@ vlan_transmit(struct ifnet *ifp, struct > A> * Send it, precisely as ether_output() would have. > A> */ > A> error = (p->if_transmit)(p, m); > A> - if (!error) { > A> - ifp->if_opackets++; > A> - ifp->if_omcasts += mcast; > A> - ifp->if_obytes += len; > A> + if (error == 0) { > A> + counter_u64_add(ifv->ifv_opackets, 1); > A> + counter_u64_add(ifv->ifv_obytes, len); > A> + counter_u64_add(ifv->ifv_omcasts, 1); > A> } else > A> ifp->if_oerrors++; > A> return (error); > A> } > > This looks like counting all packets as multicasts. Strange that compiler > didn't warn you about write only variable. Unfortunately, clang does not warn about this kind of thing. > > P.S. Why did you decide to keep if_oerrors old style? Id had a stong feeling that oerrors is used both by drivers and stack. It looks like this is not the case. I've committed both changes in r271691. > From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 22:26:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90907664; Tue, 16 Sep 2014 22:26:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D088699; Tue, 16 Sep 2014 22:26:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GMQ2te026025; Tue, 16 Sep 2014 22:26:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GMQ21V026024; Tue, 16 Sep 2014 22:26:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409162226.s8GMQ21V026024@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Sep 2014 22:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271692 - head/usr.bin/elfdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 22:26:02 -0000 Author: markj Date: Tue Sep 16 22:26:01 2014 New Revision: 271692 URL: http://svnweb.freebsd.org/changeset/base/271692 Log: Fix a typo. MFC after: 3 days Modified: head/usr.bin/elfdump/elfdump.1 Modified: head/usr.bin/elfdump/elfdump.1 ============================================================================== --- head/usr.bin/elfdump/elfdump.1 Tue Sep 16 21:48:48 2014 (r271691) +++ head/usr.bin/elfdump/elfdump.1 Tue Sep 16 22:26:01 2014 (r271692) @@ -50,7 +50,7 @@ The options are as follows: .It Fl a Dump all information. .It Fl c -Dump shared headers. +Dump section headers. .It Fl d Dump dynamic symbols. .It Fl e From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 22:54:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AADDF6; Tue, 16 Sep 2014 22:54:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B9679B6; Tue, 16 Sep 2014 22:54:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GMsHae039905; Tue, 16 Sep 2014 22:54:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GMsGuD039889; Tue, 16 Sep 2014 22:54:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409162254.s8GMsGuD039889@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Sep 2014 22:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271693 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Sep 2014 22:54:18 -0000 Author: markj Date: Tue Sep 16 22:54:15 2014 New Revision: 271693 URL: http://svnweb.freebsd.org/changeset/base/271693 Log: Fix elfdump(1) usage in the userland CTF tests. PR: 193110 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -31,7 +31,7 @@ dtrace=$1 t="zelda_info_t" exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -28,7 +28,7 @@ dtrace=$1 t="season_7_lisa_the_vegetrian_t *" exe="tst.aouttype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -29,7 +29,7 @@ dtrace=$1 t="zelda_info_t" exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -29,7 +29,7 @@ dtrace=$1 t="int" exe="tst.libtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -eq 0 ]]; then echo "CTF exists in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -28,7 +28,7 @@ dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -29,7 +29,7 @@ dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -28,7 +28,7 @@ dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -29,7 +29,7 @@ dtrace=$1 t="final_fantasy_info_t" exe="tst.printtype.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -29,7 +29,7 @@ dtrace=$1 t="zelda_info_t" exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh Tue Sep 16 22:26:01 2014 (r271692) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh Tue Sep 16 22:54:15 2014 (r271693) @@ -28,7 +28,7 @@ fi dtrace=$1 exe="tst.chasestrings.exe" -elfdump "./$exe" | grep -q '.SUNW_ctf' +elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 00:54:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A65C954; Wed, 17 Sep 2014 00:54:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C68475A; Wed, 17 Sep 2014 00:54:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H0s1Kn096326; Wed, 17 Sep 2014 00:54:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H0s078096323; Wed, 17 Sep 2014 00:54:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409170054.s8H0s078096323@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Sep 2014 00:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271695 - in head/cddl/contrib/opensolaris/lib: libctf/common libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 00:54:01 -0000 Author: markj Date: Wed Sep 17 00:54:00 2014 New Revision: 271695 URL: http://svnweb.freebsd.org/changeset/base/271695 Log: Fix some incorrect endianness checks. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Wed Sep 17 00:30:25 2014 (r271694) +++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Wed Sep 17 00:54:00 2014 (r271695) @@ -274,7 +274,7 @@ ctf_fdopen(int fd, int *errp) */ if (nbytes >= (ssize_t) sizeof (Elf32_Ehdr) && bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) { -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN uchar_t order = ELFDATA2MSB; #else uchar_t order = ELFDATA2LSB; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Wed Sep 17 00:30:25 2014 (r271694) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Wed Sep 17 00:54:00 2014 (r271695) @@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong * to the lowest 'size' bytes in 'value', and we need to shift based on * the offset from the end of the data, not the offset of the start. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN buf += sizeof (value) - size; off += ep->cte_bits; #endif @@ -178,7 +178,7 @@ print_bitfield(dt_printarg_t *pap, ulong * Offsets are counted from opposite ends on little- and * big-endian machines. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN shift = NBBY - shift; #endif From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 02:32:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD2029B; Wed, 17 Sep 2014 02:32:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98088FCA; Wed, 17 Sep 2014 02:32:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H2WOHj042367; Wed, 17 Sep 2014 02:32:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H2WNBS042361; Wed, 17 Sep 2014 02:32:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409170232.s8H2WNBS042361@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 17 Sep 2014 02:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271696 - in head: . etc/defaults etc/devd etc/rc.d 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 02:32:24 -0000 Author: delphij Date: Wed Sep 17 02:32:22 2014 New Revision: 271696 URL: http://svnweb.freebsd.org/changeset/base/271696 Log: Use a devd event to start hv_kvpd instead of doing so in rc.d script. This is cleaner and eliminates the unneeded startup of KVP daemon on systems that do not run as a Hyper-V guest. Submitted by: hrs X-MFC-with: 271493, 271688, 271699 Added: head/etc/devd/hyperv.conf (contents, props changed) Deleted: head/etc/rc.d/hv_kvpd Modified: head/ObsoleteFiles.inc head/etc/defaults/rc.conf head/etc/devd/Makefile head/etc/rc.d/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Sep 17 00:54:00 2014 (r271695) +++ head/ObsoleteFiles.inc Wed Sep 17 02:32:22 2014 (r271696) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140917: hv_kvpd rc.d script removed in favor of devd configuration +OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump OLD_LIBS+=usr/lib/libopie.so.7 OLD_LIBS+=usr/lib32/libopie.so.7 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Sep 17 00:54:00 2014 (r271695) +++ head/etc/defaults/rc.conf Wed Sep 17 02:32:22 2014 (r271696) @@ -684,8 +684,6 @@ jail_enable="NO" # Set to NO to disable jail_parallel_start="NO" # Start jails in the background jail_list="" # Space separated list of names of jails -hv_kvpd_enable="NO" # Start the Hyper-V key-value Pair Driver hv_kvp(4) - ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## ### scripts to source rc_conf_files overrides safely. ## Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Wed Sep 17 00:54:00 2014 (r271695) +++ head/etc/devd/Makefile Wed Sep 17 02:32:22 2014 (r271696) @@ -18,6 +18,10 @@ FILES+= uath.conf usb.conf FILES+= zfs.conf .endif +.if ${MK_HYPERV} != "no" +FILES+= hyperv.conf +.endif + NO_OBJ= FILESDIR= /etc/devd FILESMODE= 644 Added: head/etc/devd/hyperv.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/devd/hyperv.conf Wed Sep 17 02:32:22 2014 (r271696) @@ -0,0 +1,19 @@ +# $FreeBSD$ +# +# Hyper-V specific events + +notify 10 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "/dev/hv_kvp_dev"; + action "/usr/sbin/hv_kvp_daemon"; +}; + +notify 10 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "DESTROY"; + match "cdev" "/dev/hv_kvp_dev"; + action "pkill -x hv_kvp_daemon"; +}; Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Wed Sep 17 00:54:00 2014 (r271695) +++ head/etc/rc.d/Makefile Wed Sep 17 02:32:22 2014 (r271696) @@ -57,7 +57,6 @@ FILES= DAEMON \ hostid \ hostid_save \ hostname \ - ${_hv_kvpd} \ inetd \ initrandom \ ip6addrctl \ @@ -193,10 +192,6 @@ _ubthidhci= ubthidhci _casperd= casperd .endif -.if ${MK_HYPERV} != "no" -_hv_kvpd= hv_kvpd -.endif - .if ${MK_UNBOUND} != "no" _unbound= local_unbound .endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Sep 17 00:54:00 2014 (r271695) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Sep 17 02:32:22 2014 (r271696) @@ -4768,7 +4768,7 @@ OLD_FILES+=usr/share/examples/dma/mailer .endif .if ${MK_HYPERV} == no -OLD_FILES+=etc/rc.d/hv_kvpd +OLD_FILES+=etc/devd/hyperv.conf OLD_FILES+=usr/libexec/hyperv/hv_set_ifconfig OLD_FILES+=usr/libexec/hyperv/hv_get_dns_info OLD_FILES+=usr/libexec/hyperv/hv_get_dhcp_info From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 02:43:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FF6A3B2; Wed, 17 Sep 2014 02:43:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A36E16A; Wed, 17 Sep 2014 02:43:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H2hmP9047080; Wed, 17 Sep 2014 02:43:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H2hlei047078; Wed, 17 Sep 2014 02:43:47 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201409170243.s8H2hlei047078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 17 Sep 2014 02:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271697 - in head/sys/cddl/dev: dtrace/powerpc fbt/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 02:43:48 -0000 Author: jhibbits Date: Wed Sep 17 02:43:47 2014 New Revision: 271697 URL: http://svnweb.freebsd.org/changeset/base/271697 Log: Fix the stack tracing for dtrace/powerpc. Summary: Fix the stack tracing for dtrace/powerpc by using the trapexit/asttrapexit return address sentinels instead of checking within the kernel address space. As part of this, I had to add new inline functions. FBT traces the kernel, so we have to have special case handling for this, since a trap will create a full new trap frame, and there's no way to pass around the 'real' stack. I handle this by special-casing 'aframes == 0' with the trap frame. If aframes counts out to the trap frame, then assume we're looking for the full kernel trap frame, so switch to the real stack pointer. Test Plan: Tested on powerpc64 Reviewers: rpaulo, markj, nwhitehorn Reviewed By: markj, nwhitehorn Differential Revision: https://reviews.freebsd.org/D788 MFC after: 3 week Relnotes: Yes Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Wed Sep 17 02:32:22 2014 (r271696) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Wed Sep 17 02:43:47 2014 (r271697) @@ -52,9 +52,103 @@ /* Offset to LR Save word (ppc64). CR Save area sits between back chain and LR */ #define RETURN_OFFSET64 16 +#ifdef __powerpc64__ +#define OFFSET 4 /* Account for the TOC reload slot */ +#else +#define OFFSET 0 +#endif + #define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ (x) >= VM_MIN_KERNEL_ADDRESS) +static __inline int +dtrace_sp_inkernel(uintptr_t sp, int aframes) +{ + vm_offset_t callpc; + +#ifdef __powerpc64__ + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); +#else + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); +#endif + if ((callpc & 3) || (callpc < 0x100)) + return (0); + + /* + * trapexit() and asttrapexit() are sentinels + * for kernel stack tracing. + * + * Special-case this for 'aframes == 0', because fbt sets aframes to the + * trap callchain depth, so we want to break out of it. + */ + if ((callpc + OFFSET == (vm_offset_t) &trapexit || + callpc + OFFSET == (vm_offset_t) &asttrapexit) && + aframes != 0) + return (0); + + return (1); +} + +static __inline uintptr_t +dtrace_next_sp(uintptr_t sp) +{ + vm_offset_t callpc; + +#ifdef __powerpc64__ + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); +#else + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); +#endif + + /* + * trapexit() and asttrapexit() are sentinels + * for kernel stack tracing. + * + * Special-case this for 'aframes == 0', because fbt sets aframes to the + * trap callchain depth, so we want to break out of it. + */ + if ((callpc + OFFSET == (vm_offset_t) &trapexit || + callpc + OFFSET == (vm_offset_t) &asttrapexit)) + /* Access the trap frame */ +#ifdef __powerpc64__ + return (*(uintptr_t *)sp + 48 + sizeof(register_t)); +#else + return (*(uintptr_t *)sp + 8 + sizeof(register_t)); +#endif + + return (*(uintptr_t*)sp); +} + +static __inline uintptr_t +dtrace_get_pc(uintptr_t sp) +{ + vm_offset_t callpc; + +#ifdef __powerpc64__ + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); +#else + callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); +#endif + + /* + * trapexit() and asttrapexit() are sentinels + * for kernel stack tracing. + * + * Special-case this for 'aframes == 0', because fbt sets aframes to the + * trap callchain depth, so we want to break out of it. + */ + if ((callpc + OFFSET == (vm_offset_t) &trapexit || + callpc + OFFSET == (vm_offset_t) &asttrapexit)) + /* Access the trap frame */ +#ifdef __powerpc64__ + return (*(uintptr_t *)sp + 48 + offsetof(struct trapframe, lr)); +#else + return (*(uintptr_t *)sp + 8 + offsetof(struct trapframe, lr)); +#endif + + return (callpc); +} + greg_t dtrace_getfp(void) { @@ -66,10 +160,11 @@ dtrace_getpcstack(pc_t *pcstack, int pcs uint32_t *intrpc) { int depth = 0; - register_t sp; + uintptr_t osp, sp; vm_offset_t callpc; pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; + osp = PAGE_SIZE; if (intrpc != 0) pcstack[depth++] = (pc_t) intrpc; @@ -78,17 +173,12 @@ dtrace_getpcstack(pc_t *pcstack, int pcs sp = dtrace_getfp(); while (depth < pcstack_limit) { - if (!INKERNEL((long) sp)) + if (sp <= osp) break; -#ifdef __powerpc64__ - callpc = *(uintptr_t *)(sp + RETURN_OFFSET64); -#else - callpc = *(uintptr_t *)(sp + RETURN_OFFSET); -#endif - - if (!INKERNEL(callpc)) + if (!dtrace_sp_inkernel(sp, aframes)) break; + callpc = dtrace_get_pc(sp); if (aframes > 0) { aframes--; @@ -100,7 +190,8 @@ dtrace_getpcstack(pc_t *pcstack, int pcs pcstack[depth++] = callpc; } - sp = *(uintptr_t*)sp; + osp = sp; + sp = dtrace_next_sp(sp); } for (; depth < pcstack_limit; depth++) { @@ -368,8 +459,11 @@ dtrace_getarg(int arg, int aframes) * On ppc32 AIM, and booke, trapexit() is the immediately following * label. On ppc64 AIM trapexit() follows a nop. */ - if (((long)(fp[1]) == (long)trapexit) || - (((long)(fp[1]) + 4 == (long)trapexit))) { +#ifdef __powerpc64__ + if ((long)(fp[2]) + 4 == (long)trapexit) { +#else + if ((long)(fp[1]) == (long)trapexit) { +#endif /* * In the case of powerpc, we will use the pointer to the regs * structure that was pushed when we took the trap. To get this @@ -433,23 +527,31 @@ int dtrace_getstackdepth(int aframes) { int depth = 0; - register_t sp; + uintptr_t osp, sp; + vm_offset_t callpc; + osp = PAGE_SIZE; aframes++; sp = dtrace_getfp(); depth++; for(;;) { - if (!INKERNEL((long) sp)) + if (sp <= osp) break; - if (!INKERNEL((long) *(void **)sp)) + + if (!dtrace_sp_inkernel(sp, aframes)) break; - depth++; + + if (aframes == 0) + depth++; + else + aframes--; + osp = sp; sp = *(uintptr_t *)sp; } if (depth < aframes) - return 0; - else - return depth - aframes; + return (0); + + return (depth); } ulong_t Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Sep 17 02:32:22 2014 (r271696) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Sep 17 02:43:47 2014 (r271697) @@ -147,7 +147,7 @@ fbt_provide_module_function(linker_file_ fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); fbt->fbtp_name = name; fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, - name, FBT_ENTRY, 3, fbt); + name, FBT_ENTRY, 7, fbt); fbt->fbtp_patchpoint = instr; fbt->fbtp_ctl = lf; fbt->fbtp_loadcnt = lf->loadcnt; @@ -210,7 +210,7 @@ again: if (retfbt == NULL) { fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, - name, FBT_RETURN, 5, fbt); + name, FBT_RETURN, 7, fbt); } else { retfbt->fbtp_next = fbt; fbt->fbtp_id = retfbt->fbtp_id; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 03:40:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE3BC2B6; Wed, 17 Sep 2014 03:40:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9681979; Wed, 17 Sep 2014 03:40:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H3eovC072629; Wed, 17 Sep 2014 03:40:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H3eoN9072625; Wed, 17 Sep 2014 03:40:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409170340.s8H3eoN9072625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Sep 2014 03:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271698 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 03:40:51 -0000 Author: markj Date: Wed Sep 17 03:40:49 2014 New Revision: 271698 URL: http://svnweb.freebsd.org/changeset/base/271698 Log: Fix a number of typos and programming errors in the userland CTF tests. It seems that they would only pass by chance on illumos; on FreeBSD, they still fail since userland CTF is not yet supported. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh Wed Sep 17 02:43:47 2014 (r271697) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh Wed Sep 17 03:40:49 2014 (r271698) @@ -29,6 +29,7 @@ dtrace=$1 t="season_8_mountain_of_madness_t" pid=$$ -rc=`$dtrace -n "BEGIN{ trace(pid$pid`$t)0); }"` +$dtrace -n "BEGIN{ trace(pid$pid\`$t)0); }" +rc=$? exit $rc Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh Wed Sep 17 02:43:47 2014 (r271697) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh Wed Sep 17 03:40:49 2014 (r271698) @@ -30,6 +30,7 @@ dtrace=$1 t="season_8_mountain_of_madness_t" pid=$$ -rc=`$dtrace -n "BEGIN{ trace(pid`$t)0); }"` -p $pid +$dtrace -n "BEGIN{ trace(pid$pid\`$t)0); }" -p $pid +rc=$? exit $rc Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh Wed Sep 17 02:43:47 2014 (r271697) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh Wed Sep 17 03:40:49 2014 (r271698) @@ -25,7 +25,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -t="season_7_lisa_the_vegetrian_t *" +t="season_7_lisa_the_vegetarian_t *" exe="tst.aouttype.exe" elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' @@ -37,7 +37,8 @@ fi ./$exe & pid=$! -rc=`$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }"` +$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }" +rc=$? kill -9 $pid Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh Wed Sep 17 02:43:47 2014 (r271697) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh Wed Sep 17 03:40:49 2014 (r271698) @@ -38,7 +38,8 @@ fi ./$exe & pid=$! -rc=`$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }"` +$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }" +rc=$? kill -9 $pid From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 04:02:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD5B316F; Wed, 17 Sep 2014 04:02:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A89C4CBB; Wed, 17 Sep 2014 04:02:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H42ujM084950; Wed, 17 Sep 2014 04:02:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H42uL0084949; Wed, 17 Sep 2014 04:02:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409170402.s8H42uL0084949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 17 Sep 2014 04:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271699 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 04:02:56 -0000 Author: markj Date: Wed Sep 17 04:02:56 2014 New Revision: 271699 URL: http://svnweb.freebsd.org/changeset/base/271699 Log: Implement a workaround to allow this test program to be compiled with clang. It seems that if a pragma is used to define a weak alias for a local function, the pragma must appear after the function is defined. PR: 193056 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c Wed Sep 17 03:40:49 2014 (r271698) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c Wed Sep 17 04:02:56 2014 (r271699) @@ -34,14 +34,14 @@ * leading underscores. */ -#pragma weak _go = go - static int go(int a) { return (a + 1); } +#pragma weak _go = go + static void handle(int sig) { From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 06:46:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0312B241; Wed, 17 Sep 2014 06:46:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E40BAE54; Wed, 17 Sep 2014 06:46:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H6kb4L058689; Wed, 17 Sep 2014 06:46:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H6kbJT058688; Wed, 17 Sep 2014 06:46:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409170646.s8H6kbJT058688@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 06:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271700 - head/sys/cam/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 06:46:38 -0000 Author: mav Date: Wed Sep 17 06:46:37 2014 New Revision: 271700 URL: http://svnweb.freebsd.org/changeset/base/271700 Log: Fix typo in defined ROD types in r269497. MFC after: 3 days Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Sep 17 04:02:56 2014 (r271699) +++ head/sys/cam/scsi/scsi_all.h Wed Sep 17 06:46:37 2014 (r271700) @@ -1608,11 +1608,11 @@ struct scsi_token { uint8_t type[4]; #define ROD_TYPE_INTERNAL 0x00000000 -#define ROD_TYPE_AUR 0x00001000 -#define ROD_TYPE_PIT_DEF 0x00080000 -#define ROD_TYPE_PIT_VULN 0x00080001 -#define ROD_TYPE_PIT_PERS 0x00080002 -#define ROD_TYPE_PIT_ANY 0x0008FFFF +#define ROD_TYPE_AUR 0x00010000 +#define ROD_TYPE_PIT_DEF 0x00800000 +#define ROD_TYPE_PIT_VULN 0x00800001 +#define ROD_TYPE_PIT_PERS 0x00800002 +#define ROD_TYPE_PIT_ANY 0x0080FFFF #define ROD_TYPE_BLOCK_ZERO 0xFFFF0001 uint8_t reserved[2]; uint8_t length[2]; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 07:06:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8957C6C; Wed, 17 Sep 2014 07:06:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77359E5; Wed, 17 Sep 2014 07:06:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H763JL067887; Wed, 17 Sep 2014 07:06:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H763sG067886; Wed, 17 Sep 2014 07:06:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170706.s8H763sG067886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 07:06: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: r271701 - stable/10/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 07:06:03 -0000 Author: trasz Date: Wed Sep 17 07:06:02 2014 New Revision: 271701 URL: http://svnweb.freebsd.org/changeset/base/271701 Log: MFC r271319: Fix ctld(8) to not forget to send TargetPortalGroupTag and TargetAlias when the initiator skips security negotiation. This fixes interoperability with Xtend SAN initiator. PR: 193021 Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Wed Sep 17 06:46:37 2014 (r271700) +++ stable/10/usr.sbin/ctld/login.c Wed Sep 17 07:06:02 2014 (r271701) @@ -785,7 +785,8 @@ login_negotiate(struct connection *conn, struct pdu *response; struct iscsi_bhs_login_response *bhslr2; struct keys *request_keys, *response_keys; - int i; + char *portal_group_tag; + int i, rv; bool skipped_security; if (request == NULL) { @@ -806,6 +807,21 @@ login_negotiate(struct connection *conn, login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); login_set_nsg(response, BHSLR_STAGE_FULL_FEATURE_PHASE); response_keys = keys_new(); + + if (skipped_security && + conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) { + if (conn->conn_target->t_alias != NULL) + keys_add(response_keys, + "TargetAlias", conn->conn_target->t_alias); + rv = asprintf(&portal_group_tag, "%d", + conn->conn_portal->p_portal_group->pg_tag); + if (rv <= 0) + log_err(1, "asprintf"); + keys_add(response_keys, + "TargetPortalGroupTag", portal_group_tag); + free(portal_group_tag); + } + for (i = 0; i < KEYS_MAX; i++) { if (request_keys->keys_names[i] == NULL) break; @@ -1069,6 +1085,9 @@ login(struct connection *conn) response_keys = keys_new(); keys_add(response_keys, "AuthMethod", "CHAP"); if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) { + if (conn->conn_target->t_alias != NULL) + keys_add(response_keys, + "TargetAlias", conn->conn_target->t_alias); rv = asprintf(&portal_group_tag, "%d", conn->conn_portal->p_portal_group->pg_tag); if (rv <= 0) @@ -1076,9 +1095,6 @@ login(struct connection *conn) keys_add(response_keys, "TargetPortalGroupTag", portal_group_tag); free(portal_group_tag); - if (conn->conn_target->t_alias != NULL) - keys_add(response_keys, - "TargetAlias", conn->conn_target->t_alias); } keys_save(response_keys, response); From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 07:09:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72367ECF; Wed, 17 Sep 2014 07:09:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2F1110; Wed, 17 Sep 2014 07:09:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H790Xu068339; Wed, 17 Sep 2014 07:09:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H790C3068335; Wed, 17 Sep 2014 07:09:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409170709.s8H790C3068335@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 07:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271702 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 07:09:00 -0000 Author: mav Date: Wed Sep 17 07:08:59 2014 New Revision: 271702 URL: http://svnweb.freebsd.org/changeset/base/271702 Log: Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT DESCRIPTOR field as Identification Descriptor CSCD descriptor, not just as Identification Descriptor. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Wed Sep 17 07:06:02 2014 (r271701) +++ head/sys/cam/ctl/ctl_tpc.c Wed Sep 17 07:08:59 2014 (r271702) @@ -1811,6 +1811,7 @@ tpc_create_token(struct ctl_lun *lun, st { static int id = 0; struct scsi_vpd_id_descriptor *idd = NULL; + struct scsi_ec_cscd_id *cscd; int targid_len; scsi_ulto4b(ROD_TYPE_AUR, token->type); @@ -1824,8 +1825,12 @@ tpc_create_token(struct ctl_lun *lun, st idd = scsi_get_devid_desc((struct scsi_vpd_id_descriptor *) lun->lun_devid->data, lun->lun_devid->len, scsi_devid_is_lun_eui64); - if (idd != NULL) - memcpy(&token->body[8], idd, 4 + idd->length); + if (idd != NULL) { + cscd = (struct scsi_ec_cscd_id *)&token->body[8]; + cscd->type_code = EC_CSCD_ID; + cscd->luidt_pdt = T_DIRECT; + memcpy(&cscd->codeset, idd, 4 + idd->length); + } scsi_u64to8b(0, &token->body[40]); scsi_u64to8b(len, &token->body[48]); if (port->target_devid) { From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 07:55:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C171AEC; Wed, 17 Sep 2014 07:55:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35E8A85A; Wed, 17 Sep 2014 07:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H7tOja091867; Wed, 17 Sep 2014 07:55:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H7tOLC091866; Wed, 17 Sep 2014 07:55:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170755.s8H7tOLC091866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 07:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271703 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 07:55:24 -0000 Author: trasz Date: Wed Sep 17 07:55:23 2014 New Revision: 271703 URL: http://svnweb.freebsd.org/changeset/base/271703 Log: Fix LUN discovery for targets that don't support REPORT_LUNS, broken in r263741. At least with CTL (slightly modified to report SPC2) there is still some problem: it doesn't seem to find LUNs higher than 7. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Sep 17 07:08:59 2014 (r271702) +++ head/sys/dev/iscsi/iscsi.c Wed Sep 17 07:55:23 2014 (r271703) @@ -2179,7 +2179,12 @@ iscsi_action(struct cam_sim *sim, union cpi->hba_misc = PIM_EXTLUNS; cpi->hba_eng_cnt = 0; cpi->max_target = 0; - cpi->max_lun = 0; + /* + * Note that the variable below is only relevant for targets + * that don't claim compliance with anything above SPC2, which + * means they don't support REPORT_LUNS. + */ + cpi->max_lun = 255; cpi->initiator_id = ~0; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "iSCSI", HBA_IDLEN); From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 08:25:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F3761F9; Wed, 17 Sep 2014 08:25:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59AD6B69; Wed, 17 Sep 2014 08:25:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H8PnXg006014; Wed, 17 Sep 2014 08:25:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H8PnEx006013; Wed, 17 Sep 2014 08:25:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170825.s8H8PnEx006013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 08: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: r271704 - stable/10/usr.sbin/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 08:25:49 -0000 Author: trasz Date: Wed Sep 17 08:25:48 2014 New Revision: 271704 URL: http://svnweb.freebsd.org/changeset/base/271704 Log: MFC r271167: Make it possible to quote names in autofs maps using double quotes. Note that this is a workaround, not a proper solution. If you know lex well, and want to help - please let me know, I'll explain how it should work. PR: 192968 Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/token.l ============================================================================== --- stable/10/usr.sbin/autofs/token.l Wed Sep 17 07:55:23 2014 (r271703) +++ stable/10/usr.sbin/autofs/token.l Wed Sep 17 08:25:48 2014 (r271704) @@ -48,6 +48,7 @@ extern int yylex(void); %option noyywrap %% +\"[^"]+\" { yytext++; yytext[strlen(yytext) - 1] = '\0'; return STR; }; [a-zA-Z0-9\.\+-_/\:\[\]$&{}]+ { return STR; } #.*\n { lineno++; return NEWLINE; }; \\\n { lineno++; }; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 08:28:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD403515; Wed, 17 Sep 2014 08:28:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 966EEBB8; Wed, 17 Sep 2014 08:28:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H8Sqwh006451; Wed, 17 Sep 2014 08:28:52 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H8Sobw006435; Wed, 17 Sep 2014 08:28:50 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409170828.s8H8Sobw006435@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Wed, 17 Sep 2014 08:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271705 - in head/sys: dev/drm2 dev/drm2/i915 modules/drm2/i915kms 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 08:28:52 -0000 Author: dumbbell Date: Wed Sep 17 08:28:50 2014 New Revision: 271705 URL: http://svnweb.freebsd.org/changeset/base/271705 Log: drm/i915: Add HW context support This feature is required by Mesa 9.2+. Without this, a GL application crashes with the following message: # glxinfo name of display: :0.0 Gen6+ requires Kernel 3.6 or later. Assertion failed: (ctx->Version > 0), function handle_first_current, file ../../src/mesa/main/context.c, line 1498. Abort (core dumped) Now, Mesa 10.2.4 and 10.3-rc3 works fine: # glxinfo name of display: :0 display: :0 screen: 0 direct rendering: Yes ... OpenGL renderer string: Mesa DRI Intel(R) 965GM OpenGL version string: 2.1 Mesa 10.2.4 ... The code was imported from Linux 3.8.13. Reviewed by: kib@ Tested by: kwm@, danfe@, Henry Hu, Lundberg, Johannes , Johannes Dieterich , Lutz Bichler , MFC after: 3 days Relnotes: yes Added: head/sys/dev/drm2/i915/i915_gem_context.c (contents, props changed) Modified: head/sys/dev/drm2/drm_gem_names.c head/sys/dev/drm2/drm_gem_names.h head/sys/dev/drm2/i915/i915_dma.c head/sys/dev/drm2/i915/i915_drm.h head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/i915/i915_drv.h head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/i915_gem_gtt.c head/sys/dev/drm2/i915/i915_irq.c head/sys/dev/drm2/i915/i915_reg.h head/sys/dev/drm2/i915/intel_ringbuffer.c head/sys/dev/drm2/i915/intel_ringbuffer.h head/sys/modules/drm2/i915kms/Makefile head/sys/sys/param.h Modified: head/sys/dev/drm2/drm_gem_names.c ============================================================================== --- head/sys/dev/drm2/drm_gem_names.c Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/drm_gem_names.c Wed Sep 17 08:28:50 2014 (r271705) @@ -127,6 +127,24 @@ drm_gem_find_name(struct drm_gem_names * return (arg.res); } +void * +drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name) +{ + struct drm_gem_name *n; + void *res; + + mtx_lock(&names->lock); + LIST_FOREACH(n, gem_name_hash_index(names, name), link) { + if (n->name == name) { + res = n->ptr; + mtx_unlock(&names->lock); + return (res); + } + } + mtx_unlock(&names->lock); + return (NULL); +} + int drm_gem_name_create(struct drm_gem_names *names, void *p, uint32_t *name) { Modified: head/sys/dev/drm2/drm_gem_names.h ============================================================================== --- head/sys/dev/drm2/drm_gem_names.h Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/drm_gem_names.h Wed Sep 17 08:28:50 2014 (r271705) @@ -54,6 +54,7 @@ struct drm_gem_names { void drm_gem_names_init(struct drm_gem_names *names); void drm_gem_names_fini(struct drm_gem_names *names); uint32_t drm_gem_find_name(struct drm_gem_names *names, void *ptr); +void *drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name); void *drm_gem_name_ref(struct drm_gem_names *names, uint32_t name, void (*ref)(void *)); int drm_gem_name_create(struct drm_gem_names *names, void *obj, uint32_t *name); Modified: head/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- head/sys/dev/drm2/i915/i915_dma.c Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/i915/i915_dma.c Wed Sep 17 08:28:50 2014 (r271705) @@ -1357,6 +1357,7 @@ i915_driver_unload_int(struct drm_device DRM_LOCK(dev); i915_gem_free_all_phys_object(dev); i915_gem_cleanup_ringbuffer(dev); + i915_gem_context_fini(dev); if (!locked) DRM_UNLOCK(dev); i915_gem_cleanup_aliasing_ppgtt(dev); @@ -1413,6 +1414,8 @@ i915_driver_open(struct drm_device *dev, INIT_LIST_HEAD(&i915_file_priv->mm.request_list); file_priv->driver_priv = i915_file_priv; + drm_gem_names_init(&i915_file_priv->context_idr); + return (0); } @@ -1437,6 +1440,7 @@ i915_driver_lastclose(struct drm_device void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) { + i915_gem_context_close(dev, file_priv); i915_gem_release(dev, file_priv); } @@ -1491,6 +1495,8 @@ struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF(DRM_I915_OVERLAY_ATTRS, intel_overlay_attrs, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_I915_SET_SPRITE_COLORKEY, intel_sprite_set_colorkey, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_I915_GET_SPRITE_COLORKEY, intel_sprite_get_colorkey, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_I915_GEM_CONTEXT_CREATE, i915_gem_context_create_ioctl, DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_I915_GEM_CONTEXT_DESTROY, i915_gem_context_destroy_ioctl, DRM_UNLOCKED), }; #ifdef COMPAT_FREEBSD32 Modified: head/sys/dev/drm2/i915/i915_drm.h ============================================================================== --- head/sys/dev/drm2/i915/i915_drm.h Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/i915/i915_drm.h Wed Sep 17 08:28:50 2014 (r271705) @@ -204,6 +204,8 @@ typedef struct drm_i915_sarea { #define DRM_I915_GEM_EXECBUFFER2 0x29 #define DRM_I915_GET_SPRITE_COLORKEY 0x2a #define DRM_I915_SET_SPRITE_COLORKEY 0x2b +#define DRM_I915_GEM_CONTEXT_CREATE 0x2d +#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) @@ -248,6 +250,8 @@ typedef struct drm_i915_sarea { #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) +#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) +#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) /* Asynchronous page flipping: */ @@ -702,7 +706,7 @@ struct drm_i915_gem_exec_object2 { #define EXEC_OBJECT_NEEDS_FENCE (1<<0) uint64_t flags; - uint64_t rsvd1; + uint64_t rsvd1; /* now used for context info */ uint64_t rsvd2; }; @@ -746,6 +750,12 @@ struct drm_i915_gem_execbuffer2 { /** Resets the SO write offset registers for transform feedback on gen7. */ #define I915_EXEC_GEN7_SOL_RESET (1<<8) +#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) +#define i915_execbuffer2_set_context_id(eb2, context) \ + (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK +#define i915_execbuffer2_get_context_id(eb2) \ + ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK) + struct drm_i915_gem_pin { /** Handle of the buffer to be pinned. */ uint32_t handle; @@ -968,4 +978,15 @@ struct drm_intel_sprite_colorkey { uint32_t flags; }; +struct drm_i915_gem_context_create { + /* output: id of new context*/ + uint32_t ctx_id; + uint32_t pad; +}; + +struct drm_i915_gem_context_destroy { + uint32_t ctx_id; + uint32_t pad; +}; + #endif /* _I915_DRM_H_ */ Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/i915/i915_drv.c Wed Sep 17 08:28:50 2014 (r271705) @@ -612,7 +612,7 @@ __gen6_gt_wait_for_fifo(struct drm_i915_ } static int -i8xx_do_reset(struct drm_device *dev, u8 flags) +i8xx_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; int onems; @@ -657,7 +657,7 @@ i965_reset_complete(struct drm_device *d } static int -i965_do_reset(struct drm_device *dev, u8 flags) +i965_do_reset(struct drm_device *dev) { u8 gdrst; @@ -667,28 +667,30 @@ i965_do_reset(struct drm_device *dev, u8 * triggers the reset; when done, the hardware will clear it. */ gdrst = pci_read_config(dev->device, I965_GDRST, 1); - pci_write_config(dev->device, I965_GDRST, gdrst | flags | 0x1, 1); + pci_write_config(dev->device, I965_GDRST, + gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE, 1); return (_intel_wait_for(dev, i965_reset_complete(dev), 500, 1, "915rst")); } static int -ironlake_do_reset(struct drm_device *dev, u8 flags) +ironlake_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv; u32 gdrst; dev_priv = dev->dev_private; gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); - I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, gdrst | flags | 0x1); + I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, + gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE); return (_intel_wait_for(dev, (I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1) != 0, 500, 1, "915rst")); } static int -gen6_do_reset(struct drm_device *dev, u8 flags) +gen6_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv; int ret; @@ -726,8 +728,43 @@ gen6_do_reset(struct drm_device *dev, u8 return (ret); } +int intel_gpu_reset(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret = -ENODEV; + + switch (INTEL_INFO(dev)->gen) { + case 7: + case 6: + ret = gen6_do_reset(dev); + break; + case 5: + ret = ironlake_do_reset(dev); + break; + case 4: + ret = i965_do_reset(dev); + break; + case 2: + ret = i8xx_do_reset(dev); + break; + } + + /* Also reset the gpu hangman. */ + if (dev_priv->stop_rings) { + DRM_DEBUG("Simulated gpu hang, resetting stop_rings\n"); + dev_priv->stop_rings = 0; + if (ret == -ENODEV) { + DRM_ERROR("Reset not implemented, but ignoring " + "error for simulated gpu hangs\n"); + ret = 0; + } + } + + return ret; +} + int -i915_reset(struct drm_device *dev, u8 flags) +i915_reset(struct drm_device *dev) { drm_i915_private_t *dev_priv = dev->dev_private; /* @@ -748,23 +785,9 @@ i915_reset(struct drm_device *dev, u8 fl ret = -ENODEV; if (time_second - dev_priv->last_gpu_reset < 5) { DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); - } else { - switch (INTEL_INFO(dev)->gen) { - case 7: - case 6: - ret = gen6_do_reset(dev, flags); - break; - case 5: - ret = ironlake_do_reset(dev, flags); - break; - case 4: - ret = i965_do_reset(dev, flags); - break; - case 2: - ret = i8xx_do_reset(dev, flags); - break; - } - } + } else + ret = intel_gpu_reset(dev); + dev_priv->last_gpu_reset = time_second; if (ret) { DRM_ERROR("Failed to reset chip.\n"); @@ -784,6 +807,7 @@ i915_reset(struct drm_device *dev, u8 fl if (HAS_BLT(dev)) dev_priv->rings[BCS].init(&dev_priv->rings[BCS]); + i915_gem_context_init(dev); i915_gem_init_ppgtt(dev); drm_irq_uninstall(dev); Modified: head/sys/dev/drm2/i915/i915_drv.h ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.h Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/i915/i915_drv.h Wed Sep 17 08:28:50 2014 (r271705) @@ -174,6 +174,17 @@ struct i915_hw_ppgtt { vm_paddr_t scratch_page_dma_addr; }; + +/* This must match up with the value previously used for execbuf2.rsvd1. */ +#define DEFAULT_CONTEXT_ID 0 +struct i915_hw_context { + uint32_t id; + bool is_initialized; + struct drm_i915_file_private *file_priv; + struct intel_ring_buffer *ring; + struct drm_i915_gem_object *obj; +}; + enum no_fbc_reason { FBC_NO_OUTPUT, /* no outputs enabled to compress */ FBC_STOLEN_TOO_SMALL, /* not enough space to hold compressed buffers */ @@ -700,6 +711,8 @@ typedef struct drm_i915_private { enum no_fbc_reason no_fbc_reason; + unsigned int stop_rings; + unsigned long cfb_size; unsigned int cfb_fb; int cfb_plane; @@ -723,8 +736,16 @@ typedef struct drm_i915_private { struct drm_property *broadcast_rgb_property; struct drm_property *force_audio_property; + + bool hw_contexts_disabled; + uint32_t hw_context_size; } drm_i915_private_t; +/* Iterate over initialised rings */ +#define for_each_ring(ring__, dev_priv__, i__) \ + for ((i__) = 0; (i__) < I915_NUM_RINGS; (i__)++) \ + if (((ring__) = &(dev_priv__)->rings[(i__)]), intel_ring_initialized((ring__))) + enum hdmi_force_audio { HDMI_AUDIO_OFF_DVI = -2, /* no aux data for HDMI-DVI converter */ HDMI_AUDIO_OFF, /* force turn off HDMI audio */ @@ -832,6 +853,7 @@ struct drm_i915_gem_object { unsigned int cache_level:2; unsigned int has_aliasing_ppgtt_mapping:1; + unsigned int has_global_gtt_mapping:1; vm_page_t *pages; @@ -927,6 +949,7 @@ struct drm_i915_file_private { struct list_head request_list; struct mtx lck; } mm; + struct drm_gem_names context_idr; }; struct drm_i915_error_state { @@ -1026,7 +1049,8 @@ extern int i915_enable_hangcheck; const struct intel_device_info *i915_get_device_id(int device); -int i915_reset(struct drm_device *dev, u8 flags); +extern int intel_gpu_reset(struct drm_device *dev); +int i915_reset(struct drm_device *dev); /* i915_debug.c */ int i915_sysctl_init(struct drm_device *dev, struct sysctl_ctx_list *ctx, @@ -1205,6 +1229,17 @@ void i915_gem_release(struct drm_device int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj, enum i915_cache_level cache_level); +/* i915_gem_context.c */ +void i915_gem_context_init(struct drm_device *dev); +void i915_gem_context_fini(struct drm_device *dev); +void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); +int i915_switch_context(struct intel_ring_buffer *ring, + struct drm_file *file, int to_id); +int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, + struct drm_file *file); +int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, + struct drm_file *file); + void i915_gem_free_all_phys_object(struct drm_device *dev); void i915_gem_detach_phys_object(struct drm_device *dev, struct drm_i915_gem_object *obj); @@ -1444,6 +1479,7 @@ __i915_write(64, 64) #define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc) #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) +#define HAS_HW_CONTEXTS(dev) (INTEL_INFO(dev)->gen >= 6) #define HAS_ALIASING_PPGTT(dev) (INTEL_INFO(dev)->gen >=6) #define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay) Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/i915/i915_gem.c Wed Sep 17 08:28:50 2014 (r271705) @@ -477,6 +477,7 @@ i915_gem_init_hw(struct drm_device *dev) } dev_priv->next_seqno = 1; + i915_gem_context_init(dev); i915_gem_init_ppgtt(dev); return (0); @@ -2586,11 +2587,16 @@ int i915_gpu_idle(struct drm_device *dev, bool do_retire) { drm_i915_private_t *dev_priv = dev->dev_private; + struct intel_ring_buffer *ring; int ret, i; /* Flush everything onto the inactive list. */ - for (i = 0; i < I915_NUM_RINGS; i++) { - ret = i915_ring_idle(&dev_priv->rings[i], do_retire); + for_each_ring(ring, dev_priv, i) { + ret = i915_switch_context(ring, NULL, DEFAULT_CONTEXT_ID); + if (ret) + return ret; + + ret = i915_ring_idle(ring, do_retire); if (ret) return ret; } Added: head/sys/dev/drm2/i915/i915_gem_context.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/i915/i915_gem_context.c Wed Sep 17 08:28:50 2014 (r271705) @@ -0,0 +1,549 @@ +/* + * Copyright © 2011-2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Ben Widawsky + * + */ + +/* + * This file implements HW context support. On gen5+ a HW context consists of an + * opaque GPU object which is referenced at times of context saves and restores. + * With RC6 enabled, the context is also referenced as the GPU enters and exists + * from RC6 (GPU has it's own internal power context, except on gen5). Though + * something like a context does exist for the media ring, the code only + * supports contexts for the render ring. + * + * In software, there is a distinction between contexts created by the user, + * and the default HW context. The default HW context is used by GPU clients + * that do not request setup of their own hardware context. The default + * context's state is never restored to help prevent programming errors. This + * would happen if a client ran and piggy-backed off another clients GPU state. + * The default context only exists to give the GPU some offset to load as the + * current to invoke a save of the context we actually care about. In fact, the + * code could likely be constructed, albeit in a more complicated fashion, to + * never use the default context, though that limits the driver's ability to + * swap out, and/or destroy other contexts. + * + * All other contexts are created as a request by the GPU client. These contexts + * store GPU state, and thus allow GPU clients to not re-emit state (and + * potentially query certain state) at any time. The kernel driver makes + * certain that the appropriate commands are inserted. + * + * The context life cycle is semi-complicated in that context BOs may live + * longer than the context itself because of the way the hardware, and object + * tracking works. Below is a very crude representation of the state machine + * describing the context life. + * refcount pincount active + * S0: initial state 0 0 0 + * S1: context created 1 0 0 + * S2: context is currently running 2 1 X + * S3: GPU referenced, but not current 2 0 1 + * S4: context is current, but destroyed 1 1 0 + * S5: like S3, but destroyed 1 0 1 + * + * The most common (but not all) transitions: + * S0->S1: client creates a context + * S1->S2: client submits execbuf with context + * S2->S3: other clients submits execbuf with context + * S3->S1: context object was retired + * S3->S2: clients submits another execbuf + * S2->S4: context destroy called with current context + * S3->S5->S0: destroy path + * S4->S5->S0: destroy path on current context + * + * There are two confusing terms used above: + * The "current context" means the context which is currently running on the + * GPU. The GPU has loaded it's state already and has stored away the gtt + * offset of the BO. The GPU is not actively referencing the data at this + * offset, but it will on the next context switch. The only way to avoid this + * is to do a GPU reset. + * + * An "active context' is one which was previously the "current context" and is + * on the active list waiting for the next context switch to occur. Until this + * happens, the object must remain at the same gtt offset. It is therefore + * possible to destroy a context, but it is still active. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "i915_drv.h" + +/* This is a HW constraint. The value below is the largest known requirement + * I've seen in a spec to date, and that was a workaround for a non-shipping + * part. It should be safe to decrease this, but it's more future proof as is. + */ +#define CONTEXT_ALIGN (64<<10) + +static struct i915_hw_context * +i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id); +static int do_switch(struct i915_hw_context *to); + +static int get_context_size(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret; + u32 reg; + + switch (INTEL_INFO(dev)->gen) { + case 6: + reg = I915_READ(CXT_SIZE); + ret = GEN6_CXT_TOTAL_SIZE(reg) * 64; + break; + case 7: + reg = I915_READ(GEN7_CXT_SIZE); +#ifdef FREEBSD_WIP + if (IS_HASWELL(dev)) + ret = HSW_CXT_TOTAL_SIZE(reg) * 64; + else +#endif + ret = GEN7_CXT_TOTAL_SIZE(reg) * 64; + break; + default: + panic("i915_gem_context: Unsupported Intel GPU generation %d", + INTEL_INFO(dev)->gen); + } + + return ret; +} + +static void do_destroy(struct i915_hw_context *ctx) +{ +#if defined(INVARIANTS) + struct drm_device *dev = ctx->obj->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; +#endif + + if (ctx->file_priv) + drm_gem_names_remove(&ctx->file_priv->context_idr, ctx->id); + else + KASSERT(ctx == dev_priv->rings[RCS].default_context, + ("i915_gem_context: ctx != default_context")); + + drm_gem_object_unreference(&ctx->obj->base); + free(ctx, DRM_I915_GEM); +} + +static int +create_hw_context(struct drm_device *dev, + struct drm_i915_file_private *file_priv, + struct i915_hw_context **ret_ctx) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + struct i915_hw_context *ctx; + int ret, id; + + ctx = malloc(sizeof(*ctx), DRM_I915_GEM, M_NOWAIT | M_ZERO); + if (ctx == NULL) + return (-ENOMEM); + + ctx->obj = i915_gem_alloc_object(dev, dev_priv->hw_context_size); + if (ctx->obj == NULL) { + free(ctx, DRM_I915_GEM); + DRM_DEBUG_DRIVER("Context object allocated failed\n"); + return (-ENOMEM); + } + + if (INTEL_INFO(dev)->gen >= 7) { + ret = i915_gem_object_set_cache_level(ctx->obj, + I915_CACHE_LLC_MLC); + if (ret) + goto err_out; + } + + /* The ring associated with the context object is handled by the normal + * object tracking code. We give an initial ring value simple to pass an + * assertion in the context switch code. + */ + ctx->ring = &dev_priv->rings[RCS]; + + /* Default context will never have a file_priv */ + if (file_priv == NULL) { + *ret_ctx = ctx; + return (0); + } + + ctx->file_priv = file_priv; + +again: + id = 0; + ret = drm_gem_name_create(&file_priv->context_idr, ctx, &id); + if (ret == 0) + ctx->id = id; + + if (ret == -EAGAIN) + goto again; + else if (ret) + goto err_out; + + *ret_ctx = ctx; + return (0); + +err_out: + do_destroy(ctx); + return (ret); +} + +static inline bool is_default_context(struct i915_hw_context *ctx) +{ + return (ctx == ctx->ring->default_context); +} + +/** + * The default context needs to exist per ring that uses contexts. It stores the + * context state of the GPU for applications that don't utilize HW contexts, as + * well as an idle case. + */ +static int create_default_context(struct drm_i915_private *dev_priv) +{ + struct i915_hw_context *ctx; + int ret; + + DRM_LOCK_ASSERT(dev_priv->dev); + + ret = create_hw_context(dev_priv->dev, NULL, &ctx); + if (ret != 0) + return (ret); + + /* We may need to do things with the shrinker which require us to + * immediately switch back to the default context. This can cause a + * problem as pinning the default context also requires GTT space which + * may not be available. To avoid this we always pin the + * default context. + */ + dev_priv->rings[RCS].default_context = ctx; + ret = i915_gem_object_pin(ctx->obj, CONTEXT_ALIGN, false); + if (ret) + goto err_destroy; + + ret = do_switch(ctx); + if (ret) + goto err_unpin; + + DRM_DEBUG_DRIVER("Default HW context loaded\n"); + return 0; + +err_unpin: + i915_gem_object_unpin(ctx->obj); +err_destroy: + do_destroy(ctx); + return ret; +} + +void i915_gem_context_init(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + uint32_t ctx_size; + + if (!HAS_HW_CONTEXTS(dev)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + /* If called from reset, or thaw... we've been here already */ + if (dev_priv->hw_contexts_disabled || + dev_priv->rings[RCS].default_context) + return; + + ctx_size = get_context_size(dev); + dev_priv->hw_context_size = get_context_size(dev); + dev_priv->hw_context_size = roundup(dev_priv->hw_context_size, 4096); + + if (ctx_size <= 0 || ctx_size > (1<<20)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + if (create_default_context(dev_priv)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + DRM_DEBUG_DRIVER("HW context support initialized\n"); +} + +void i915_gem_context_fini(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + if (dev_priv->hw_contexts_disabled) + return; + + /* The only known way to stop the gpu from accessing the hw context is + * to reset it. Do this as the very last operation to avoid confusing + * other code, leading to spurious errors. */ + intel_gpu_reset(dev); + + i915_gem_object_unpin(dev_priv->rings[RCS].default_context->obj); + + do_destroy(dev_priv->rings[RCS].default_context); +} + +static int context_idr_cleanup(uint32_t id, void *p, void *data) +{ + struct i915_hw_context *ctx = p; + + KASSERT(id != DEFAULT_CONTEXT_ID, ("i915_gem_context: id == DEFAULT_CONTEXT_ID in cleanup")); + + do_destroy(ctx); + + return 0; +} + +void i915_gem_context_close(struct drm_device *dev, struct drm_file *file) +{ + struct drm_i915_file_private *file_priv = file->driver_priv; + + //DRM_LOCK(dev); /* Called from preclose(), the lock is already owned. */ + drm_gem_names_foreach(&file_priv->context_idr, context_idr_cleanup, NULL); + drm_gem_names_fini(&file_priv->context_idr); + //DRM_UNLOCK(dev); +} + +static struct i915_hw_context * +i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id) +{ + return (struct i915_hw_context *)drm_gem_find_ptr(&file_priv->context_idr, id); +} + +static inline int +mi_set_context(struct intel_ring_buffer *ring, + struct i915_hw_context *new_context, + u32 hw_flags) +{ + int ret; + + /* w/a: If Flush TLB Invalidation Mode is enabled, driver must do a TLB + * invalidation prior to MI_SET_CONTEXT. On GEN6 we don't set the value + * explicitly, so we rely on the value at ring init, stored in + * itlb_before_ctx_switch. + */ + if (IS_GEN6(ring->dev) && ring->itlb_before_ctx_switch) { + ret = ring->flush(ring, I915_GEM_GPU_DOMAINS, 0); + if (ret) + return ret; + } + + ret = intel_ring_begin(ring, 6); + if (ret) + return ret; + + if (IS_GEN7(ring->dev)) + intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_DISABLE); + else + intel_ring_emit(ring, MI_NOOP); + + intel_ring_emit(ring, MI_NOOP); + intel_ring_emit(ring, MI_SET_CONTEXT); + intel_ring_emit(ring, new_context->obj->gtt_offset | + MI_MM_SPACE_GTT | + MI_SAVE_EXT_STATE_EN | + MI_RESTORE_EXT_STATE_EN | + hw_flags); + /* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */ + intel_ring_emit(ring, MI_NOOP); + + if (IS_GEN7(ring->dev)) + intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_ENABLE); + else + intel_ring_emit(ring, MI_NOOP); + + intel_ring_advance(ring); + + return ret; +} + +static int do_switch(struct i915_hw_context *to) +{ + struct intel_ring_buffer *ring = to->ring; + struct drm_i915_gem_object *from_obj = ring->last_context_obj; + u32 hw_flags = 0; + int ret; + + KASSERT(!(from_obj != NULL && from_obj->pin_count == 0), + ("i915_gem_context: invalid \"from\" context")); + + if (from_obj == to->obj) + return 0; + + ret = i915_gem_object_pin(to->obj, CONTEXT_ALIGN, false); + if (ret) + return ret; + + /* Clear this page out of any CPU caches for coherent swap-in/out. Note + * that thanks to write = false in this call and us not setting any gpu + * write domains when putting a context object onto the active list + * (when switching away from it), this won't block. + * XXX: We need a real interface to do this instead of trickery. */ + ret = i915_gem_object_set_to_gtt_domain(to->obj, false); + if (ret) { + i915_gem_object_unpin(to->obj); + return ret; + } + + if (!to->obj->has_global_gtt_mapping) + i915_gem_gtt_bind_object(to->obj); + + if (!to->is_initialized || is_default_context(to)) + hw_flags |= MI_RESTORE_INHIBIT; + else if (from_obj == to->obj) /* not yet expected */ + hw_flags |= MI_FORCE_RESTORE; + + ret = mi_set_context(ring, to, hw_flags); + if (ret) { + i915_gem_object_unpin(to->obj); + return ret; + } + + /* The backing object for the context is done after switching to the + * *next* context. Therefore we cannot retire the previous context until + * the next context has already started running. In fact, the below code + * is a bit suboptimal because the retiring can occur simply after the + * MI_SET_CONTEXT instead of when the next seqno has completed. + */ + if (from_obj != NULL) { + from_obj->base.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + i915_gem_object_move_to_active(from_obj, ring, + i915_gem_next_request_seqno(ring)); + /* As long as MI_SET_CONTEXT is serializing, ie. it flushes the + * whole damn pipeline, we don't need to explicitly mark the + * object dirty. The only exception is that the context must be + * correct in case the object gets swapped out. Ideally we'd be + * able to defer doing this until we know the object would be + * swapped, but there is no way to do that yet. + */ + from_obj->dirty = 1; + KASSERT(from_obj->ring == ring, ("i915_gem_context: from_ring != ring")); + i915_gem_object_unpin(from_obj); + + drm_gem_object_unreference(&from_obj->base); + } + + drm_gem_object_reference(&to->obj->base); + ring->last_context_obj = to->obj; + to->is_initialized = true; + + return 0; +} + +/** + * i915_switch_context() - perform a GPU context switch. + * @ring: ring for which we'll execute the context switch + * @file_priv: file_priv associated with the context, may be NULL + * @id: context id number + * @seqno: sequence number by which the new context will be switched to + * @flags: + * + * The context life cycle is simple. The context refcount is incremented and + * decremented by 1 and create and destroy. If the context is in use by the GPU, + * it will have a refoucnt > 1. This allows us to destroy the context abstract + * object while letting the normal object tracking destroy the backing BO. + */ +int i915_switch_context(struct intel_ring_buffer *ring, + struct drm_file *file, + int to_id) +{ + struct drm_i915_private *dev_priv = ring->dev->dev_private; + struct i915_hw_context *to; + + if (dev_priv->hw_contexts_disabled) + return 0; + + if (ring != &dev_priv->rings[RCS]) + return 0; + + if (to_id == DEFAULT_CONTEXT_ID) { + to = ring->default_context; + } else { + if (file == NULL) + return -EINVAL; + + to = i915_gem_context_get(file->driver_priv, to_id); + if (to == NULL) + return -ENOENT; + } + + return do_switch(to); +} + +int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_i915_gem_context_create *args = data; + struct drm_i915_file_private *file_priv = file->driver_priv; + struct i915_hw_context *ctx; + int ret; + + if (!(dev->driver->driver_features & DRIVER_GEM)) + return -ENODEV; + + if (dev_priv->hw_contexts_disabled) + return -ENODEV; + + ret = i915_mutex_lock_interruptible(dev); + if (ret) + return ret; + + ret = create_hw_context(dev, file_priv, &ctx); + DRM_UNLOCK(dev); + if (ret != 0) + return (ret); + + args->ctx_id = ctx->id; + DRM_DEBUG_DRIVER("HW context %d created\n", args->ctx_id); + + return 0; +} + +int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct drm_i915_gem_context_destroy *args = data; + struct drm_i915_file_private *file_priv = file->driver_priv; + struct i915_hw_context *ctx; + int ret; + + if (!(dev->driver->driver_features & DRIVER_GEM)) + return -ENODEV; + + ret = i915_mutex_lock_interruptible(dev); + if (ret) + return ret; + + ctx = i915_gem_context_get(file_priv, args->ctx_id); + if (!ctx) { + DRM_UNLOCK(dev); + return -ENOENT; + } + + do_destroy(ctx); + + DRM_UNLOCK(dev); + + DRM_DEBUG_DRIVER("HW context %d destroyed\n", args->ctx_id); + return 0; +} Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/i915/i915_gem_execbuffer.c Wed Sep 17 08:28:50 2014 (r271705) @@ -1130,6 +1130,7 @@ i915_gem_do_execbuffer(struct drm_device struct drm_clip_rect *cliprects = NULL; struct intel_ring_buffer *ring; vm_page_t **relocs_ma; + u32 ctx_id = i915_execbuffer2_get_context_id(*args); u32 exec_start, exec_len; u32 seqno; u32 mask; @@ -1158,6 +1159,11 @@ i915_gem_do_execbuffer(struct drm_device return -EINVAL; } ring = &dev_priv->rings[VCS]; + if (ctx_id != 0) { + DRM_DEBUG("Ring %s doesn't support contexts\n", + ring->name); + return -EPERM; + } break; case I915_EXEC_BLT: if (!HAS_BLT(dev)) { @@ -1165,6 +1171,11 @@ i915_gem_do_execbuffer(struct drm_device return -EINVAL; } ring = &dev_priv->rings[BCS]; + if (ctx_id != 0) { + DRM_DEBUG("Ring %s doesn't support contexts\n", + ring->name); + return -EPERM; + } break; default: DRM_DEBUG("execbuf with unknown ring: %d\n", @@ -1306,6 +1317,10 @@ i915_gem_do_execbuffer(struct drm_device if (ret) goto err; + ret = i915_switch_context(ring, file, ctx_id); + if (ret) + goto err; + seqno = i915_gem_next_request_seqno(ring); for (i = 0; i < I915_NUM_RINGS - 1; i++) { if (seqno < ring->sync_seqno[i]) { @@ -1461,6 +1476,7 @@ i915_gem_execbuffer(struct drm_device *d exec2.num_cliprects = args->num_cliprects; exec2.cliprects_ptr = args->cliprects_ptr; exec2.flags = I915_EXEC_RENDER; + i915_execbuffer2_set_context_id(exec2, 0); ret = i915_gem_do_execbuffer(dev, data, file, &exec2, exec2_list); if (!ret) { Modified: head/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_gtt.c Wed Sep 17 08:25:48 2014 (r271704) +++ head/sys/dev/drm2/i915/i915_gem_gtt.c Wed Sep 17 08:28:50 2014 (r271705) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 08:47:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42B2C9B5; Wed, 17 Sep 2014 08:47:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14785DA8; Wed, 17 Sep 2014 08:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8H8lwJL015782; Wed, 17 Sep 2014 08:47:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8H8lwR7015781; Wed, 17 Sep 2014 08:47:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409170847.s8H8lwR7015781@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 17 Sep 2014 08:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271706 - stable/10/usr.sbin/iscsid 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 08:47:59 -0000 Author: trasz Date: Wed Sep 17 08:47:58 2014 New Revision: 271706 URL: http://svnweb.freebsd.org/changeset/base/271706 Log: MFC r271437: Don't blindly assume the target agreed to transition to Full Feature Phase; if we got a Login Response PDU without the "T" bit set, try again with an empty request. This fixes interoperability with COMSTAR. Reviewed by: mav Tested by: mav Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/iscsid/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/iscsid/login.c ============================================================================== --- stable/10/usr.sbin/iscsid/login.c Wed Sep 17 08:28:50 2014 (r271705) +++ stable/10/usr.sbin/iscsid/login.c Wed Sep 17 08:47:58 2014 (r271706) @@ -574,7 +574,7 @@ login_negotiate(struct connection *conn) struct pdu *request, *response; struct keys *request_keys, *response_keys; struct iscsi_bhs_login_response *bhslr; - int i; + int i, nrequests = 0; log_debugx("beginning operational parameter negotiation"); request = login_new_request(conn, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); @@ -628,19 +628,41 @@ login_negotiate(struct connection *conn) response_keys->keys_names[i], response_keys->keys_values[i]); } - bhslr = (struct iscsi_bhs_login_response *)response->pdu_bhs; - if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) == 0) - log_warnx("received final login response " - "without the \"T\" flag"); - else if (login_nsg(response) != BHSLR_STAGE_FULL_FEATURE_PHASE) + keys_delete(response_keys); + response_keys = NULL; + + for (;;) { + bhslr = (struct iscsi_bhs_login_response *)response->pdu_bhs; + if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) != 0) + break; + + nrequests++; + if (nrequests > 5) { + log_warnx("received login response " + "without the \"T\" flag too many times; giving up"); + break; + } + + log_debugx("received login response " + "without the \"T\" flag; sending another request"); + + pdu_delete(response); + + request = login_new_request(conn, + BHSLR_STAGE_OPERATIONAL_NEGOTIATION); + pdu_send(request); + pdu_delete(request); + + response = login_receive(conn); + } + + if (login_nsg(response) != BHSLR_STAGE_FULL_FEATURE_PHASE) log_warnx("received final login response with wrong NSG 0x%x", login_nsg(response)); + pdu_delete(response); log_debugx("operational parameter negotiation done; " "transitioning to Full Feature phase"); - - keys_delete(response_keys); - pdu_delete(response); } static void From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 10:39:05 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C70D36C0; Wed, 17 Sep 2014 10:39:05 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 33454B39; Wed, 17 Sep 2014 10:39:03 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA26459; Wed, 17 Sep 2014 13:39:01 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XUCdZ-00096J-4K; Wed, 17 Sep 2014 13:39:01 +0300 Message-ID: <5419648D.2030305@FreeBSD.org> Date: Wed, 17 Sep 2014 13:38:05 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r269093 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201407251841.s6PIfvUm002202@svn.freebsd.org> In-Reply-To: <201407251841.s6PIfvUm002202@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "Justin T. Gibbs" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 10:39:05 -0000 On 25/07/2014 21:41, Xin LI wrote: > Author: delphij > Date: Fri Jul 25 18:41:56 2014 > New Revision: 269093 > URL: http://svnweb.freebsd.org/changeset/base/269093 > > Log: > Transform the I/O when vdev_physical_ashift is greater than > SPA_MINBLOCKSHIFT. This commit seems illogical to me. I do not see why a fact that the _physical_ sector size is greater than 512B (e.g. 4KB) should force a data buffer of a "physical" zio to be rounded up using ashift. To give an example. ZFS knows that a vdev has physical sector size of 4KB, but a logical sector size of 512B. ZFS uses ashift of 12 for the vdev. Nevertheless in some situations ZFS wants to make a physical / special write of 512B (taking advantage of RMW). Why should we force that write to become 4KB with data beyond the first 512B being all zeros? It would be logical to check for a logical sector size and to enforce it, but that is not what this commit does. This commit is against the spirit of commit r268855. It was specifically to allow ZFS physical writes to have smaller alignments than otherwise would be dictated by ashift. I think that this commit should be reverted. If ZFS wants to make a physical I/O operation with a particular alignment then it must be allowed to. If that operation is invalid for a certain vdev, then it is higher level code that must be modified to account for the logical sector size. The physical zio must be _created_ correctly, it should not be silently transformed. > MFC after: 2 weeks > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 18:20:56 2014 (r269092) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 18:41:56 2014 (r269093) > @@ -2622,7 +2622,8 @@ zio_vdev_io_start(zio_t **ziop) > > align = 1ULL << vd->vdev_top->vdev_ashift; > > - if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && > + if ((!(zio->io_flags & ZIO_FLAG_PHYSICAL) || > + (vd->vdev_top->vdev_physical_ashift > SPA_MINBLOCKSHIFT)) && > P2PHASE(zio->io_size, align) != 0) { > /* Transform logical writes to be a full physical block size. */ > uint64_t asize = P2ROUNDUP(zio->io_size, align); > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 13:25:00 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 032E1462; Wed, 17 Sep 2014 13:25:00 +0000 (UTC) Received: from aslan.scsiguy.com (aslan.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEBEED56; Wed, 17 Sep 2014 13:24:59 +0000 (UTC) Received: from [192.168.0.61] (jt-mbp.home.scsiguy.org [192.168.0.61]) (authenticated bits=0) by aslan.scsiguy.com (8.14.9/8.14.9) with ESMTP id s8HDOpN9038799 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 17 Sep 2014 07:24:52 -0600 (MDT) (envelope-from gibbs@FreeBSD.org) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269093 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: "Justin T. Gibbs" In-Reply-To: <5419648D.2030305@FreeBSD.org> Date: Wed, 17 Sep 2014 07:24:51 -0600 Message-Id: <75BE5420-586F-4BDA-9D5C-F46A114E84EE@FreeBSD.org> References: <201407251841.s6PIfvUm002202@svn.freebsd.org> <5419648D.2030305@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 13:25:00 -0000 On Sep 17, 2014, at 4:38 AM, Andriy Gapon wrote: > On 25/07/2014 21:41, Xin LI wrote: >> Author: delphij >> Date: Fri Jul 25 18:41:56 2014 >> New Revision: 269093 >> URL: http://svnweb.freebsd.org/changeset/base/269093 >>=20 >> Log: >> Transform the I/O when vdev_physical_ashift is greater than >> SPA_MINBLOCKSHIFT. >=20 > This commit seems illogical to me. > I do not see why a fact that the _physical_ sector size is greater = than 512B > (e.g. 4KB) should force a data buffer of a "physical" zio to be = rounded up using > ashift. > To give an example. ZFS knows that a vdev has physical sector size of = 4KB, but > a logical sector size of 512B. ZFS uses ashift of 12 for the vdev. > Nevertheless in some situations ZFS wants to make a physical / special = write of > 512B (taking advantage of RMW). Why should we force that write to = become 4KB > with data beyond the first 512B being all zeros? >=20 > It would be logical to check for a logical sector size and to enforce = it, but > that is not what this commit does. >=20 > This commit is against the spirit of commit r268855. It was = specifically to > allow ZFS physical writes to have smaller alignments than otherwise = would be > dictated by ashift. I too don=92t see the motivation behind this commit unless it was an = attempt to get 4K native devices to work (i.e. devices that fail, by = design, accesses smaller than 4K). If this is the case, this is not the = correct fix. Since the transform doesn=92t do RMW, it seems like this = can also cause data loss. =20 >=20 > I think that this commit should be reverted. If ZFS wants to make a = physical > I/O operation with a particular alignment then it must be allowed to. = If that > operation is invalid for a certain vdev, then it is higher level code = that must > be modified to account for the logical sector size. The physical zio = must be > _created_ correctly, it should not be silently transformed. vdev_logical_ashift must be consulted when performing ZIO_FLAG_PHYSICAL = I/O instead of assuming vdev_logical_ashift is 9. (It is unfortunate = that the zio flag is named this way since the I/O is *not* constrained = by the physical characteristics of the media, but rather by the logical = restrictions of the software running on it.) r268855 doesn=92t do this = because illumos doesn=92t (yet?) have this information in their vdev = structure. However, we=92ve had it since r254591 so the MFV in r268855 = wasn=92t complete. Catching the misalignment in zio.c is more = user/developer friendly than having the CAM layer return EIO and = convince ZFS that this is a media failure. But, as Andriy points out, = the upper level code that might issue these I/Os must be changed to = understand =93logical sector size=94. =97 Justin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 14:06:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC2D2314; Wed, 17 Sep 2014 14:06:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6D4C1AC; Wed, 17 Sep 2014 14:06:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HE6LTH071462; Wed, 17 Sep 2014 14:06:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HE6LNu071461; Wed, 17 Sep 2014 14:06:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171406.s8HE6LNu071461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:06: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: r271707 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 14:06:21 -0000 Author: mav Date: Wed Sep 17 14:06:21 2014 New Revision: 271707 URL: http://svnweb.freebsd.org/changeset/base/271707 Log: MFC r271604, r271616: Add couple memory barriers to order tdq_cpu_idle and tdq_load accesses. This change fixes transient performance drops in some of my benchmarks, vanishing as soon as I am trying to collect any stats from the scheduler. It looks like reordered access to those variables sometimes caused loss of IPI_PREEMPT, that delayed thread execution until some later interrupt. Approved by: re (marius) Modified: stable/10/sys/kern/sched_ule.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sched_ule.c ============================================================================== --- stable/10/sys/kern/sched_ule.c Wed Sep 17 08:47:58 2014 (r271706) +++ stable/10/sys/kern/sched_ule.c Wed Sep 17 14:06:21 2014 (r271707) @@ -1037,6 +1037,14 @@ tdq_notify(struct tdq *tdq, struct threa ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; + + /* + * Make sure that tdq_load updated before calling this function + * is globally visible before we read tdq_cpu_idle. Idle thread + * accesses both of them without locks, and the order is important. + */ + mb(); + if (TD_IS_IDLETHREAD(ctd)) { /* * If the MD code has an idle wakeup routine try that before @@ -2645,6 +2653,12 @@ sched_idletd(void *dummy) /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + /* + * Make sure that tdq_cpu_idle update is globally visible + * before cpu_idle() read tdq_load. The order is important + * to avoid race with tdq_notify. + */ + mb(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 14:07:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53535454; Wed, 17 Sep 2014 14:07:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3691C5; Wed, 17 Sep 2014 14:07:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HE7fAI071683; Wed, 17 Sep 2014 14:07:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HE7f1N071682; Wed, 17 Sep 2014 14:07:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171407.s8HE7f1N071682@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:07:41 +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: r271708 - stable/9/sys/kern 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 14:07:41 -0000 Author: mav Date: Wed Sep 17 14:07:40 2014 New Revision: 271708 URL: http://svnweb.freebsd.org/changeset/base/271708 Log: MFC r271604, r271616: Add couple memory barriers to order tdq_cpu_idle and tdq_load accesses. This change fixes transient performance drops in some of my benchmarks, vanishing as soon as I am trying to collect any stats from the scheduler. It looks like reordered access to those variables sometimes caused loss of IPI_PREEMPT, that delayed thread execution until some later interrupt. Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Wed Sep 17 14:06:21 2014 (r271707) +++ stable/9/sys/kern/sched_ule.c Wed Sep 17 14:07:40 2014 (r271708) @@ -1006,6 +1006,14 @@ tdq_notify(struct tdq *tdq, struct threa ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; + + /* + * Make sure that tdq_load updated before calling this function + * is globally visible before we read tdq_cpu_idle. Idle thread + * accesses both of them without locks, and the order is important. + */ + mb(); + if (TD_IS_IDLETHREAD(ctd)) { /* * If the MD code has an idle wakeup routine try that before @@ -2607,6 +2615,12 @@ sched_idletd(void *dummy) /* Run main MD idle handler. */ tdq->tdq_cpu_idle = 1; + /* + * Make sure that tdq_cpu_idle update is globally visible + * before cpu_idle() read tdq_load. The order is important + * to avoid race with tdq_notify. + */ + mb(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 14:17:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7731BA43; Wed, 17 Sep 2014 14:17:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA8A323; Wed, 17 Sep 2014 14:17:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HEHesr076804; Wed, 17 Sep 2014 14:17:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HEHe7B076803; Wed, 17 Sep 2014 14:17:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171417.s8HEHe7B076803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271709 - stable/10/sys/dev/ahci 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 14:17:40 -0000 Author: mav Date: Wed Sep 17 14:17:39 2014 New Revision: 271709 URL: http://svnweb.freebsd.org/changeset/base/271709 Log: MFC r271403: Add PCI ID for Promise TX8660 8-port 3Gbps HBA. This device reports RAID subclass, but appears to be AHCI compatible. Submitted by: Yuri Perejilin Approved by: re (gjb) Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Wed Sep 17 14:07:40 2014 (r271708) +++ stable/10/sys/dev/ahci/ahci.c Wed Sep 17 14:17:39 2014 (r271709) @@ -351,6 +351,7 @@ static struct { {0x0d8d10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8e10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8f10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, + {0x3781105a, 0x00, "Promise TX8660", 0}, {0x33491106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x62871106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x11841039, 0x00, "SiS 966", 0}, From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 14:20:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9AFFBAF; Wed, 17 Sep 2014 14:20:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A84D33D; Wed, 17 Sep 2014 14:20:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HEK4FN077242; Wed, 17 Sep 2014 14:20:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HEK4pr077241; Wed, 17 Sep 2014 14:20:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171420.s8HEK4pr077241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 14:20:04 +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: r271710 - in stable/9/sys/dev: ahci usb/wlan 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 14:20:04 -0000 Author: mav Date: Wed Sep 17 14:20:04 2014 New Revision: 271710 URL: http://svnweb.freebsd.org/changeset/base/271710 Log: MFC r271403: Add PCI ID for Promise TX8660 8-port 3Gbps HBA. This device reports RAID subclass, but appears to be AHCI compatible. Submitted by: Yuri Perejilin Modified: stable/9/sys/dev/ahci/ahci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/forth/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/i386/gptboot/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/dev/run/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/dev/usb/wlan/if_run.c (props changed) stable/9/sys/dev/usb/wlan/if_runreg.h (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/ixgbe/ (props changed) stable/9/sys/modules/svr4/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/netpfil/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Wed Sep 17 14:17:39 2014 (r271709) +++ stable/9/sys/dev/ahci/ahci.c Wed Sep 17 14:20:04 2014 (r271710) @@ -355,6 +355,7 @@ static struct { {0x0d8d10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8e10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8f10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, + {0x3781105a, 0x00, "Promise TX8660", 0}, {0x33491106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x62871106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, {0x11841039, 0x00, "SiS 966", 0}, From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 16:16:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B48F52D6 for ; Wed, 17 Sep 2014 16:16:43 +0000 (UTC) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3989128B for ; Wed, 17 Sep 2014 16:16:42 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id ty20so2225582lab.35 for ; Wed, 17 Sep 2014 09:16:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=S3jgoj1n6OHmc1kiJi9FmvlC2MJaKSZmz48q9lQZ5N4=; b=OGulbx5yjAsUGJMJQKLC37Uth2QCoTTymsQu/fQXMlMPA5Ao9wJj1qWCzreTEXqVby 4Sry4DOf/itIBgG8886BkRUsr/73lVpfCknXgj24gQ47zIHBf5V3xLye8LLMLLaOlDrY mPKKBZoBAsH4vcHJKBe39UZKXM0VI98adUx6TQAuk4HeoWAbgGTtFnQuRDQfhTs6lfys 0m9/MCJgGDL8LUh3VMvhap85THDx6Z50jyOerHktWHnqwy9MKcAQt2eqh6AAscJyUEW0 X+enVJHeSG8kgiLBodHgNL7twcyXgj00hkhvSAuIRBgJByyiaA09HargUW+GaDR/U8lD eFqQ== X-Gm-Message-State: ALoCoQmc7n8mT9GyUx3m5a/Ucjj8bn9vnTi/mElem7M6FrwsKkEblFWKLrxnhUvQHulgtevUGr+c X-Received: by 10.152.4.194 with SMTP id m2mr32031214lam.63.1410970594908; Wed, 17 Sep 2014 09:16:34 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id t1sm6067118laz.28.2014.09.17.09.16.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 09:16:34 -0700 (PDT) Message-ID: <5419B3E1.1090703@freebsd.org> Date: Wed, 17 Sep 2014 20:16:33 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> In-Reply-To: <201409171406.s8HE6LNu071461@svn.freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 16:16:43 -0000 On 17.09.2014 18:06, Alexander Motin wrote: > + /* > + * Make sure that tdq_load updated before calling this function > + * is globally visible before we read tdq_cpu_idle. Idle thread > + * accesses both of them without locks, and the order is important. > + */ > + mb(); > + > if (TD_IS_IDLETHREAD(ctd)) { I don't understand this comment's first phrase with two verbs. Copy & paste result? I also don't see tdq_load access in this function. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 16:45:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD858D54; Wed, 17 Sep 2014 16:45:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99107807; Wed, 17 Sep 2014 16:45:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HGjKHD048112; Wed, 17 Sep 2014 16:45:20 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HGjK7l048111; Wed, 17 Sep 2014 16:45:20 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409171645.s8HGjK7l048111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 17 Sep 2014 16:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271711 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 16:45:20 -0000 Author: gjb Date: Wed Sep 17 16:45:20 2014 New Revision: 271711 URL: http://svnweb.freebsd.org/changeset/base/271711 Log: Update the bhyve(8) manual to reflect that it is no longer considered 'experimental.' Reviewed by: grehan MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Wed Sep 17 14:20:04 2014 (r271710) +++ head/usr.sbin/bhyve/bhyve.8 Wed Sep 17 16:45:20 2014 (r271711) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 26, 2014 +.Dd September 17, 2014 .Dt BHYVE 8 .Os .Sh NAME @@ -43,7 +43,7 @@ .Ar vmname .Sh DESCRIPTION .Nm -is an experimental hypervisor that runs guest operating systems inside a +is a hypervisor that runs guest operating systems inside a virtual machine. .Pp Parameters such as the number of virtual CPUs, amount of guest memory, and From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 16:46:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8BEAE9D; Wed, 17 Sep 2014 16:46:24 +0000 (UTC) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8098A813; Wed, 17 Sep 2014 16:46:23 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id ty20so2282248lab.35 for ; Wed, 17 Sep 2014 09:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5XSDHv3lQGfj7sLr0fvxRNxmhKW5UmZjnCMQKWswf7Q=; b=lvtfH2wvgfp2vXY+W/7nDi6CmpXdkf+Y0nHaN6HYT3Fvfd2+YDFXDz2VeAXeIC3ort RegSZFwczDCxBqfHsngufZH2SsvRXq1yVq3XWBTKHkWaAmNAKQ9wnU4hu0S7L5R/4TvM vQWlyoossiVhtbKPStZxBnF9JxBlJhXzpghvzX53yhxEvv8iJscwOH6wrfbDVVKO7sO2 HWjb44wbDME91hkcAZaDcsWe6Rak2Q/0+gKy97G+xdk9mIgzVrP9oNhT2D24kqxsi8w7 GhqRhVJR4THWWDXvAyI9ScarGDjze4M46PyYo79ofIm3kgjLI4XRw7cuDHSlgwjTmvgL aRTw== X-Received: by 10.152.1.137 with SMTP id 9mr20617479lam.85.1410972381397; Wed, 17 Sep 2014 09:46:21 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id ki7sm1828744lac.38.2014.09.17.09.46.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 09:46:20 -0700 (PDT) Sender: Alexander Motin Message-ID: <5419BAD7.4000600@FreeBSD.org> Date: Wed, 17 Sep 2014 19:46:15 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> In-Reply-To: <5419B3E1.1090703@freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 16:46:24 -0000 On 17.09.2014 19:16, Andrey Chernov wrote: > On 17.09.2014 18:06, Alexander Motin wrote: >> + /* >> + * Make sure that tdq_load updated before calling this function >> + * is globally visible before we read tdq_cpu_idle. Idle thread >> + * accesses both of them without locks, and the order is important. >> + */ >> + mb(); >> + >> if (TD_IS_IDLETHREAD(ctd)) { > > I don't understand this comment's first phrase with two verbs. Copy & > paste result? No, only possibly missing commas around "updated before calling this function". > I also don't see tdq_load access in this function. It is incremented by tdq_load_add(), called by tdq_add(), called by sched_add(), just before calling tdq_notify(). -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 17:08:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26F7BB5E; Wed, 17 Sep 2014 17:08:12 +0000 (UTC) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4BD9A58; Wed, 17 Sep 2014 17:08:11 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id s8HH2gbr008670; Wed, 17 Sep 2014 12:08:10 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp1.rice.edu with ESMTP id 1peewq11dr-1; Wed, 17 Sep 2014 12:08:10 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 134CE403F5; Wed, 17 Sep 2014 12:08:10 -0500 (CDT) Message-ID: <5419BFF9.9080907@rice.edu> Date: Wed, 17 Sep 2014 12:08:09 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Alexander Motin , Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> <5419BAD7.4000600@FreeBSD.org> In-Reply-To: <5419BAD7.4000600@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409170139 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 17:08:12 -0000 On 09/17/2014 11:46, Alexander Motin wrote: > On 17.09.2014 19:16, Andrey Chernov wrote: >> On 17.09.2014 18:06, Alexander Motin wrote: >>> + /* >>> + * Make sure that tdq_load updated before calling this function >>> + * is globally visible before we read tdq_cpu_idle. Idle thread >>> + * accesses both of them without locks, and the order is important. >>> + */ >>> + mb(); >>> + >>> if (TD_IS_IDLETHREAD(ctd)) { >> I don't understand this comment's first phrase with two verbs. Copy & >> paste result? > No, only possibly missing commas around "updated before calling this > function". Commas alone don't fix the problem. I think what you're trying to say is: "Make sure that our caller's earlier update to tdq_load is globally visible before we read tdq_cpu_idle." >> I also don't see tdq_load access in this function. > It is incremented by tdq_load_add(), called by tdq_add(), called by > sched_add(), just before calling tdq_notify(). > From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 17:33:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D8C5493; Wed, 17 Sep 2014 17:33:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4750DD2D; Wed, 17 Sep 2014 17:33:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HHXObF072204; Wed, 17 Sep 2014 17:33:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HHXNxJ072193; Wed, 17 Sep 2014 17:33:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409171733.s8HHXNxJ072193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 17 Sep 2014 17:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271712 - in head/sys: kern mips/cavium powerpc/powerpc sparc64/sparc64 sys x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 17:33:24 -0000 Author: adrian Date: Wed Sep 17 17:33:22 2014 New Revision: 271712 URL: http://svnweb.freebsd.org/changeset/base/271712 Log: Migrate ie->ie_assign_cpu and associated code to use an int for CPU rather than u_char. Migrate post_filter to use an int for a CPU rather than u_char. Change intr_event_bind() to use an int for CPU rather than u_char. It touches the ppc, sparc64, arm and mips machdep code but it should (hah!) be a no-op. Tested: * i386, AMD64 laptops Reviewed by: jhb Modified: head/sys/kern/kern_intr.c head/sys/mips/cavium/ciu.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/sparc64/sparc64/intr_machdep.c head/sys/sys/interrupt.h head/sys/x86/x86/intr_machdep.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Wed Sep 17 16:45:20 2014 (r271711) +++ head/sys/kern/kern_intr.c Wed Sep 17 17:33:22 2014 (r271712) @@ -249,7 +249,7 @@ intr_event_update(struct intr_event *ie) int intr_event_create(struct intr_event **event, void *source, int flags, int irq, void (*pre_ithread)(void *), void (*post_ithread)(void *), - void (*post_filter)(void *), int (*assign_cpu)(void *, u_char), + void (*post_filter)(void *), int (*assign_cpu)(void *, int), const char *fmt, ...) { struct intr_event *ie; @@ -292,7 +292,7 @@ intr_event_create(struct intr_event **ev * the interrupt event. */ int -intr_event_bind(struct intr_event *ie, u_char cpu) +intr_event_bind(struct intr_event *ie, int cpu) { lwpid_t id; int error; @@ -1078,7 +1078,7 @@ intr_event_schedule_thread(struct intr_e * a PIC. */ static int -swi_assign_cpu(void *arg, u_char cpu) +swi_assign_cpu(void *arg, int cpu) { return (0); Modified: head/sys/mips/cavium/ciu.c ============================================================================== --- head/sys/mips/cavium/ciu.c Wed Sep 17 16:45:20 2014 (r271711) +++ head/sys/mips/cavium/ciu.c Wed Sep 17 17:33:22 2014 (r271712) @@ -91,13 +91,13 @@ static void ciu_hinted_child(device_t, static void ciu_en0_intr_mask(void *); static void ciu_en0_intr_unmask(void *); #ifdef SMP -static int ciu_en0_intr_bind(void *, u_char); +static int ciu_en0_intr_bind(void *, int); #endif static void ciu_en1_intr_mask(void *); static void ciu_en1_intr_unmask(void *); #ifdef SMP -static int ciu_en1_intr_bind(void *, u_char); +static int ciu_en1_intr_bind(void *, int); #endif static int ciu_intr(void *); @@ -208,7 +208,7 @@ ciu_setup_intr(device_t bus, device_t ch struct intr_event *event, **eventp; void (*mask_func)(void *); void (*unmask_func)(void *); - int (*bind_func)(void *, u_char); + int (*bind_func)(void *, int); mips_intrcnt_t intrcnt; int error; int irq; @@ -343,7 +343,7 @@ ciu_en0_intr_unmask(void *arg) #ifdef SMP static int -ciu_en0_intr_bind(void *arg, u_char target) +ciu_en0_intr_bind(void *arg, int target) { uint64_t mask; int core; @@ -389,7 +389,7 @@ ciu_en1_intr_unmask(void *arg) #ifdef SMP static int -ciu_en1_intr_bind(void *arg, u_char target) +ciu_en1_intr_bind(void *arg, int target) { uint64_t mask; int core; Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Wed Sep 17 16:45:20 2014 (r271711) +++ head/sys/powerpc/powerpc/intr_machdep.c Wed Sep 17 17:33:22 2014 (r271712) @@ -293,7 +293,7 @@ powerpc_intr_post_ithread(void *arg) } static int -powerpc_assign_intr_cpu(void *arg, u_char cpu) +powerpc_assign_intr_cpu(void *arg, int cpu) { #ifdef SMP struct powerpc_intr *i = arg; Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Wed Sep 17 16:45:20 2014 (r271711) +++ head/sys/sparc64/sparc64/intr_machdep.c Wed Sep 17 17:33:22 2014 (r271712) @@ -116,7 +116,7 @@ static void intr_assign_next_cpu(struct static void intr_shuffle_irqs(void *arg __unused); #endif -static int intr_assign_cpu(void *arg, u_char cpu); +static int intr_assign_cpu(void *arg, int cpu); static void intr_execute_handlers(void *); static void intr_stray_level(struct trapframe *); static void intr_stray_vector(void *); @@ -256,7 +256,7 @@ intr_init2() } static int -intr_assign_cpu(void *arg, u_char cpu) +intr_assign_cpu(void *arg, int cpu) { #ifdef SMP struct pcpu *pc; Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Wed Sep 17 16:45:20 2014 (r271711) +++ head/sys/sys/interrupt.h Wed Sep 17 17:33:22 2014 (r271712) @@ -112,13 +112,13 @@ struct intr_event { void (*ie_pre_ithread)(void *); void (*ie_post_ithread)(void *); void (*ie_post_filter)(void *); - int (*ie_assign_cpu)(void *, u_char); + int (*ie_assign_cpu)(void *, int); int ie_flags; int ie_count; /* Loop counter. */ int ie_warncnt; /* Rate-check interrupt storm warns. */ struct timeval ie_warntm; int ie_irq; /* Physical irq number if !SOFT. */ - u_char ie_cpu; /* CPU this event is bound to. */ + int ie_cpu; /* CPU this event is bound to. */ }; /* Interrupt event flags kept in ie_flags. */ @@ -161,11 +161,11 @@ u_char intr_priority(enum intr_type flag int intr_event_add_handler(struct intr_event *ie, const char *name, driver_filter_t filter, driver_intr_t handler, void *arg, u_char pri, enum intr_type flags, void **cookiep); -int intr_event_bind(struct intr_event *ie, u_char cpu); +int intr_event_bind(struct intr_event *ie, int cpu); int intr_event_create(struct intr_event **event, void *source, int flags, int irq, void (*pre_ithread)(void *), void (*post_ithread)(void *), void (*post_filter)(void *), - int (*assign_cpu)(void *, u_char), const char *fmt, ...) + int (*assign_cpu)(void *, int), const char *fmt, ...) __printflike(9, 10); int intr_event_describe_handler(struct intr_event *ie, void *cookie, const char *descr); Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Wed Sep 17 16:45:20 2014 (r271711) +++ head/sys/x86/x86/intr_machdep.c Wed Sep 17 17:33:22 2014 (r271712) @@ -86,7 +86,7 @@ char intrnames[INTRCNT_COUNT * (MAXCOMLE size_t sintrcnt = sizeof(intrcnt); size_t sintrnames = sizeof(intrnames); -static int intr_assign_cpu(void *arg, u_char cpu); +static int intr_assign_cpu(void *arg, int cpu); static void intr_disable_src(void *arg); static void intr_init(void *__dummy); static int intr_pic_registered(struct pic *pic); @@ -305,7 +305,7 @@ intr_suspend(void) } static int -intr_assign_cpu(void *arg, u_char cpu) +intr_assign_cpu(void *arg, int cpu) { #ifdef SMP struct intsrc *isrc; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 17:36:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AD37678; Wed, 17 Sep 2014 17:36:06 +0000 (UTC) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05645D56; Wed, 17 Sep 2014 17:36:04 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id ty20so2322636lab.23 for ; Wed, 17 Sep 2014 10:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=9ACu5/zmUrhBxqMhiH5Tq6YY6IiFjkNJPgJbQP11U2U=; b=P67UntCIDeoiTY4fpL7iDP1koEPCwkB77A9BtYo7lPznXcCiQIzp6WlyhxRYv1Q98Y QGNgyehfcNSIiO/yUh+D/vvOa5SQLqUt7oWwfxajIWk6GjLt+jLheobmKyTWMuu1wplz N0ngCiL2Ck/Sfaz6HFPutEtrWjQ8hWE4iTbb9D9dH9WiAV2Tpro+tds8pxzSg4Z8wbOG lOAQKXg8kK/zPj5yjfp+lRaxmDll+ltwz6ZFI7QNZSaIxZbQdKvhpsfVc9QYyHFOMHKQ kC6U7jkksrmGntmEBeoe7bKMciN8G0S3d6sicPxlh0+EvJvy8Q4vVD7/WpyyKj5+8O6F EiIw== X-Received: by 10.112.199.197 with SMTP id jm5mr42824512lbc.19.1410975362729; Wed, 17 Sep 2014 10:36:02 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id vr9sm6366777lbb.36.2014.09.17.10.36.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 10:36:01 -0700 (PDT) Sender: Alexander Motin Message-ID: <5419C67F.90808@FreeBSD.org> Date: Wed, 17 Sep 2014 20:35:59 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alan Cox , Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> <5419BAD7.4000600@FreeBSD.org> <5419BFF9.9080907@rice.edu> In-Reply-To: <5419BFF9.9080907@rice.edu> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 17:36:06 -0000 On 17.09.2014 20:08, Alan Cox wrote: > On 09/17/2014 11:46, Alexander Motin wrote: >> On 17.09.2014 19:16, Andrey Chernov wrote: >>> On 17.09.2014 18:06, Alexander Motin wrote: >>>> + /* >>>> + * Make sure that tdq_load updated before calling this function >>>> + * is globally visible before we read tdq_cpu_idle. Idle thread >>>> + * accesses both of them without locks, and the order is important. >>>> + */ >>>> + mb(); >>>> + >>>> if (TD_IS_IDLETHREAD(ctd)) { >>> I don't understand this comment's first phrase with two verbs. Copy & >>> paste result? >> No, only possibly missing commas around "updated before calling this >> function". > > > Commas alone don't fix the problem. I think what you're trying to say is: > > "Make sure that our caller's earlier update to tdq_load is globally > visible before we read tdq_cpu_idle." Yes, that was my intention. Thank you. Please excuse my non-native English and correct it as you feel better. Andrey, would that reveal your questions? >>> I also don't see tdq_load access in this function. >> It is incremented by tdq_load_add(), called by tdq_add(), called by >> sched_add(), just before calling tdq_notify(). -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 17:38:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9E3E94D for ; Wed, 17 Sep 2014 17:38:29 +0000 (UTC) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD93DA6 for ; Wed, 17 Sep 2014 17:38:28 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id hz20so2387343lab.29 for ; Wed, 17 Sep 2014 10:38:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=zkua6EMUhsBgXXmFXawiGTlmuq/Vibpu5iV51L7udMs=; b=VsvQLql51d97w3DdykeWvsuACSLjRVXLJwNP08DOlubBgo6NZd8u/DEuW7a8WhIvJa sc2cW0ZNZhNG7d2hn6BGQneiuZA3KWvPE0mo5LZqg4d8EtidzDB2Yhw3jEUD5hN1OXNq OuPNVz9Icle2QBJYkd+CImtYJiordFjmU4pnnTtKVwauUaIMqV4QtrbKaZceSt7aG0zI JppAt7QrmMstEShZzTUXlMPYwlFYwnO9ww4MUbE7yPZN4mr3guQHvDxkZ6qgLpIlhaef nwgyhm2AluzjVNYSpHqgvQjTCOHiiVWLpp4qx8UaT17F9IpCnzj1OlrqHeRvd3G1Wrrl G0hQ== X-Gm-Message-State: ALoCoQnsZ65lfUvvw2p8Z4duezAsXZuBNHvW3ek/KVY1brwe4CFag49olYwCA18F2KNrZUjC8EHo X-Received: by 10.112.13.132 with SMTP id h4mr15849484lbc.45.1410975500870; Wed, 17 Sep 2014 10:38:20 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id bm4sm5867216lbc.22.2014.09.17.10.38.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 10:38:20 -0700 (PDT) Message-ID: <5419C70B.4010209@freebsd.org> Date: Wed, 17 Sep 2014 21:38:19 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Alexander Motin , Alan Cox , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r271707 - stable/10/sys/kern References: <201409171406.s8HE6LNu071461@svn.freebsd.org> <5419B3E1.1090703@freebsd.org> <5419BAD7.4000600@FreeBSD.org> <5419BFF9.9080907@rice.edu> <5419C67F.90808@FreeBSD.org> In-Reply-To: <5419C67F.90808@FreeBSD.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 17:38:29 -0000 On 17.09.2014 21:35, Alexander Motin wrote: > On 17.09.2014 20:08, Alan Cox wrote: >> On 09/17/2014 11:46, Alexander Motin wrote: >>> On 17.09.2014 19:16, Andrey Chernov wrote: >>>> On 17.09.2014 18:06, Alexander Motin wrote: >>>>> + /* >>>>> + * Make sure that tdq_load updated before calling this function >>>>> + * is globally visible before we read tdq_cpu_idle. Idle thread >>>>> + * accesses both of them without locks, and the order is important. >>>>> + */ >>>>> + mb(); >>>>> + >>>>> if (TD_IS_IDLETHREAD(ctd)) { >>>> I don't understand this comment's first phrase with two verbs. Copy & >>>> paste result? >>> No, only possibly missing commas around "updated before calling this >>> function". >> >> >> Commas alone don't fix the problem. I think what you're trying to say is: >> >> "Make sure that our caller's earlier update to tdq_load is globally >> visible before we read tdq_cpu_idle." > > Yes, that was my intention. Thank you. Please excuse my non-native > English and correct it as you feel better. > > Andrey, would that reveal your questions? Sound nice for me, commit, please. > >>>> I also don't see tdq_load access in this function. >>> It is incremented by tdq_load_add(), called by tdq_add(), called by >>> sched_add(), just before calling tdq_notify(). > -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 17:43:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E8ADCC1; Wed, 17 Sep 2014 17:43:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0F0E8E; Wed, 17 Sep 2014 17:43:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HHhXrv076947; Wed, 17 Sep 2014 17:43:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HHhXqI076946; Wed, 17 Sep 2014 17:43:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409171743.s8HHhXqI076946@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 17 Sep 2014 17:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271713 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 17:43:33 -0000 Author: mav Date: Wed Sep 17 17:43:32 2014 New Revision: 271713 URL: http://svnweb.freebsd.org/changeset/base/271713 Log: Reprase r271616 comments. Submitted by: alc MFC after: 1 month Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Sep 17 17:33:22 2014 (r271712) +++ head/sys/kern/sched_ule.c Wed Sep 17 17:43:32 2014 (r271713) @@ -1039,8 +1039,8 @@ tdq_notify(struct tdq *tdq, struct threa return; /* - * Make sure that tdq_load updated before calling this function - * is globally visible before we read tdq_cpu_idle. Idle thread + * Make sure that our caller's earlier update to tdq_load is + * globally visible before we read tdq_cpu_idle. Idle thread * accesses both of them without locks, and the order is important. */ mb(); From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 18:14:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE1DD521; Wed, 17 Sep 2014 18:14:30 +0000 (UTC) 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 C2F19286; Wed, 17 Sep 2014 18:14:30 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C40E0B979; Wed, 17 Sep 2014 14:14:29 -0400 (EDT) From: John Baldwin To: Andriy Gapon Subject: Re: svn commit: r271635 - in head: lib/libc/sys sys/vm Date: Wed, 17 Sep 2014 11:03:29 -0400 Message-ID: <45601526.3eIXIxKgkH@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <54183D4D.3050907@FreeBSD.org> References: <201409151720.s8FHKDFs099885@svn.freebsd.org> <54183D4D.3050907@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Sep 2014 14:14:29 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-java@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 18:14:31 -0000 On Tuesday, September 16, 2014 04:38:21 PM Andriy Gapon wrote: > On 15/09/2014 20:20, John Baldwin wrote: > > Author: jhb > > Date: Mon Sep 15 17:20:13 2014 > > New Revision: 271635 > > URL: http://svnweb.freebsd.org/changeset/base/271635 > > > > Log: > > Add stricter checking of some mmap() arguments: > > - Fail with EINVAL if an invalid protection mask is passed to mmap(). > > - Fail with EINVAL if an unknown flag is passed to mmap(). > > - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to > > mmap(). > > - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous > > > > mappings. > > This broke Java, at least java/openjdk7, for me: > > 25323 java CALL > mmap(0,0x3000000,0x3,0x1042 MAP_ANON>,0xffffffff,0) 25323 java RET mmap -1 errno 22 Invalid > argument > 25323 java CALL write(0x1,0x7fffffbfd450,0x2b) > 25323 java GIO fd 1 wrote 43 bytes > "Error occurred during initialization of VM > " > 25323 java RET write 43/0x2b > 25323 java CALL write(0x1,0x80209a1e2,0x2d) > 25323 java GIO fd 1 wrote 45 bytes > "Could not reserve enough space for code cache" > > It seems that MAP_NORESERVE presence could be detected in sys/mman.h and > then it is used for some reason. > I guess that the port can be easily fixed, but this commit breaks > compatibility with older binaries. Perhaps MAP_NORESERVE should be removed > as well given that we do not actually implement it. I've allowed it for now, but I do intend on removing it in 11. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 18:14:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBF80523; Wed, 17 Sep 2014 18:14:31 +0000 (UTC) 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 AE978287; Wed, 17 Sep 2014 18:14:31 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B7DFFB941; Wed, 17 Sep 2014 14:14:30 -0400 (EDT) From: John Baldwin To: David Somayajulu Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Date: Wed, 17 Sep 2014 11:02 -0400 Message-ID: <1807177.fGkyECExdY@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> References: <201405081940.s48Jebh5041824@svn.freebsd.org> <54167255.5090806@FreeBSD.org> <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Sep 2014 14:14:30 -0400 (EDT) Cc: "svn-src-head@freebsd.org" , "Andrey V. Elsukov" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , David C Somayajulu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 18:14:32 -0000 On Monday, September 15, 2014 04:31:13 PM David Somayajulu wrote: > Hi Andrey, > When I didn't have the clean override, "make clean" was not cleaning > properly when I built a standalone loadable driver. Perhaps we can change > "clean" in bxe/Makefile and bce/Makefile to "dclean". Try using 'make cleandir' instead of 'make clean'. 'make clean' does not clean files created by 'make depend' such as the 'machine' and 'x86' symlinks. There is a 'make cleandepend' that will clean up such files, but I tend to use 'make cleandir' which does both. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 18:17:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C9117FD; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D3E22CE; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HIHJfG091640; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HIHJWF091639; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409171817.s8HIHJWF091639@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Sep 2014 18:17: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: r271714 - in stable: 10/sys/dev/if_ndis 9/sys/dev/if_ndis 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 18:17:19 -0000 Author: jhb Date: Wed Sep 17 18:17:18 2014 New Revision: 271714 URL: http://svnweb.freebsd.org/changeset/base/271714 Log: MFC 270830: When anouncing link state changes on an 802.11 interface with a vap, announce the change on the vap's ifnet instead of the main ifnet. This matches the behavior of other wireless drivers in the tree and allows the default devd configuration to correctly start dhclient automatically after an ndis wireless device associates. Approved by: re (marius for 10) Modified: stable/10/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/10/sys/dev/if_ndis/if_ndis.c Wed Sep 17 17:43:32 2014 (r271713) +++ stable/10/sys/dev/if_ndis/if_ndis.c Wed Sep 17 18:17:18 2014 (r271714) @@ -1709,23 +1709,26 @@ ndis_ticktask(d, xsc) if (sc->ndis_link == 0 && sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) { sc->ndis_link = 1; - NDIS_UNLOCK(sc); if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ndis_getstate_80211(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, -1); - } - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_UP); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_UP); + } else + if_link_state_change(sc->ifp, LINK_STATE_UP); } if (sc->ndis_link == 1 && sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) { sc->ndis_link = 0; - NDIS_UNLOCK(sc); - if ((sc->ndis_80211 != 0) && (vap != NULL)) + if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_DOWN); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_DOWN); + } else + if_link_state_change(sc->ifp, LINK_STATE_DOWN); } NDIS_UNLOCK(sc); From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 18:17:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB7467FE; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC9092D1; Wed, 17 Sep 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HIHJtW091646; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HIHJR6091645; Wed, 17 Sep 2014 18:17:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409171817.s8HIHJR6091645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Sep 2014 18:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271714 - in stable: 10/sys/dev/if_ndis 9/sys/dev/if_ndis 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 18:17:20 -0000 Author: jhb Date: Wed Sep 17 18:17:18 2014 New Revision: 271714 URL: http://svnweb.freebsd.org/changeset/base/271714 Log: MFC 270830: When anouncing link state changes on an 802.11 interface with a vap, announce the change on the vap's ifnet instead of the main ifnet. This matches the behavior of other wireless drivers in the tree and allows the default devd configuration to correctly start dhclient automatically after an ndis wireless device associates. Approved by: re (marius for 10) Modified: stable/9/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/9/sys/dev/if_ndis/if_ndis.c Wed Sep 17 17:43:32 2014 (r271713) +++ stable/9/sys/dev/if_ndis/if_ndis.c Wed Sep 17 18:17:18 2014 (r271714) @@ -1710,23 +1710,26 @@ ndis_ticktask(d, xsc) if (sc->ndis_link == 0 && sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) { sc->ndis_link = 1; - NDIS_UNLOCK(sc); if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ndis_getstate_80211(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, -1); - } - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_UP); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_UP); + } else + if_link_state_change(sc->ifp, LINK_STATE_UP); } if (sc->ndis_link == 1 && sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) { sc->ndis_link = 0; - NDIS_UNLOCK(sc); - if ((sc->ndis_80211 != 0) && (vap != NULL)) + if ((sc->ndis_80211 != 0) && (vap != NULL)) { + NDIS_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); - NDIS_LOCK(sc); - if_link_state_change(sc->ifp, LINK_STATE_DOWN); + NDIS_LOCK(sc); + if_link_state_change(vap->iv_ifp, LINK_STATE_DOWN); + } else + if_link_state_change(sc->ifp, LINK_STATE_DOWN); } NDIS_UNLOCK(sc); From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 18:49:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1896F7EA; Wed, 17 Sep 2014 18:49:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A1185E; Wed, 17 Sep 2014 18:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HInvv6007291; Wed, 17 Sep 2014 18:49:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HInv5S007289; Wed, 17 Sep 2014 18:49:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409171849.s8HInv5S007289@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Sep 2014 18:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271716 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 18:49:58 -0000 Author: kib Date: Wed Sep 17 18:49:57 2014 New Revision: 271716 URL: http://svnweb.freebsd.org/changeset/base/271716 Log: Presence of any VM_PROT bits in the permission argument on x86 implies that the entry is readable and valid. Reported by: markj Submitted by: alc Tested by: pho (previous version), markj MFC after: 3 days Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Sep 17 18:46:51 2014 (r271715) +++ head/sys/amd64/amd64/pmap.c Wed Sep 17 18:49:57 2014 (r271716) @@ -3845,7 +3845,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pt_entry_t *pte, PG_G, PG_M, PG_RW, PG_V; boolean_t anychanged, pv_lists_locked; - if ((prot & VM_PROT_READ) == VM_PROT_NONE) { + KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); + if (prot == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Sep 17 18:46:51 2014 (r271715) +++ head/sys/i386/i386/pmap.c Wed Sep 17 18:49:57 2014 (r271716) @@ -3161,7 +3161,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pt_entry_t *pte; boolean_t anychanged, pv_lists_locked; - if ((prot & VM_PROT_READ) == VM_PROT_NONE) { + KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); + if (prot == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 18:55:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B784BB0B; Wed, 17 Sep 2014 18:55:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88F9093D; Wed, 17 Sep 2014 18:55:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HIteAu011432; Wed, 17 Sep 2014 18:55:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HItehx011430; Wed, 17 Sep 2014 18:55:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409171855.s8HItehx011430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Sep 2014 18:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271717 - in head/sys: dev/acpica sparc64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 18:55:40 -0000 Author: jhb Date: Wed Sep 17 18:55:39 2014 New Revision: 271717 URL: http://svnweb.freebsd.org/changeset/base/271717 Log: Revert unrelated changes accidentally committed in r271192. Modified: head/sys/dev/acpica/acpi.c head/sys/sparc64/pci/psycho.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Sep 17 18:49:57 2014 (r271716) +++ head/sys/dev/acpica/acpi.c Wed Sep 17 18:55:39 2014 (r271717) @@ -1211,11 +1211,6 @@ acpi_set_resource(device_t dev, device_t if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT)) #endif { - if (bootverbose) - device_printf(dev, - "Ignoring %s range %#lx-%#lx for %s\n", - type == SYS_RES_MEMORY ? "memory" : "I/O", - start, start + count - 1, acpi_name(ad->ad_handle)); AcpiOsFree(devinfo); return (0); } Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Wed Sep 17 18:49:57 2014 (r271716) +++ head/sys/sparc64/pci/psycho.c Wed Sep 17 18:55:39 2014 (r271717) @@ -448,30 +448,24 @@ psycho_attach(device_t dev) i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* + * Make sure that the expected ranges are present. The + * OFW_PCI_CS_MEM64 one is not currently used though. + */ + if (i != PSYCHO_NRANGE) + panic("%s: unsupported number of ranges", __func__); + /* * Find the addresses of the various bus spaces. * There should not be multiple ones of one kind. * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (; i >= 0; i--) { + for (i = 0; i < PSYCHO_NRANGE; i++) { j = OFW_PCI_RANGE_CS(&range[i]); if (sc->sc_pci_bh[j] != 0) panic("%s: duplicate range for space %d", __func__, j); sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } - - /* - * Make sure that the expected ranges are present. The - * OFW_PCI_CS_MEM64 one is not currently used. - */ - if (sc->sc_pci_bh[OFW_PCI_CS_CONFIG] == 0) - panic("%s: missing CONFIG range", __func__); - if (sc->sc_pci_bh[OFW_PCI_CS_IO] == 0) - panic("%s: missing IO range", __func__); - if (sc->sc_pci_bh[OFW_PCI_CS_MEM32] == 0) - panic("%s: missing MEM32 range", __func__); - free(range, M_OFWPROP); /* Register the softc, this is needed for paired Psychos. */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 18:59:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FAC1D08; Wed, 17 Sep 2014 18:59:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF5A096C; Wed, 17 Sep 2014 18:59:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HIxPBl011962; Wed, 17 Sep 2014 18:59:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HIxPTJ011961; Wed, 17 Sep 2014 18:59:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409171859.s8HIxPTJ011961@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Sep 2014 18:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271718 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 18:59:26 -0000 Author: bdrewery Date: Wed Sep 17 18:59:25 2014 New Revision: 271718 URL: http://svnweb.freebsd.org/changeset/base/271718 Log: Correct a comment Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Sep 17 18:55:39 2014 (r271717) +++ head/sys/cam/cam_xpt.c Wed Sep 17 18:59:25 2014 (r271718) @@ -3052,7 +3052,7 @@ xpt_polled_action(union ccb *start_ccb) } /* - * Schedule a peripheral driver to receive a ccb when it's + * Schedule a peripheral driver to receive a ccb when its * target device has space for more transactions. */ void From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:01:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDB95E86; Wed, 17 Sep 2014 19:01:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE032A09; Wed, 17 Sep 2014 19:01:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HJ1NqG013290; Wed, 17 Sep 2014 19:01:23 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HJ1M8u013286; Wed, 17 Sep 2014 19:01:22 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201409171901.s8HJ1M8u013286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Wed, 17 Sep 2014 19:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271719 - in head/lib/msun: ld128 ld80 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:01:24 -0000 Author: kargl Date: Wed Sep 17 19:01:22 2014 New Revision: 271719 URL: http://svnweb.freebsd.org/changeset/base/271719 Log: For targets that have a signed zero, lgamma_r(-0, &signgamp) should set signgamp = -1. Submitted by: enh at google dot com (e_lgamma[f]_r.c) Modified: head/lib/msun/ld128/e_lgammal_r.c head/lib/msun/ld80/e_lgammal_r.c head/lib/msun/src/e_lgamma_r.c head/lib/msun/src/e_lgammaf_r.c Modified: head/lib/msun/ld128/e_lgammal_r.c ============================================================================== --- head/lib/msun/ld128/e_lgammal_r.c Wed Sep 17 18:59:25 2014 (r271718) +++ head/lib/msun/ld128/e_lgammal_r.c Wed Sep 17 19:01:22 2014 (r271719) @@ -241,7 +241,11 @@ lgammal_r(long double x, int *signgamp) *signgamp = 1; if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */ return x*x; - if((hx==0||hx==0x8000)&&lx==0) return one/vzero; + if((hx==0||hx==0x8000)&&lx==0) { + if (hx&0x8000) + *signgamp = -1; + return one/vzero; + } /* purge off tiny and negative arguments */ if(fabsl(x)<0x1p-119L) { Modified: head/lib/msun/ld80/e_lgammal_r.c ============================================================================== --- head/lib/msun/ld80/e_lgammal_r.c Wed Sep 17 18:59:25 2014 (r271718) +++ head/lib/msun/ld80/e_lgammal_r.c Wed Sep 17 19:01:22 2014 (r271719) @@ -261,7 +261,11 @@ lgammal_r(long double x, int *signgamp) *signgamp = 1; if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */ return x*x; - if((hx==0||hx==0x8000)&&lx==0) return one/vzero; + if((hx==0||hx==0x8000)&&lx==0) { + if (hx&0x8000) + *signgamp = -1; + return one/vzero; + } ENTERI(); Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Wed Sep 17 18:59:25 2014 (r271718) +++ head/lib/msun/src/e_lgamma_r.c Wed Sep 17 19:01:22 2014 (r271719) @@ -214,7 +214,11 @@ __ieee754_lgamma_r(double x, int *signga *signgamp = 1; ix = hx&0x7fffffff; if(ix>=0x7ff00000) return x*x; - if((ix|lx)==0) return one/vzero; + if((ix|lx)==0) { + if(hx<0) + *signgamp = -1; + return one/vzero; + } if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */ if(hx<0) { *signgamp = -1; Modified: head/lib/msun/src/e_lgammaf_r.c ============================================================================== --- head/lib/msun/src/e_lgammaf_r.c Wed Sep 17 18:59:25 2014 (r271718) +++ head/lib/msun/src/e_lgammaf_r.c Wed Sep 17 19:01:22 2014 (r271719) @@ -132,7 +132,11 @@ __ieee754_lgammaf_r(float x, int *signga *signgamp = 1; ix = hx&0x7fffffff; if(ix>=0x7f800000) return x*x; - if(ix==0) return one/vzero; + if(ix==0) { + if(hx<0) + *signgamp = -1; + return one/vzero; + } if(ix<0x35000000) { /* |x|<2**-21, return -log(|x|) */ if(hx<0) { *signgamp = -1; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:09:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA16A3E9; Wed, 17 Sep 2014 19:09:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95432A89; Wed, 17 Sep 2014 19:09:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HJ9w9T017142; Wed, 17 Sep 2014 19:09:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HJ9wgv017141; Wed, 17 Sep 2014 19:09:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409171909.s8HJ9wgv017141@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Sep 2014 19:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271720 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:09:58 -0000 Author: bdrewery Date: Wed Sep 17 19:09:58 2014 New Revision: 271720 URL: http://svnweb.freebsd.org/changeset/base/271720 Log: If fgets(3) fails in getbounds(), show strerror(3) if not an EOF. Also fix a FILE* leak in getbounds(). Submitted by: Conrad Meyer PR: 192032 Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Sep 17 19:01:22 2014 (r271719) +++ head/sbin/savecore/savecore.c Wed Sep 17 19:09:58 2014 (r271720) @@ -151,7 +151,10 @@ getbounds(void) { } if (fgets(buf, sizeof buf, fp) == NULL) { - syslog(LOG_WARNING, "unable to read from bounds, using 0"); + if (feof(fp)) + syslog(LOG_WARNING, "bounds file is empty, using 0"); + else + syslog(LOG_WARNING, "bounds file: %s", strerror(errno)); fclose(fp); return (ret); } @@ -160,6 +163,7 @@ getbounds(void) { ret = (int)strtol(buf, NULL, 10); if (ret == 0 && (errno == EINVAL || errno == ERANGE)) syslog(LOG_WARNING, "invalid value found in bounds, using 0"); + fclose(fp); return (ret); } From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:16:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88A8867D; Wed, 17 Sep 2014 19:16:25 +0000 (UTC) Received: from mx0a-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 618F2B74; Wed, 17 Sep 2014 19:16:24 +0000 (UTC) Received: from pps.filterd (m0045602.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.14.5/8.14.5) with SMTP id s8HJETbL020270; Wed, 17 Sep 2014 12:16:18 -0700 Received: from avcashub1.qlogic.com (avcashub1.qlogic.com [198.70.193.115]) by mx0a-0016ce01.pphosted.com with ESMTP id 1pef5f2p8d-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 17 Sep 2014 12:16:18 -0700 Received: from AVMB1.qlogic.org ([fe80::c919:8cc:f3ba:c727]) by avcashub1.qlogic.org ([::1]) with mapi id 14.02.0387.000; Wed, 17 Sep 2014 12:16:21 -0700 From: David Somayajulu To: John Baldwin Subject: RE: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Thread-Topic: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Thread-Index: AQHPavVn2jiHLJpVI0alLPpTagQEkZwC40GAgABIDUCAA4TJAP//0X+g Date: Wed, 17 Sep 2014 19:16:16 +0000 Message-ID: <49F5640B08EAA94DAF2F6B6145E6A08A0128666B51@AVMB1.qlogic.org> References: <201405081940.s48Jebh5041824@svn.freebsd.org> <54167255.5090806@FreeBSD.org> <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> <1807177.fGkyECExdY@ralph.baldwin.cx> In-Reply-To: <1807177.fGkyECExdY@ralph.baldwin.cx> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.4.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=7564 signatures=670521 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409170159 Cc: "svn-src-head@freebsd.org" , "Andrey V. Elsukov" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , David C Somayajulu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:16:25 -0000 HI John, Thanks for the info. I will go ahead and get rid of "clean" in the Makefil= e. Thanks David S. -----Original Message----- From: John Baldwin [mailto:jhb@freebsd.org] Sent: Wednesday, September 17, 2014 8:02 AM To: David Somayajulu Cc: Andrey V. Elsukov; David C Somayajulu; src-committers@freebsd.org; svn-= src-all@freebsd.org; svn-src-head@freebsd.org Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/= dev/bxe sys/modules/bce On Monday, September 15, 2014 04:31:13 PM David Somayajulu wrote: > Hi Andrey, > When I didn't have the clean override, "make clean" was not cleaning > properly when I built a standalone loadable driver. Perhaps we can > change "clean" in bxe/Makefile and bce/Makefile to "dclean". Try using 'make cleandir' instead of 'make clean'. 'make clean' does not c= lean files created by 'make depend' such as the 'machine' and 'x86' symlink= s. There is a 'make cleandepend' that will clean up such files, but I tend to = use 'make cleandir' which does both. -- John Baldwin ________________________________ This message and any attached documents contain information from QLogic Cor= poration or its wholly-owned subsidiaries that may be confidential. If you = are not the intended recipient, you may not read, copy, distribute, or use = this information. If you have received this transmission in error, please n= otify the sender immediately by reply e-mail and then delete this message. From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:20:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C6377F8; Wed, 17 Sep 2014 19:20:18 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B89A1B8C; Wed, 17 Sep 2014 19:20:17 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8HJK9Nw008282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Sep 2014 22:20:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8HJK9Nw008282 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8HJK93b008280; Wed, 17 Sep 2014 22:20:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Sep 2014 22:20:09 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r271635 - in head: lib/libc/sys sys/vm Message-ID: <20140917192009.GH2161@kib.kiev.ua> References: <201409151720.s8FHKDFs099885@svn.freebsd.org> <54183D4D.3050907@FreeBSD.org> <45601526.3eIXIxKgkH@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YrlhzR9YrZtruaFS" Content-Disposition: inline In-Reply-To: <45601526.3eIXIxKgkH@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , freebsd-java@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:20:18 -0000 --YrlhzR9YrZtruaFS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 17, 2014 at 11:03:29AM -0400, John Baldwin wrote: > On Tuesday, September 16, 2014 04:38:21 PM Andriy Gapon wrote: > > On 15/09/2014 20:20, John Baldwin wrote: > > > Author: jhb > > > Date: Mon Sep 15 17:20:13 2014 > > > New Revision: 271635 > > > URL: http://svnweb.freebsd.org/changeset/base/271635 > > >=20 > > > Log: > > > Add stricter checking of some mmap() arguments: > > > - Fail with EINVAL if an invalid protection mask is passed to mmap(= ). > > > - Fail with EINVAL if an unknown flag is passed to mmap(). > > > - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to > > > mmap(). > > > - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous > > > =20 > > > mappings. > >=20 > > This broke Java, at least java/openjdk7, for me: > >=20 > > 25323 java CALL > > mmap(0,0x3000000,0x3,0x1042 > MAP_ANON>,0xffffffff,0) 25323 java RET mmap -1 errno 22 Invalid > > argument > > 25323 java CALL write(0x1,0x7fffffbfd450,0x2b) > > 25323 java GIO fd 1 wrote 43 bytes > > "Error occurred during initialization of VM > > " > > 25323 java RET write 43/0x2b > > 25323 java CALL write(0x1,0x80209a1e2,0x2d) > > 25323 java GIO fd 1 wrote 45 bytes > > "Could not reserve enough space for code cache" > >=20 > > It seems that MAP_NORESERVE presence could be detected in sys/mman.h and > > then it is used for some reason. > > I guess that the port can be easily fixed, but this commit breaks > > compatibility with older binaries. Perhaps MAP_NORESERVE should be rem= oved > > as well given that we do not actually implement it. >=20 > I've allowed it for now, but I do intend on removing it in 11. I think that the removal procedure should be as follows, in the single commit: 1. remove the defines from public headers, and move them to vm_mmap.c 2. bump __FreeBSD_version 3. allow the bits for older binaries by p_osrel. Might be, a comment in mman.h should be kept for the binary value of MAP_NORESERVE so that person who decide to reuse the bit for a useful flag would be not surprised. --YrlhzR9YrZtruaFS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUGd7oAAoJEJDCuSvBvK1BnIUP/1dZAk7ipEmgmAKNA7RCtcRc j1HCTMkvtFKh+PTtlXDBYlVFOf69EVx6wXsyfkt0EHlJDSH37n5YRiGNFjzYPBdE 3lP8dTWGZsIRBvCDG36ujVsDzqlEhD/K0/HTmUCVwcfkzbXVRJH+fchWbN3zra1s v66Khg3Y2h8vQOLv/4nUf1Nam+u9dVgd61TH4zS2PS88wKo8EOQoKlalJMeO0xIr uuO33eK2p/nGK9bXfsUd5ggDyP99iIbNy639ZTmKQC/eEHF7g1D69kN0Ia3+af+v hz6/uUJAlwLs/lmRTnieMBGQDZCRHR94saj0lf9rcgZZL9kUVjVgzDMAqMfwxEaC mUomkh4k4bJ1bdorQP3l8JML4fh/p3Mdp5kj2NflGz/C7nHBgCd++KWiD6Sk9HZe evomK6bgacKh10dFN8r2hLllfnWsUojawg7sJpHYdVKAE6C3M+M75bXRIFpzdi+/ HbwMwTdqBxZI4orqGujGWSP2cvBgsAS4IRfuOACuvz8Q3TSK5CKdRTlhbnC8lamj zfEeUktLb85v3kAQq6KSnv3TMoLQQMTgw+cBtGO0LdFdJKRlzAAE4lyWaHmVib2K Je80p7wjfDw33Wgh3x2yLrnhtCQm9TrgSCAmoJZFNCtDIWYoJTDadtpdZwGSVPG6 rKWLnhCttRhklgPcZDif =PnEK -----END PGP SIGNATURE----- --YrlhzR9YrZtruaFS-- From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:25:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87C5B9E6; Wed, 17 Sep 2014 19:25:12 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6078DC40; Wed, 17 Sep 2014 19:25:12 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s8HJPBCI097000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Sep 2014 12:25:11 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s8HJPBK9096999; Wed, 17 Sep 2014 12:25:11 -0700 (PDT) (envelope-from jmg) Date: Wed, 17 Sep 2014 12:25:11 -0700 From: John-Mark Gurney To: Glen Barber Subject: Re: svn commit: r271711 - head/usr.sbin/bhyve Message-ID: <20140917192511.GB96798@funkthat.com> References: <201409171645.s8HGjK7l048111@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409171645.s8HGjK7l048111@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 17 Sep 2014 12:25:12 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, grehan@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:25:12 -0000 Glen Barber wrote this message on Wed, Sep 17, 2014 at 16:45 +0000: > Author: gjb > Date: Wed Sep 17 16:45:20 2014 > New Revision: 271711 > URL: http://svnweb.freebsd.org/changeset/base/271711 > > Log: > Update the bhyve(8) manual to reflect that it is no > longer considered 'experimental.' If it's no longer experimental, we should document hardware requirements for it to function in the man page(s)... Like I tried it on my AMD hardware, but it doesn't work because code hasn't been committed... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:37:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED8CFD45; Wed, 17 Sep 2014 19:37:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D981CD44; Wed, 17 Sep 2014 19:37:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HJbwVI031033; Wed, 17 Sep 2014 19:37:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HJbwYf031032; Wed, 17 Sep 2014 19:37:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409171937.s8HJbwYf031032@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Sep 2014 19:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271721 - head/lib/libgeom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:37:59 -0000 Author: jhb Date: Wed Sep 17 19:37:58 2014 New Revision: 271721 URL: http://svnweb.freebsd.org/changeset/base/271721 Log: Explicitly specify MAP_SHARED when mapping the stats file descriptor. Reviewed by: kib MFC after: 1 week Modified: head/lib/libgeom/geom_stats.c Modified: head/lib/libgeom/geom_stats.c ============================================================================== --- head/lib/libgeom/geom_stats.c Wed Sep 17 19:09:58 2014 (r271720) +++ head/lib/libgeom/geom_stats.c Wed Sep 17 19:37:58 2014 (r271721) @@ -68,7 +68,7 @@ geom_stats_resync(void) return; for (;;) { p = mmap(statp, (npages + 1) * pagesize, - PROT_READ, 0, statsfd, 0); + PROT_READ, MAP_SHARED, statsfd, 0); if (p == MAP_FAILED) break; else @@ -90,7 +90,7 @@ geom_stats_open(void) return (errno); pagesize = getpagesize(); spp = pagesize / sizeof(struct devstat); - p = mmap(NULL, pagesize, PROT_READ, 0, statsfd, 0); + p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0); if (p == MAP_FAILED) { error = errno; close(statsfd); From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:45:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5076EF26; Wed, 17 Sep 2014 19:45:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C2C0DFF; Wed, 17 Sep 2014 19:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HJjZe7035410; Wed, 17 Sep 2014 19:45:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HJjZiQ035409; Wed, 17 Sep 2014 19:45:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409171945.s8HJjZiQ035409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 17 Sep 2014 19:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271722 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:45:35 -0000 Author: jhb Date: Wed Sep 17 19:45:34 2014 New Revision: 271722 URL: http://svnweb.freebsd.org/changeset/base/271722 Log: - Remove mention of MAP_INHERIT. It hasn't been implemented for thirteen years. - Remove mention of unimplemented MAP_SWAP. There are no future plans to implement it. Submitted by: alc (2) Modified: head/lib/libc/sys/mmap.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Wed Sep 17 19:37:58 2014 (r271721) +++ head/lib/libc/sys/mmap.2 Wed Sep 17 19:45:34 2014 (r271722) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd September 17, 2014 .Dt MMAP 2 .Os .Sh NAME @@ -176,11 +176,6 @@ already exists within the range. .It Dv MAP_HASSEMAPHORE Notify the kernel that the region may contain semaphores and that special handling may be necessary. -.It Dv MAP_INHERIT -This flag never operated as advertised and is no longer supported. -Please refer to -.Xr minherit 2 -for further information. .It Dv MAP_NOCORE Region is not included in a core file. .It Dv MAP_NOSYNC @@ -300,14 +295,6 @@ The system call does not unmap pages, see .Xr munmap 2 for further information. -.Pp -The current design does not allow a process to specify the location of -swap space. -In the future we may define an additional mapping type, -.Dv MAP_SWAP , -in which -the file descriptor argument specifies a file or device to which swapping -should be done. .Sh NOTES Although this implementation does not impose any alignment restrictions on the From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 19:51:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C3CD17B; Wed, 17 Sep 2014 19:51:46 +0000 (UTC) Received: from mail-qc0-x236.google.com (mail-qc0-x236.google.com [IPv6:2607:f8b0:400d:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75F89EBF; Wed, 17 Sep 2014 19:51:45 +0000 (UTC) Received: by mail-qc0-f182.google.com with SMTP id c9so2879619qcz.41 for ; Wed, 17 Sep 2014 12:51:44 -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-type:content-disposition:in-reply-to:user-agent; bh=dEOECQRSbVqv0nwA3jz28+70KDSvj7x0vgThsJH6WMg=; b=m3RljnrRoqun6I1TuPwR1mhIxyR2EDgISt4hRr2d50qQOQc0Lf3xiO24b02p28xkf0 /JgP1jTtMYU4Nm3SrLZi2Us3mA/gGls+6KQw3RlSdqWohFfcRswssTyfXLVASTkP/JJP vYhyylXRP6qpzhFT+tDy8MEk9jbXrnRe81k+tgeayQmu+Y4dCHGdcPHidke4CTMtA96L YZSJzz5PBJS/TZpogTE2jv8SCMtvn/PL2Mg+gpxTIonFrKJO/tMzuqQ+g31iDGINsZ+r CFwdgkjA7CdsxNxNyBURvfIjn7Yi0GU+XpiR+xxG/z82gwcx3+qFMKcoeHbLzPx97GQM G/+g== X-Received: by 10.224.129.66 with SMTP id n2mr41193224qas.34.1410983504524; Wed, 17 Sep 2014 12:51:44 -0700 (PDT) Received: from ip-172-31-25-62.ec2.internal (ec2-54-85-57-1.compute-1.amazonaws.com. [54.85.57.1]) by mx.google.com with ESMTPSA id a64sm14888881qge.22.2014.09.17.12.51.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 12:51:43 -0700 (PDT) Sender: Mark Johnston Date: Wed, 17 Sep 2014 19:56:23 +0000 From: Mark Johnston To: John Baldwin Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce Message-ID: <20140917195623.GC69638@ip-172-31-25-62.ec2.internal> References: <201405081940.s48Jebh5041824@svn.freebsd.org> <54167255.5090806@FreeBSD.org> <49F5640B08EAA94DAF2F6B6145E6A08A012866587B@AVMB1.qlogic.org> <1807177.fGkyECExdY@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1807177.fGkyECExdY@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , David Somayajulu , "Andrey V. Elsukov" , David C Somayajulu , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 19:51:46 -0000 On Wed, Sep 17, 2014 at 11:02:00AM -0400, John Baldwin wrote: > On Monday, September 15, 2014 04:31:13 PM David Somayajulu wrote: > > Hi Andrey, > > When I didn't have the clean override, "make clean" was not cleaning > > properly when I built a standalone loadable driver. Perhaps we can change > > "clean" in bxe/Makefile and bce/Makefile to "dclean". > > Try using 'make cleandir' instead of 'make clean'. 'make clean' does not > clean files created by 'make depend' such as the 'machine' and 'x86' symlinks. That seems to have changed with r269039. > There is a 'make cleandepend' that will clean up such files, but I tend to use > 'make cleandir' which does both. From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 20:12:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5367BA3A; Wed, 17 Sep 2014 20:12:32 +0000 (UTC) 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 2A6AF1FA; Wed, 17 Sep 2014 20:12:32 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1F328B97E; Wed, 17 Sep 2014 16:12:31 -0400 (EDT) From: John Baldwin To: Peter Holm Subject: Re: svn commit: r271635 - in head: lib/libc/sys sys/vm Date: Wed, 17 Sep 2014 15:41:16 -0400 Message-ID: <2228211.yDuTk5oHyL@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140916100009.GA96375@x2.osted.lan> References: <201409151720.s8FHKDFs099885@svn.freebsd.org> <20140916100009.GA96375@x2.osted.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Sep 2014 16:12:31 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 20:12:32 -0000 On Tuesday, September 16, 2014 12:00:09 PM Peter Holm wrote: > On Mon, Sep 15, 2014 at 05:20:13PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Mon Sep 15 17:20:13 2014 > > New Revision: 271635 > > URL: http://svnweb.freebsd.org/changeset/base/271635 > > > > Log: > > Add stricter checking of some mmap() arguments: > > - Fail with EINVAL if an invalid protection mask is passed to mmap(). > > - Fail with EINVAL if an unknown flag is passed to mmap(). > > - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to > > mmap(). > > - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous > > > > mappings. > > > > Reviewed by: alc, kib > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D698 > > > > Modified: > > head/lib/libc/sys/mmap.2 > > head/sys/vm/vm_mmap.c > > I'm seem to have mdconfig(8) issues with this commit. > /dev/md* appear to linger. I've just committed a fix to libgeom that fixes both mdconfig -l and gstat. Konstantin has a a fix to allow older binaries to still work that he will commit shortly. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 20:12:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03E48A3B; Wed, 17 Sep 2014 20:12:33 +0000 (UTC) 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 CC7991FC; Wed, 17 Sep 2014 20:12:32 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D3DF0B985; Wed, 17 Sep 2014 16:12:31 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r271635 - in head: lib/libc/sys sys/vm Date: Wed, 17 Sep 2014 15:40:09 -0400 Message-ID: <8290503.DSlOKmYch9@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140917192009.GH2161@kib.kiev.ua> References: <201409151720.s8FHKDFs099885@svn.freebsd.org> <45601526.3eIXIxKgkH@ralph.baldwin.cx> <20140917192009.GH2161@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Sep 2014 16:12:31 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , freebsd-java@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 20:12:33 -0000 On Wednesday, September 17, 2014 10:20:09 PM Konstantin Belousov wrote: > On Wed, Sep 17, 2014 at 11:03:29AM -0400, John Baldwin wrote: > > On Tuesday, September 16, 2014 04:38:21 PM Andriy Gapon wrote: > > > On 15/09/2014 20:20, John Baldwin wrote: > > > > Author: jhb > > > > Date: Mon Sep 15 17:20:13 2014 > > > > New Revision: 271635 > > > > URL: http://svnweb.freebsd.org/changeset/base/271635 > > > > > > > > Log: > > > > Add stricter checking of some mmap() arguments: > > > > - Fail with EINVAL if an invalid protection mask is passed to > > > > mmap(). > > > > - Fail with EINVAL if an unknown flag is passed to mmap(). > > > > - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to > > > > mmap(). > > > > - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous > > > > > > > > mappings. > > > > > > This broke Java, at least java/openjdk7, for me: > > > 25323 java CALL > > > > > > mmap(0,0x3000000,0x3,0x1042 > > RVE| MAP_ANON>,0xffffffff,0) 25323 java RET mmap -1 errno 22 > > > Invalid argument > > > > > > 25323 java CALL write(0x1,0x7fffffbfd450,0x2b) > > > 25323 java GIO fd 1 wrote 43 bytes > > > > > > "Error occurred during initialization of VM > > > " > > > > > > 25323 java RET write 43/0x2b > > > 25323 java CALL write(0x1,0x80209a1e2,0x2d) > > > 25323 java GIO fd 1 wrote 45 bytes > > > > > > "Could not reserve enough space for code cache" > > > > > > It seems that MAP_NORESERVE presence could be detected in sys/mman.h and > > > then it is used for some reason. > > > I guess that the port can be easily fixed, but this commit breaks > > > compatibility with older binaries. Perhaps MAP_NORESERVE should be > > > removed > > > as well given that we do not actually implement it. > > > > I've allowed it for now, but I do intend on removing it in 11. > > I think that the removal procedure should be as follows, in the single > commit: > 1. remove the defines from public headers, and move them to vm_mmap.c > 2. bump __FreeBSD_version > 3. allow the bits for older binaries by p_osrel. > > Might be, a comment in mman.h should be kept for the binary value > of MAP_NORESERVE so that person who decide to reuse the bit for > a useful flag would be not surprised. Yes, I had used MAP_UNUSED0020 similar to what was done for MAP_INHERIT and exactly this (P_OSREL_MAP_RENAME, etc.). Once the other fixes settle in I will publish this for review and also request an exp-run from ports so we can patch things to remove MAP_NORESERVE before this is committed. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 20:26:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37926F08; Wed, 17 Sep 2014 20:26:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22B4333D; Wed, 17 Sep 2014 20:26:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HKQSDJ054430; Wed, 17 Sep 2014 20:26:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HKQR8c054429; Wed, 17 Sep 2014 20:26:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409172026.s8HKQR8c054429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Sep 2014 20:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271723 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 20:26:28 -0000 Author: bdrewery Date: Wed Sep 17 20:26:27 2014 New Revision: 271723 URL: http://svnweb.freebsd.org/changeset/base/271723 Log: Explicitly set MAP_PRIVATE to avoid [EINVAL] after r271635. X-MFC-With: r271635 Reviewed by: jhb Modified: head/lib/libc/gen/nlist.c Modified: head/lib/libc/gen/nlist.c ============================================================================== --- head/lib/libc/gen/nlist.c Wed Sep 17 19:45:34 2014 (r271722) +++ head/lib/libc/gen/nlist.c Wed Sep 17 20:26:27 2014 (r271723) @@ -268,7 +268,7 @@ __elf_fdnlist(fd, list) } /* mmap section header table */ - base = mmap(NULL, (size_t)shdr_size, PROT_READ, 0, fd, + base = mmap(NULL, (size_t)shdr_size, PROT_READ, MAP_PRIVATE, fd, (off_t)ehdr.e_shoff); if (base == MAP_FAILED) return (-1); @@ -301,7 +301,7 @@ __elf_fdnlist(fd, list) * making the memory allocation permanent as with malloc/free * (i.e., munmap will return it to the system). */ - base = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd, + base = mmap(NULL, (size_t)symstrsize, PROT_READ, MAP_PRIVATE, fd, (off_t)symstroff); if (base == MAP_FAILED) goto done; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 20:43:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63566877; Wed, 17 Sep 2014 20:43:29 +0000 (UTC) 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 391FD7B3; Wed, 17 Sep 2014 20:43:29 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9370BB923; Wed, 17 Sep 2014 16:43:27 -0400 (EDT) From: John Baldwin To: Bryan Drewery Subject: Re: svn commit: r271723 - head/lib/libc/gen Date: Wed, 17 Sep 2014 16:41:55 -0400 Message-ID: <6559530.tHdbAo7x4l@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409172026.s8HKQR8c054429@svn.freebsd.org> References: <201409172026.s8HKQR8c054429@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Sep 2014 16:43:27 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 20:43:29 -0000 On Wednesday, September 17, 2014 08:26:27 PM Bryan Drewery wrote: > Author: bdrewery > Date: Wed Sep 17 20:26:27 2014 > New Revision: 271723 > URL: http://svnweb.freebsd.org/changeset/base/271723 > > Log: > Explicitly set MAP_PRIVATE to avoid [EINVAL] after r271635. > > X-MFC-With: r271635 At this point, I will probably only merge a selective part. In particular, I will merge all the manpage updates so people who check the manpage will have a heads up, but I will probably not merge the one check that requires this since we are only going to enforce that for 11.0 on. (I will merge at least the failure for setting both SHARED and PRIVATE.) That said, you can merge this fix at any time as it will work fine with older kernels. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 21:04:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 320CFD78; Wed, 17 Sep 2014 21:04:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03AC39AD; Wed, 17 Sep 2014 21:04:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HL4op9073293; Wed, 17 Sep 2014 21:04:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HL4odQ073291; Wed, 17 Sep 2014 21:04:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409172104.s8HL4odQ073291@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Sep 2014 21:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271724 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 21:04:51 -0000 Author: kib Date: Wed Sep 17 21:04:50 2014 New Revision: 271724 URL: http://svnweb.freebsd.org/changeset/base/271724 Log: The vm_mmap_cdev() explicitely converts absence of both MAP_SHARED and MAP_PRIVATE flags to MAP_SHARED. Apparently, some code in tree, in particular, libgeom, relied on this behaviour, see r271721. For regular file types, the absence of the flags is interpreted as MAP_PRIVATE, and libc nlist used this (fixed in r271723). Allow the implicit flags for legacy binaries. Bump __FreeBSD_version to get the ABI note on new binaries to check for in mmap code. Remove the test for presence of one of the MAP_ANON, MAP_SHARED or MAP_PRIVATE flags before fget_mmap(). For MAP_ANON, we already verify that passed fd == -1. For fd != -1, test after fget_mmap() (for newer binaries) covers the case. Reported by: bdrewery, pho Reviewed by: jhb Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/param.h head/sys/vm/vm_mmap.c Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Sep 17 20:26:27 2014 (r271723) +++ head/sys/sys/param.h Wed Sep 17 21:04:50 2014 (r271724) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100035 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100036 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, @@ -80,6 +80,7 @@ #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 +#define P_OSREL_MAP_FSTRICT 1100036 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed Sep 17 20:26:27 2014 (r271723) +++ head/sys/vm/vm_mmap.c Wed Sep 17 21:04:50 2014 (r271724) @@ -254,8 +254,7 @@ sys_mmap(td, uap) return (EINVAL); if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) return (EINVAL); - if ((flags & (MAP_ANON | MAP_SHARED | MAP_PRIVATE)) == 0 || - (flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE)) + if ((flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE)) return (EINVAL); if (prot != PROT_NONE && (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) @@ -356,6 +355,11 @@ sys_mmap(td, uap) error = fget_mmap(td, uap->fd, &rights, &cap_maxprot, &fp); if (error != 0) goto done; + if ((flags & (MAP_SHARED | MAP_PRIVATE)) == 0 && + td->td_proc->p_osrel >= P_OSREL_MAP_FSTRICT) { + error = EINVAL; + goto done; + } if (fp->f_type == DTYPE_SHM) { handle = fp->f_data; handle_type = OBJT_SWAP; From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 22:11:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8473A79D; Wed, 17 Sep 2014 22:11:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F34E1000; Wed, 17 Sep 2014 22:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HMBLnT008318; Wed, 17 Sep 2014 22:11:21 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HMBKVW008309; Wed, 17 Sep 2014 22:11:20 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409172211.s8HMBKVW008309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Sep 2014 22:11: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: r271725 - stable/10/sys/dev/bxe 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 22:11:21 -0000 Author: davidcs Date: Wed Sep 17 22:11:20 2014 New Revision: 271725 URL: http://svnweb.freebsd.org/changeset/base/271725 Log: MFC r268854 Initiate error recovery stats fail to update after 3 retries. Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to panic only if ECORE_STOP_ON_ERROR is defined. Approved by: re(gjb) Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe.h stable/10/sys/dev/bxe/bxe_stats.c stable/10/sys/dev/bxe/ecore_reg.h stable/10/sys/dev/bxe/ecore_sp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/bxe.c Wed Sep 17 22:11:20 2014 (r271725) @@ -11478,6 +11478,10 @@ bxe_process_kill(struct bxe_softc *sc, bxe_process_kill_chip_reset(sc, global); mb(); + /* clear errors in PGB */ + if (!CHIP_IS_E1(sc)) + REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); + /* Recover after reset: */ /* MCP */ if (global && bxe_reset_mcp_comp(sc, val)) { Modified: stable/10/sys/dev/bxe/bxe.h ============================================================================== --- stable/10/sys/dev/bxe/bxe.h Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/bxe.h Wed Sep 17 22:11:20 2014 (r271725) @@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bx } \ } while(0) +#ifdef ECORE_STOP_ON_ERROR + #define bxe_panic(sc, msg) \ do { \ panic msg; \ } while (0) +#else + +#define bxe_panic(sc, msg) \ + device_printf((sc)->dev, "%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#endif + #define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data)); #define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe) Modified: stable/10/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.c Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/bxe_stats.c Wed Sep 17 22:11:20 2014 (r271725) @@ -1306,7 +1306,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { - bxe_panic(sc, ("storm stats not updated for 3 times\n")); + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + } } return; } Modified: stable/10/sys/dev/bxe/ecore_reg.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_reg.h Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/ecore_reg.h Wed Sep 17 22:11:20 2014 (r271725) @@ -1039,6 +1039,8 @@ __FBSDID("$FreeBSD$"); 0x942cUL #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \ 0x9430UL +#define PGLUE_B_REG_LATCHED_ERRORS_CLR \ + 0x943CUL #define PGLUE_B_REG_PGLUE_B_INT_STS \ 0x9298UL #define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \ Modified: stable/10/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_sp.h Wed Sep 17 21:04:50 2014 (r271724) +++ stable/10/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:11:20 2014 (r271725) @@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #define ecore_sp_post(_sc, _a, _b, _c, _d) \ bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d) +#ifdef ECORE_STOP_ON_ERROR + #define ECORE_DBG_BREAK_IF(exp) \ do { \ if (__predict_false(exp)) { \ @@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m } \ } while (0) +#else + +#define ECORE_DBG_BREAK_IF(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG_ON(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + + +#endif /* #ifdef ECORE_STOP_ON_ERROR */ + #define ECORE_ERR(str, ...) \ BLOGE(sc, "ECORE: " str, ##__VA_ARGS__) From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 22:18:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21CB1986; Wed, 17 Sep 2014 22:18:55 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id D5EA7CF; Wed, 17 Sep 2014 22:18:54 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 27C0612698; Thu, 18 Sep 2014 08:18:52 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local ([64.245.0.210]) by dommail.onthenet.com.au (MOS 4.4.4-GA) with ESMTP id BYK70363 (AUTH peterg@ptree32.com.au); Thu, 18 Sep 2014 08:18:50 +1000 Message-ID: <541A08C8.50909@freebsd.org> Date: Wed, 17 Sep 2014 15:18:48 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: John-Mark Gurney Subject: Re: svn commit: r271711 - head/usr.sbin/bhyve References: <201409171645.s8HGjK7l048111@svn.freebsd.org> <20140917192511.GB96798@funkthat.com> In-Reply-To: <20140917192511.GB96798@funkthat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 22:18:55 -0000 >> Update the bhyve(8) manual to reflect that it is no >> longer considered 'experimental.' > > If it's no longer experimental, we should document hardware > requirements for it to function in the man page(s)... I'll get a phabric review going for this. > Like I tried it on my AMD hardware, but it doesn't work because code hasn't been > committed... I think you mean, not yet merged to CURRENT from the bhyve_svm branch :) later, Peter. From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 22:24:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D081DB83; Wed, 17 Sep 2014 22:24:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC1BE197; Wed, 17 Sep 2014 22:24:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HMOpUx013573; Wed, 17 Sep 2014 22:24:51 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HMOpWP013572; Wed, 17 Sep 2014 22:24:51 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409172224.s8HMOpWP013572@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Sep 2014 22:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271726 - head/sys/modules/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 22:24:51 -0000 Author: davidcs Date: Wed Sep 17 22:24:51 2014 New Revision: 271726 URL: http://svnweb.freebsd.org/changeset/base/271726 Log: Remove clean option MFC after:5 days Modified: head/sys/modules/bxe/Makefile Modified: head/sys/modules/bxe/Makefile ============================================================================== --- head/sys/modules/bxe/Makefile Wed Sep 17 22:11:20 2014 (r271725) +++ head/sys/modules/bxe/Makefile Wed Sep 17 22:24:51 2014 (r271726) @@ -18,9 +18,4 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 - .include From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 22:26:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16EC8CCD; Wed, 17 Sep 2014 22:26:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0250619F; Wed, 17 Sep 2014 22:26:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HMQ1YG013802; Wed, 17 Sep 2014 22:26:01 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HMQ16m013801; Wed, 17 Sep 2014 22:26:01 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409172226.s8HMQ16m013801@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Sep 2014 22:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271727 - head/sys/modules/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 22:26:02 -0000 Author: davidcs Date: Wed Sep 17 22:26:01 2014 New Revision: 271727 URL: http://svnweb.freebsd.org/changeset/base/271727 Log: Remove clean option MFC after:5 days Modified: head/sys/modules/bce/Makefile Modified: head/sys/modules/bce/Makefile ============================================================================== --- head/sys/modules/bce/Makefile Wed Sep 17 22:24:51 2014 (r271726) +++ head/sys/modules/bce/Makefile Wed Sep 17 22:26:01 2014 (r271727) @@ -5,9 +5,4 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h - .include From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 22:49:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D475218; Wed, 17 Sep 2014 22:49:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88ED53BB; Wed, 17 Sep 2014 22:49:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8HMnTUj023476; Wed, 17 Sep 2014 22:49:29 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8HMnTd5023475; Wed, 17 Sep 2014 22:49:29 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409172249.s8HMnTd5023475@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Sep 2014 22:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271728 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 22:49:29 -0000 Author: davidcs Date: Wed Sep 17 22:49:29 2014 New Revision: 271728 URL: http://svnweb.freebsd.org/changeset/base/271728 Log: For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message. MFC after:5 days Modified: head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:26:01 2014 (r271727) +++ head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:49:29 2014 (r271728) @@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #else +extern unsigned long bxe_debug; + +#define BXE_DEBUG_ECORE_DBG_BREAK_IF 0x01 +#define BXE_DEBUG_ECORE_BUG 0x02 +#define BXE_DEBUG_ECORE_BUG_ON 0x04 + #define ECORE_DBG_BREAK_IF(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_DBG_BREAK_IF) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG_ON(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG_ON) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #endif /* #ifdef ECORE_STOP_ON_ERROR */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 17 23:24:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E32F76F3; Wed, 17 Sep 2014 23:24:33 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE5B98E9; Wed, 17 Sep 2014 23:24:33 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s8HNOVP5000295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Sep 2014 16:24:32 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s8HNOV4H000294; Wed, 17 Sep 2014 16:24:31 -0700 (PDT) (envelope-from jmg) Date: Wed, 17 Sep 2014 16:24:31 -0700 From: John-Mark Gurney To: Peter Grehan Subject: Re: svn commit: r271711 - head/usr.sbin/bhyve Message-ID: <20140917232431.GG96798@funkthat.com> References: <201409171645.s8HGjK7l048111@svn.freebsd.org> <20140917192511.GB96798@funkthat.com> <541A08C8.50909@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <541A08C8.50909@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 17 Sep 2014 16:24:32 -0700 (PDT) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 17 Sep 2014 23:24:34 -0000 Peter Grehan wrote this message on Wed, Sep 17, 2014 at 15:18 -0700: > >> Update the bhyve(8) manual to reflect that it is no > >> longer considered 'experimental.' > > > >If it's no longer experimental, we should document hardware > >requirements for it to function in the man page(s)... > > I'll get a phabric review going for this. Thanks. > >Like I tried it on my AMD hardware, but it doesn't work because code > >hasn't been > >committed... > > I think you mean, not yet merged to CURRENT from the bhyve_svm branch :) I continue to think that until things are in HEAD/CURRENT, that they haven't been committed.. :) Though they happen to be in svn, they aren't committed to HEAD.. /me can't wait to start testing. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 01:24:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D238B763; Thu, 18 Sep 2014 01:24:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC543371; Thu, 18 Sep 2014 01:24:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I1Of6V098015; Thu, 18 Sep 2014 01:24:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I1OfP3098013; Thu, 18 Sep 2014 01:24:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409180124.s8I1OfP3098013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Sep 2014 01:24: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: r271729 - in stable/10/contrib/llvm: patches tools/clang/lib/CodeGen 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 01:24:42 -0000 Author: emaste Date: Thu Sep 18 01:24:40 2014 New Revision: 271729 URL: http://svnweb.freebsd.org/changeset/base/271729 Log: MFC Clang debuginfo crash fix r271432: Merge upstream Clang rev 205331 debuginfo crash fix: Debug info: fix a crash when emitting IndirectFieldDecls, which were previously not handled at all. rdar://problem/16348575 r271433: Add clang patch corresponding to r271432 Approved by: re Sponsored by: DARPA, AFRL Added: stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff - copied unchanged from r271433, head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff (from r271433, head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff Thu Sep 18 01:24:40 2014 (r271729, copy of r271433, head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff) @@ -0,0 +1,46 @@ +commit 96365aef99ec463375dfdaf6eb260823e0477b6a +Author: Adrian Prantl +Date: Tue Apr 1 17:52:06 2014 +0000 + + Debug info: fix a crash when emitting IndirectFieldDecls, which were + previously not handled at all. + rdar://problem/16348575 + + git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205331 91177308-0d34-0410-b5e6-96231b3b80d8 + +diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp +index 82db942..2556cf9 100644 +--- tools/clang/lib/CodeGen/CGDebugInfo.cpp ++++ tools/clangb/lib/CodeGen/CGDebugInfo.cpp +@@ -1252,7 +1252,7 @@ CollectTemplateParams(const TemplateParameterList *TPList, + V = CGM.GetAddrOfFunction(FD); + // Member data pointers have special handling too to compute the fixed + // offset within the object. +- if (isa(D)) { ++ if (isa(D) || isa(D)) { + // These five lines (& possibly the above member function pointer + // handling) might be able to be refactored to use similar code in + // CodeGenModule::getMemberPointerConstant +diff --git a/test/CodeGenCXX/debug-info-indirect-field-decl.cpp b/test/CodeGenCXX/debug-info-indirect-field-decl.cpp +new file mode 100644 +index 0000000..131ceba +--- /dev/null ++++ tools/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp +@@ -0,0 +1,17 @@ ++// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s ++// ++// Test that indirect field decls are handled gracefully. ++// rdar://problem/16348575 ++// ++template class Foo { }; ++ ++struct Bar { ++ int i1; ++ // CHECK: [ DW_TAG_member ] [line [[@LINE+1]], size 32, align 32, offset 32] [from _ZTSN3BarUt_E] ++ union { ++ // CHECK: [ DW_TAG_member ] [i2] [line [[@LINE+1]], size 32, align 32, offset 0] [from int] ++ int i2; ++ }; ++}; ++ ++Foo the_foo; Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Wed Sep 17 22:49:29 2014 (r271728) +++ stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Thu Sep 18 01:24:40 2014 (r271729) @@ -1241,7 +1241,7 @@ CollectTemplateParams(const TemplatePara V = CGM.GetAddrOfFunction(FD); // Member data pointers have special handling too to compute the fixed // offset within the object. - if (isa(D)) { + if (isa(D) || isa(D)) { // These five lines (& possibly the above member function pointer // handling) might be able to be refactored to use similar code in // CodeGenModule::getMemberPointerConstant From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 01:57:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6495D2D; Thu, 18 Sep 2014 01:57:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B23B6841; Thu, 18 Sep 2014 01:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I1vav6012060; Thu, 18 Sep 2014 01:57:36 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I1vatC012059; Thu, 18 Sep 2014 01:57:36 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409180157.s8I1vatC012059@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 01:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271730 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 01:57:36 -0000 Author: will Date: Thu Sep 18 01:57:36 2014 New Revision: 271730 URL: http://svnweb.freebsd.org/changeset/base/271730 Log: Root the lib32 object tree under the overall object tree. This enables a common root directory for all object files for a given tree, which eases sharing a common MAKEOBJDIRPREFIX, and cleaning up of object trees. In particular, one can simply (from the source directory) rm -rf /usr/obj$(pwd) to destroy all object files for it. Or to copy/sync files, etc. Reviewed by: bdrewery CR: https://reviews.freebsd.org/D796 MFC after: 1 month Sponsored by: Spectra Logic Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Sep 18 01:24:40 2014 (r271729) +++ head/Makefile.inc1 Thu Sep 18 01:57:36 2014 (r271730) @@ -352,6 +352,7 @@ WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAG .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" # 32 bit world +LIB32_OBJTREE= ${OBJTREE}${.CURDIR}/world32 LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 .if ${TARGET_ARCH} == "amd64" @@ -387,7 +388,7 @@ LIB32FLAGS+= --sysroot=${WORLDTMP} .endif # Yes, the flags are redundant. -LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ +LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \ _SHLIBDIRPREFIX=${LIB32TMP} \ _LDSCRIPTROOT=${LIB32TMP} \ VERSION="${VERSION}" \ @@ -611,7 +612,7 @@ build32: cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ - MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ + MAKEOBJDIRPREFIX=${LIB32_OBJTREE} ${MAKE} SSP_CFLAGS= DESTDIR= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ build-tools .endfor From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 02:01:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCA8BECF; Thu, 18 Sep 2014 02:01:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCD9786F; Thu, 18 Sep 2014 02:01:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I21a2d014237; Thu, 18 Sep 2014 02:01:36 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I21aHs014235; Thu, 18 Sep 2014 02:01:36 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409180201.s8I21aHs014235@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 02:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271731 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 02:01:37 -0000 Author: will Date: Thu Sep 18 02:01:36 2014 New Revision: 271731 URL: http://svnweb.freebsd.org/changeset/base/271731 Log: Fix a kernel panic when unloading isp(4). In the current implementation, the isp_kthread() threads never exit. The target threads do have an exit mode from isp_attach(), but it is not invoked from isp_detach(). Ensure isp_detach() notifies threads started for each channel, such that they exit before their parent device softc detaches, and thus before the module does. Otherwise, a page fault panic occurs later in: sysctl_kern_proc sysctl_out_proc kern_proc_out fill_kinfo_proc fill_kinfo_thread strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); For isp_kthread() (and isp(4) target threads), td->td_wmesg references now-unmapped memory after the module has been unloaded. These threads are typically msleep()ing at the time of unload, but they could also attempt to execute now-unmapped code segments. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: r1070921 on 2014/06/22 13:01:17 Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Thu Sep 18 01:57:36 2014 (r271730) +++ head/sys/dev/isp/isp_freebsd.c Thu Sep 18 02:01:36 2014 (r271731) @@ -132,6 +132,7 @@ isp_attach_chan(ispsoftc_t *isp, struct ISP_SET_PC(isp, chan, proc_active, 0); isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); } + ISP_SPI_PC(isp, chan)->num_threads += 1; #endif } else { fcparam *fcp = FCPARAM(isp, chan); @@ -167,12 +168,14 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_sim_free(fc->sim, FALSE); return (ENOMEM); } + ISP_FC_PC(isp, chan)->num_threads += 1; #ifdef ISP_INTERNAL_TARGET ISP_SET_PC(isp, chan, proc_active, 1); if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { ISP_SET_PC(isp, chan, proc_active, 0); isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); } + ISP_FC_PC(isp, chan)->num_threads += 1; #endif if (chan == 0) { struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(isp->isp_osinfo.dev); @@ -189,6 +192,47 @@ isp_attach_chan(ispsoftc_t *isp, struct return (0); } +static void +isp_detach_internal_target(ispsoftc_t *isp, int chan) +{ +#ifdef ISP_INTERNAL_TARGET + void *wchan; + + ISP_GET_PC(isp, chan, target_proc, wchan); + ISP_SET_PC(isp, chan, proc_active, 0); + wakeup(wchan); +#endif +} + +static void +isp_detach_chan(ispsoftc_t *isp, int chan) +{ + struct cam_sim *sim; + struct cam_path *path; + struct ccb_setasync csa; + int *num_threads; + + ISP_GET_PC(isp, chan, sim, sim); + ISP_GET_PC(isp, chan, path, path); + ISP_GET_PC_ADDR(isp, chan, num_threads, num_threads); + + xpt_setup_ccb(&csa.ccb_h, path, 5); + csa.ccb_h.func_code = XPT_SASYNC_CB; + csa.event_enable = 0; + csa.callback = isp_cam_async; + csa.callback_arg = sim; + xpt_action((union ccb *)&csa); + xpt_free_path(path); + xpt_bus_deregister(cam_sim_path(sim)); + cam_sim_free(sim, FALSE); + + /* Wait for the channel's spawned threads to exit. */ + wakeup(isp->isp_osinfo.pc.ptr); + isp_detach_internal_target(isp, chan); + while (*num_threads != 0) + mtx_sleep(isp, &isp->isp_osinfo.lock, PRIBIO, "isp_reap", 100); +} + int isp_attach(ispsoftc_t *isp) { @@ -239,13 +283,9 @@ unwind: while (--chan >= 0) { struct cam_sim *sim; struct cam_path *path; - if (IS_FC(isp)) { - sim = ISP_FC_PC(isp, chan)->sim; - path = ISP_FC_PC(isp, chan)->path; - } else { - sim = ISP_SPI_PC(isp, chan)->sim; - path = ISP_SPI_PC(isp, chan)->path; - } + + ISP_GET_PC(isp, chan, sim, sim); + ISP_GET_PC(isp, chan, path, path); xpt_free_path(path); ISP_LOCK(isp); xpt_bus_deregister(cam_sim_path(sim)); @@ -269,49 +309,26 @@ int isp_detach(ispsoftc_t *isp) { struct cam_sim *sim; - struct cam_path *path; - struct ccb_setasync csa; int chan; ISP_LOCK(isp); for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) { - if (IS_FC(isp)) { - sim = ISP_FC_PC(isp, chan)->sim; - path = ISP_FC_PC(isp, chan)->path; - } else { - sim = ISP_SPI_PC(isp, chan)->sim; - path = ISP_SPI_PC(isp, chan)->path; - } + ISP_GET_PC(isp, chan, sim, sim); if (sim->refcount > 2) { ISP_UNLOCK(isp); return (EBUSY); } } + /* Tell spawned threads that we're exiting. */ + isp->isp_osinfo.is_exiting = 1; if (isp->isp_osinfo.timer_active) { callout_stop(&isp->isp_osinfo.tmo); isp->isp_osinfo.timer_active = 0; } - for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) { - if (IS_FC(isp)) { - sim = ISP_FC_PC(isp, chan)->sim; - path = ISP_FC_PC(isp, chan)->path; - } else { - sim = ISP_SPI_PC(isp, chan)->sim; - path = ISP_SPI_PC(isp, chan)->path; - } - xpt_setup_ccb(&csa.ccb_h, path, 5); - csa.ccb_h.func_code = XPT_SASYNC_CB; - csa.event_enable = 0; - csa.callback = isp_cam_async; - csa.callback_arg = sim; - ISP_LOCK(isp); - xpt_action((union ccb *)&csa); - ISP_UNLOCK(isp); - xpt_free_path(path); - xpt_bus_deregister(cam_sim_path(sim)); - cam_sim_free(sim, FALSE); - } + for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) + isp_detach_chan(isp, chan); ISP_UNLOCK(isp); + if (isp->isp_osinfo.cdev) { destroy_dev(isp->isp_osinfo.cdev); isp->isp_osinfo.cdev = NULL; @@ -4225,7 +4242,7 @@ isp_target_thread(ispsoftc_t *isp, int c /* * Add resources */ - ISP_GET_PC_ADDR(isp, chan, target_proc, wchan); + ISP_GET_PC(isp, chan, target_proc, wchan); for (i = 0; i < 4; i++) { ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); xpt_setup_ccb(&ccb->ccb_h, wperiph->path, 1); @@ -4313,14 +4330,24 @@ static void isp_target_thread_pi(void *arg) { struct isp_spi *pi = arg; - isp_target_thread(cam_sim_softc(pi->sim), cam_sim_bus(pi->sim)); + ispsoftc_t *isp = cam_sim_softc(pi->sim); + int chan = cam_sim_bus(pi->sim); + + isp_target_thread(isp, chan); + ISP_SPI_PC(isp, chan)->num_threads -= 1; + kthread_exit(); } static void isp_target_thread_fc(void *arg) { struct isp_fc *fc = arg; - isp_target_thread(cam_sim_softc(fc->sim), cam_sim_bus(fc->sim)); + ispsoftc_t *isp = cam_sim_softc(pi->sim); + int chan = cam_sim_bus(pi->sim); + + isp_target_thread(isp, chan); + ISP_FC_PC(isp, chan)->num_threads -= 1; + kthread_exit(); } static int @@ -4748,7 +4775,7 @@ isp_kthread(void *arg) mtx_lock(&isp->isp_osinfo.lock); - for (;;) { + while (isp->isp_osinfo.is_exiting == 0) { int lb, lim; isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d checking FC state", __func__, chan); @@ -4844,7 +4871,9 @@ isp_kthread(void *arg) mtx_lock(&isp->isp_osinfo.lock); } } + fc->num_threads -= 1; mtx_unlock(&isp->isp_osinfo.lock); + kthread_exit(); } static void Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Thu Sep 18 01:57:36 2014 (r271730) +++ head/sys/dev/isp/isp_freebsd.h Thu Sep 18 02:01:36 2014 (r271731) @@ -268,6 +268,7 @@ struct isp_fc { unsigned int inject_lost_data_frame; #endif #endif + int num_threads; }; struct isp_spi { @@ -291,6 +292,7 @@ struct isp_spi { struct proc * target_proc; #endif #endif + int num_threads; }; struct isposinfo { @@ -365,6 +367,8 @@ struct isposinfo { struct isp_spi *spi; void *ptr; } pc; + + int is_exiting; }; #define ISP_FC_PC(isp, chan) (&(isp)->isp_osinfo.pc.fc[(chan)]) #define ISP_SPI_PC(isp, chan) (&(isp)->isp_osinfo.pc.spi[(chan)]) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 02:12:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4C29175; Thu, 18 Sep 2014 02:12:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94F779CC; Thu, 18 Sep 2014 02:12:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I2CnnT020841; Thu, 18 Sep 2014 02:12:49 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I2CmTp020837; Thu, 18 Sep 2014 02:12:48 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201409180212.s8I2CmTp020837@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 18 Sep 2014 02:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271732 - in head: sbin/ifconfig share/man/man4 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 02:12:49 -0000 Author: araujo (ports committer) Date: Thu Sep 18 02:12:48 2014 New Revision: 271732 URL: http://svnweb.freebsd.org/changeset/base/271732 Log: Add laggproto broadcast, it allows sends frames to all ports of the lagg(4) group and receives frames on any port of the lagg(4). Phabric: D549 Reviewed by: glebius, thompsa Approved by: glebius Obtained from: OpenBSD Sponsored by: QNAP Systems Inc. Modified: head/sbin/ifconfig/ifconfig.8 head/share/man/man4/lagg.4 head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Thu Sep 18 02:01:36 2014 (r271731) +++ head/sbin/ifconfig/ifconfig.8 Thu Sep 18 02:12:48 2014 (r271732) @@ -2332,8 +2332,8 @@ from the aggregation interface. .It Cm laggproto Ar proto Set the aggregation protocol. The default is failover. -The available options are failover, fec, lacp, loadbalance, roundrobin and -none. +The available options are failover, fec, lacp, loadbalance, roundrobin, broadcast +and none. .It Cm lagghash Ar option Ns Oo , Ns Ar option Oc Set the packet layers to hash for aggregation protocols which load balance. The default is Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Thu Sep 18 02:01:36 2014 (r271731) +++ head/share/man/man4/lagg.4 Thu Sep 18 02:12:48 2014 (r271732) @@ -65,6 +65,7 @@ The driver currently supports the aggreg .Ic lacp , .Ic loadbalance , .Ic roundrobin , +.Ic broadcast , and .Ic none . The protocols determine which ports are used for outgoing traffic @@ -113,6 +114,9 @@ available, the VLAN tag, and the IP sour Distributes outgoing traffic using a round-robin scheduler through all active ports and accepts incoming traffic from any active port. +.It Ic broadcast +Sends frames to all ports of the LAG and receives frames on +any port of the LAG. .It Ic none This protocol is intended to do nothing: it disables any traffic without disabling the Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Sep 18 02:01:36 2014 (r271731) +++ head/sys/net/if_lagg.c Thu Sep 18 02:12:48 2014 (r271732) @@ -3,6 +3,7 @@ /* * Copyright (c) 2005, 2006 Reyk Floeter * Copyright (c) 2007 Andrew Thompson + * Copyright (c) 2014 Marcelo Araujo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -147,6 +148,13 @@ static struct mbuf *lagg_lb_input(struct struct mbuf *); static int lagg_lb_porttable(struct lagg_softc *, struct lagg_port *); +/* Broadcast */ +static int lagg_bcast_attach(struct lagg_softc *); +static int lagg_bcast_detach(struct lagg_softc *); +static int lagg_bcast_start(struct lagg_softc *, struct mbuf *); +static struct mbuf *lagg_bcast_input(struct lagg_softc *, struct lagg_port *, + struct mbuf *); + /* 802.3ad LACP */ static int lagg_lacp_attach(struct lagg_softc *); static int lagg_lacp_detach(struct lagg_softc *); @@ -163,10 +171,11 @@ static const struct { int (*ti_attach)(struct lagg_softc *); } lagg_protos[] = { { LAGG_PROTO_ROUNDROBIN, lagg_rr_attach }, - { LAGG_PROTO_FAILOVER, lagg_fail_attach }, + { LAGG_PROTO_FAILOVER, lagg_fail_attach }, { LAGG_PROTO_LOADBALANCE, lagg_lb_attach }, { LAGG_PROTO_ETHERCHANNEL, lagg_lb_attach }, { LAGG_PROTO_LACP, lagg_lacp_attach }, + { LAGG_PROTO_BROADCAST, lagg_bcast_attach }, { LAGG_PROTO_NONE, NULL } }; @@ -918,6 +927,7 @@ lagg_port2req(struct lagg_port *lp, stru case LAGG_PROTO_ROUNDROBIN: case LAGG_PROTO_LOADBALANCE: case LAGG_PROTO_ETHERCHANNEL: + case LAGG_PROTO_BROADCAST: if (LAGG_PORTACTIVE(lp)) rp->rp_flags |= LAGG_PORT_ACTIVE; break; @@ -1440,6 +1450,7 @@ lagg_linkstate(struct lagg_softc *sc) case LAGG_PROTO_ROUNDROBIN: case LAGG_PROTO_LOADBALANCE: case LAGG_PROTO_ETHERCHANNEL: + case LAGG_PROTO_BROADCAST: speed = 0; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) speed += lp->lp_ifp->if_baudrate; @@ -1722,6 +1733,91 @@ lagg_rr_input(struct lagg_softc *sc, str } /* + * Broadcast mode + */ + +static int +lagg_bcast_attach(struct lagg_softc *sc) +{ + sc->sc_detach = lagg_bcast_detach; + sc->sc_start = lagg_bcast_start; + sc->sc_input = lagg_bcast_input; + sc->sc_port_create = NULL; + sc->sc_port_destroy = NULL; + sc->sc_linkstate = NULL; + sc->sc_req = NULL; + sc->sc_portreq = NULL; + + return (0); +} + +static int +lagg_bcast_detach(struct lagg_softc *sc) +{ + return (0); +} + +static int +lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m) +{ + int active_ports = 0; + int errors = 0; + int ret; + struct lagg_port *lp, *last = NULL; + struct mbuf *m0; + + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (!LAGG_PORTACTIVE(lp)) + continue; + + active_ports++; + + if (last != NULL) { + m0 = m_copym(m, 0, M_COPYALL, + M_NOWAIT); + if (m0 == NULL) { + ret = ENOBUFS; + errors++; + break; + } + + ret = lagg_enqueue(last->lp_ifp, m0); + if (ret != 0) + errors++; + } + last = lp; + } + if (last == NULL) { + m_freem(m); + return (ENOENT); + } + if ((last = lagg_link_active(sc, last)) == NULL) { + m_freem(m); + return (ENETDOWN); + } + + ret = lagg_enqueue(last->lp_ifp, m); + if (ret != 0) + errors++; + + if (errors == 0) + return (ret); + + return (0); +} + +static struct mbuf* +lagg_bcast_input(struct lagg_softc *sc, struct lagg_port *lp, + struct mbuf *m) +{ + struct ifnet *ifp = sc->sc_ifp; + + /* Just pass in the packet to our lagg device */ + m->m_pkthdr.rcvif = ifp; + return (m); +} + +/* * Active failover */ Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Thu Sep 18 02:01:36 2014 (r271731) +++ head/sys/net/if_lagg.h Thu Sep 18 02:12:48 2014 (r271732) @@ -53,7 +53,8 @@ #define LAGG_PROTO_LOADBALANCE 3 /* loadbalance */ #define LAGG_PROTO_LACP 4 /* 802.3ad lacp */ #define LAGG_PROTO_ETHERCHANNEL 5 /* Cisco FEC */ -#define LAGG_PROTO_MAX 6 +#define LAGG_PROTO_BROADCAST 6 /* broadcast */ +#define LAGG_PROTO_MAX 7 struct lagg_protos { const char *lpr_name; @@ -62,11 +63,12 @@ struct lagg_protos { #define LAGG_PROTO_DEFAULT LAGG_PROTO_FAILOVER #define LAGG_PROTOS { \ - { "failover", LAGG_PROTO_FAILOVER }, \ + { "failover", LAGG_PROTO_FAILOVER }, \ { "fec", LAGG_PROTO_ETHERCHANNEL }, \ { "lacp", LAGG_PROTO_LACP }, \ { "loadbalance", LAGG_PROTO_LOADBALANCE }, \ - { "roundrobin", LAGG_PROTO_ROUNDROBIN }, \ + { "roundrobin", LAGG_PROTO_ROUNDROBIN }, \ + { "broadcast", LAGG_PROTO_BROADCAST }, \ { "none", LAGG_PROTO_NONE }, \ { "default", LAGG_PROTO_DEFAULT } \ } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 02:22:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1543232C; Thu, 18 Sep 2014 02:22:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAC60A7F; Thu, 18 Sep 2014 02:22:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I2M282025412; Thu, 18 Sep 2014 02:22:02 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I2M25P025407; Thu, 18 Sep 2014 02:22:02 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201409180222.s8I2M25P025407@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 18 Sep 2014 02:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271733 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 02:22:03 -0000 Author: araujo (ports committer) Date: Thu Sep 18 02:22:02 2014 New Revision: 271733 URL: http://svnweb.freebsd.org/changeset/base/271733 Log: The lagg(4) interface is based on trunk(4) interface from OpenBSD. The FreeBSD is the only system that has the FEC protocol, that is a simple alias to loadbalance protocol and does not implement the ancient Cisco FEC standard. From now on, we remove the fec protocol from the documentation and keep the FEC code only for compatibility. Phabric: D539 Reviewed by: glebius, thompsa Approved by: glebius Sponsored by: QNAP Systems Inc. Modified: head/sbin/ifconfig/ifconfig.8 head/share/man/man4/lagg.4 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Thu Sep 18 02:12:48 2014 (r271732) +++ head/sbin/ifconfig/ifconfig.8 Thu Sep 18 02:22:02 2014 (r271733) @@ -2332,7 +2332,7 @@ from the aggregation interface. .It Cm laggproto Ar proto Set the aggregation protocol. The default is failover. -The available options are failover, fec, lacp, loadbalance, roundrobin, broadcast +The available options are failover, lacp, loadbalance, roundrobin, broadcast and none. .It Cm lagghash Ar option Ns Oo , Ns Ar option Oc Set the packet layers to hash for aggregation protocols which load balance. Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Thu Sep 18 02:12:48 2014 (r271732) +++ head/share/man/man4/lagg.4 Thu Sep 18 02:22:02 2014 (r271733) @@ -61,7 +61,6 @@ option. The driver currently supports the aggregation protocols .Ic failover (the default), -.Ic fec , .Ic lacp , .Ic loadbalance , .Ic roundrobin , @@ -87,9 +86,6 @@ This constraint can be relaxed by settin .Xr sysctl 8 variable to a nonzero value, which is useful for certain bridged network setups. -.It Ic fec -Supports Cisco EtherChannel. -This is an alias for .Ic loadbalance mode. .It Ic lacp From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 03:02:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 383DE874; Thu, 18 Sep 2014 03:02:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A04CE29; Thu, 18 Sep 2014 03:02:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I322l9044613; Thu, 18 Sep 2014 03:02:02 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I3215e044600; Thu, 18 Sep 2014 03:02:01 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409180302.s8I3215e044600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 18 Sep 2014 03:02: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: r271734 - in stable/10: share/man/man4 usr.bin/iscsictl usr.sbin/ctld usr.sbin/iscsid 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 03:02:02 -0000 Author: allanjude (doc committer) Date: Thu Sep 18 03:02:00 2014 New Revision: 271734 URL: http://svnweb.freebsd.org/changeset/base/271734 Log: MFC r271445,r271446,r271560: Improve markup and language throughout the ctl.conf man page MFC r271543: Add the new iscsi(4) man page Cross reference it from iscsid(8) and iscsictl(8) Approved by: re (gjb), bcr (mentor) Added: stable/10/share/man/man4/iscsi.4 - copied unchanged from r271543, head/share/man/man4/iscsi.4 Modified: stable/10/share/man/man4/Makefile stable/10/usr.bin/iscsictl/iscsictl.8 stable/10/usr.sbin/ctld/ctl.conf.5 stable/10/usr.sbin/iscsid/iscsid.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/share/man/man4/Makefile Thu Sep 18 03:02:00 2014 (r271734) @@ -205,6 +205,7 @@ MAN= aac.4 \ ipw.4 \ ipwfw.4 \ isci.4 \ + iscsi.4 \ iscsi_initiator.4 \ isp.4 \ ispfw.4 \ Copied: stable/10/share/man/man4/iscsi.4 (from r271543, head/share/man/man4/iscsi.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/iscsi.4 Thu Sep 18 03:02:00 2014 (r271734, copy of r271543, head/share/man/man4/iscsi.4) @@ -0,0 +1,111 @@ +.\" Copyright (c) 2014 Edward Tomasz Napierala +.\" 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 September 11, 2014 +.Dt ISCSI 4 +.Os +.Sh NAME +.Nm iscsi +.Nd iSCSI initiator +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iscsi" +.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 +iscsi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +subsystem provides the kernel component of an iSCSI initiator. +The initiator is the iSCSI client, which connects to an iSCSI 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 . +The +.Nm +subsystem is responsible for implementing the +.Qq Full Feature Phase +of the iSCSI protocol. +.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.iscsi.ping_timeout +The number of seconds to wait for the target to respond to a NOP-Out +PDU. +In the event that there is no response within that time the session gets +forcibly restarted. +.It Va kern.iscsi.iscsid_timeout +The number of seconds to wait for +.Xr ctld 8 +to establish a session. +After that time +.Nm +will abort and retry. +.It Va kern.iscsi.login_timeout +The number of seconds to wait for a login attempt to succeed. +After that time +.Nm +will abort and retry. +.It Va kern.iscsi.maxtags +The maximum number of outstanding IO requests. +.It Va kern.iscsi.fail_on_disconnection +Controls the behavior after an iSCSI connection has been dropped due to +network problems. +When set to 1, a dropped connection causes the iSCSI device nodes +to be destroyed. +After reconnecting, they will be created again. +By default, the device nodes are left intact. +While the connection is down all input/output operations are suspended, to be +retried after the connection is reestablished. +.El +.Sh SEE ALSO +.Xr iscsi.conf 5 , +.Xr iscsictl 8 , +.Xr iscsid 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +subsystem was developed by +.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Thu Sep 18 03:02:00 2014 (r271734) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2014 +.Dd September 12, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -171,6 +171,7 @@ Attach to target iqn.2012-06.com.example Disconnect all iSCSI sessions: .Dl Nm Fl Ra .Sh SEE ALSO +.Xr iscsi 4 , .Xr iscsi.conf 5 , .Xr iscsid 8 .Sh HISTORY @@ -181,6 +182,6 @@ command appeared in .Sh AUTHORS The .Nm -was developed by +utility was developed by .An Edward Tomasz Napierala Aq trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 03:02:00 2014 (r271734) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2014 +.Dd September 11, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -46,179 +46,249 @@ The general syntax of the .Nm file is: .Bd -literal -offset indent -pidfile +.No pidfile Ar path -auth-group { - chap - ... +.No auth-group Ar name No { +.Dl chap Ar user Ar secret +.Dl ... } -portal-group { - listen
- listen-iser
- discovery-auth-group - ... +.No portal-group Ar name No { +.Dl listen Ar address +.Dl listen-iser Ar address +.Dl discovery-auth-group Ar name +.Dl ... } -target { - auth-group - portal-group - lun { - path - } - ... +.No target Ar name { +.Dl auth-group Ar name +.Dl portal-group Ar name +.Dl lun Ar number No { +.Dl path Ar path +.Dl } +.Dl ... } .Ed -.Ss global level -The following statements are available at the global level: +.Ss Global Context .Bl -tag -width indent -.It Ic auth-group Aq Ar name -Opens an auth-group section, defining an authentication group, +.It Ic auth-group Ar name +Create an +.Sy auth-group +configuration context, +defining a new auth-group, which can then be assigned to any number of targets. -.It Ic debug Aq Ar level -Specifies debug level. +.It Ic debug Ar level +The debug verbosity level. The default is 0. -.It Ic maxproc Aq Ar number -Specifies limit for concurrently running child processes handling +.It Ic maxproc Ar number +The limit for concurrently running child processes handling incoming connections. The default is 30. -Setting it to 0 disables the limit. -.It Ic pidfile Aq Ar path -Specifies path to pidfile. +A setting of 0 disables the limit. +.It Ic pidfile Ar path +The path to the pidfile. The default is .Pa /var/run/ctld.pid . -.It Ic portal-group Aq Ar name -Opens a portal-group section, defining a portal group, +.It Ic portal-group Ar name +Create a +.Sy portal-group +configuration context, which can then be assigned to any number of targets. -.It Ic target Aq Ar name -Opens a target configuration section. -.It Ic timeout Aq Ar seconds -Specifies timeout for login session, after which the connection +.It Ic target Ar name +Create a +.Sy target +configuration context, which can contain one or more +.Sy lun +contexts. +.It Ic timeout Ar seconds +The timeout for login sessions, after which the connection will be forcibly terminated. The default is 60. -Setting it to 0 disables the timeout. +A setting of 0 disables the timeout. .El -.Ss auth-group level -The following statements are available at the auth-group level: +.Ss auth-group Context .Bl -tag -width indent -.It Ic auth-type Ao Ar type Ac -Specifies authentication type. -Type can be either "none", "deny", "chap", or "chap-mutual". + +.It Ic auth-type Ar type +Sets the authentication type. +Type can be either +.Qq Ar none , +.Qq Ar deny , +.Qq Ar chap , +or +.Qq Ar chap-mutual . In most cases it is not necessary to set the type using this clause; -it is usually used to disable authentication for a given auth-group. -.It Ic chap Ao Ar user Ac Aq Ar secret -Specifies CHAP authentication credentials. -.It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret -Specifies mutual CHAP authentication credentials. -Note that for any auth-group, configuration may contain either chap, -or chap-mutual entries; it is an error to mix them. -.It Ic initiator-name Ao Ar initiator-name Ac -Specifies iSCSI initiator name. +it is usually used to disable authentication for a given +.Sy auth-group . +.It Ic chap Ar user Ar secret +A set of CHAP authentication credentials. +Note that for any +.Sy auth-group , +the configuration may only contain either +.Sy chap +or +.Sy chap-mutual +entries; it is an error to mix them. +.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret +A set of mutual CHAP authentication credentials. +Note that for any +.Sy auth-group , +the configuration may only contain either +.Sy chap +or +.Sy chap-mutual +entries; it is an error to mix them. +.It Ic initiator-name Ar initiator-name +An iSCSI initiator name. +Only initiators with a name matching one of the defined +names will be allowed to connect. If not defined, there will be no restrictions based on initiator name. -Otherwise, only initiators with names matching one of defined -ones will be allowed to connect. -.It Ic initiator-portal Ao Ar address Ac -Specifies iSCSI initiator portal - IPv4 or IPv6 address or network. +.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen +An iSCSI initiator portal: an IPv4 or IPv6 address, optionally +followed by a literal slash and a prefix length. +Only initiators with an address matching one of the defined +addresses will be allowed to connect. If not defined, there will be no restrictions based on initiator address. -Otherwise, only initiators with addresses matching one of defined -ones will be allowed to connect. .El -.Ss portal-group level -The following statements are available at the portal-group level: +.Ss portal-group Context .Bl -tag -width indent -.It Ic discovery-auth-group Aq Ar name -Assigns previously defined authentication group to the portal group, +.It Ic discovery-auth-group Ar name +Assign a previously defined authentication group to the portal group, to be used for target discovery. By default, portal groups that do not specify their own auth settings, -using clauses such as "chap" or "initiator-name", are assigned -predefined auth-group "default", which denies discovery. -Another predefined auth-group, "no-authentication", may be used +using clauses such as +.Sy chap +or +.Sy initiator-name , +are assigned +predefined +.Sy auth-group +.Qq Ar default , +which denies discovery. +Another predefined +.Sy auth-group , +.Qq Ar no-authentication , +may be used to permit discovery without authentication. -.It Ic listen Aq Ar address -Specifies IPv4 or IPv6 address and port to listen on for incoming connections. -.It Ic listen-iser Aq Ar address -Specifies IPv4 or IPv6 address and port to listen on for incoming connections +.It Ic listen Ar address +An IPv4 or IPv6 address and port to listen on for incoming connections. +.It Ic listen-iser Ar address +An IPv4 or IPv6 address and port to listen on for incoming connections using iSER (iSCSI over RDMA) protocol. .El -.Ss target level: -The following statements are available at the target level: +.Ss target Context .Bl -tag -width indent -.It Ic alias Aq Ar text -Assigns human-readable description to the target. +.It Ic alias Ar text +Assign a human-readable description to the target. There is no default. -.It Ic auth-group Aq Ar name -Assigns previously defined authentication group to the target. +.It Ic auth-group Ar name +Assign a previously defined authentication group to the target. By default, targets that do not specify their own auth settings, -using clauses such as "chap" or "initiator-name", are assigned -predefined auth-group "default", which denies all access. -Another predefined auth-group, "no-authentication", may be used to permit access +using clauses such as +.Sy chap +or +.Sy initiator-name , +are assigned +predefined +.Sy auth-group +.Qq Ar default , +which denies all access. +Another predefined +.Sy auth-group , +.Qq Ar no-authentication , +may be used to permit access without authentication. -.It Ic auth-type Ao Ar type Ac -Specifies authentication type. -Type can be either "none", "deny", "chap", or "chap-mutual". +Note that targets must only use one of +.Sy auth-group , chap , No or Sy chap-mutual ; +it is a configuration error to mix multiple types in one target. +.It Ic auth-type Ar type +Sets the authentication type. +Type can be either +.Qq Ar none , +.Qq Ar deny , +.Qq Ar chap , +or +.Qq Ar chap-mutual . In most cases it is not necessary to set the type using this clause; -it is usually used to disable authentication for a given target. -This clause is mutually exclusive with auth-group; one cannot use +it is usually used to disable authentication for a given +.Sy target . +This clause is mutually exclusive with +.Sy auth-group ; +one cannot use both in a single target. -.It Ic chap Ao Ar user Ac Aq Ar secret -Specifies CHAP authentication credentials. -Note that targets must use either auth-group, or chap, -or chap-mutual clauses; it is a configuration error to mix them in one target. -.It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret -Specifies mutual CHAP authentication credentials. -Note that targets must use either auth-group, chap, or -chap-mutual clauses; it is a configuration error to mix them in one target. -.It Ic initiator-name Ao Ar initiator-name Ac -Specifies iSCSI initiator name. +.It Ic chap Ar user Ar secret +A set of CHAP authentication credentials. +Note that targets must only use one of +.Sy auth-group , chap , No or Sy chap-mutual ; +it is a configuration error to mix multiple types in one target. +.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret +A set of mutual CHAP authentication credentials. +Note that targets must only use one of +.Sy auth-group , chap , No or Sy chap-mutual ; +it is a configuration error to mix multiple types in one target. +.It Ic initiator-name Ar initiator-name +An iSCSI initiator name. +Only initiators with a name matching one of the defined +names will be allowed to connect. If not defined, there will be no restrictions based on initiator name. -Otherwise, only initiators with names matching one of defined -ones will be allowed to connect. -This clause is mutually exclusive with auth-group; one cannot use +This clause is mutually exclusive with +.Sy auth-group ; +one cannot use both in a single target. -.It Ic initiator-portal Ao Ar address Ac -Specifies iSCSI initiator portal - IPv4 or IPv6 address. +.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen +An iSCSI initiator portal: an IPv4 or IPv6 address, optionally +followed by a literal slash and a prefix length. +Only initiators with an address matching one of the defined +addresses will be allowed to connect. If not defined, there will be no restrictions based on initiator address. -Otherwise, only initiators with addresses matching one of defined -ones will be allowed to connect. -This clause is mutually exclusive with auth-group; one cannot use +This clause is mutually exclusive with +.Sy auth-group ; +one cannot use both in a single target. -.It Ic portal-group Aq Ar name -Assigns previously defined portal group to the target. -Default portal group is "default", which makes the target available +.It Ic portal-group Ar name +Assign a previously defined portal group to the target. +The default portal group is +.Qq Ar default , +which makes the target available on TCP port 3260 on all configured IPv4 and IPv6 addresses. -.It Ic lun Aq Ar number -Opens a lun configuration section, defining LUN exported by a target. +.It Ic lun Ar number +Create a +.Sy lun +configuration context, defining a LUN exported by the parent target. .El -.Ss lun level -The following statements are available at the lun level: +.Ss lun Context .Bl -tag -width indent -.It Ic backend Ao Ar block | Ar ramdisk Ac -Specifies the CTL backend to use for a given LUN. +.It Ic backend Ar block No | Ar ramdisk +The CTL backend to use for a given LUN. Valid choices are -.Dq block +.Qq Ar block and -.Dq ramdisk ; +.Qq Ar ramdisk ; block is used for LUNs backed by files or disk device nodes; ramdisk is a bitsink device, used mostly for testing. The default backend is block. -.It Ic blocksize Aq Ar size -Specifies blocksize visible to the initiator. +.It Ic blocksize Ar size +The blocksize visible to the initiator. The default blocksize is 512. -.It Ic device-id Aq Ar string -Specifies SCSI Device Identification string presented to the initiator. -.It Ic option Ao Ar name Ac Aq Ar value -Specifies CTL-specific options passed to the kernel. -.It Ic path Aq Ar path -Specifies path to file or device node used to back the LUN. -.It Ic serial Aq Ar string -Specifies SCSI serial number presented to the initiator. -.It Ic size Aq Ar size -Specifies LUN size, in bytes. +.It Ic device-id Ar string +The SCSI Device Identification string presented to the initiator. +.It Ic option Ar name Ar value +The CTL-specific options passed to the kernel. +All CTL-specific options are documented in the +.Sx OPTIONS +section of +.Xr ctladm 8 +.It Ic path Ar path +The path to the file or device node used to back the LUN. +.It Ic serial Ar string +The SCSI serial number presented to the initiator. +.It Ic size Ar size +The LUN size, in bytes. .El .Sh FILES .Bl -tag -width ".Pa /etc/ctl.conf" -compact Modified: stable/10/usr.sbin/iscsid/iscsid.8 ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.8 Thu Sep 18 02:22:02 2014 (r271733) +++ stable/10/usr.sbin/iscsid/iscsid.8 Thu Sep 18 03:02:00 2014 (r271734) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd September 12, 2014 .Dt ISCSID 8 .Os .Sh NAME @@ -49,12 +49,13 @@ as well as performing SendTargets discov Upon startup, the .Nm daemon opens the iSCSI initiator device file and waits for kernel requests. -It doesn't use any configuration file; all the information it needs it gets -from the kernel. +.Nm +does not use any configuration files. +All needed information is supplied by the kernel. .Pp When the .Nm -damon is not running, already established iSCSI connections continue +daemon is not running, already established iSCSI connections continue to work. However, establishing new connections, or recovering existing ones in case of connection error, is not possible. @@ -99,6 +100,7 @@ The .Nm utility exits 0 on success, and >0 if an error occurs. .Sh SEE ALSO +.Xr iscsi 4 , .Xr iscsictl 8 .Sh HISTORY The @@ -108,6 +110,6 @@ command appeared in .Sh AUTHORS The .Nm -was developed by +utility was developed by .An Edward Tomasz Napierala Aq trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 03:09:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6576CAD1; Thu, 18 Sep 2014 03:09:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51405E7E; Thu, 18 Sep 2014 03:09:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I39ZkA045602; Thu, 18 Sep 2014 03:09:35 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I39Zmh045601; Thu, 18 Sep 2014 03:09:35 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201409180309.s8I39Zmh045601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 18 Sep 2014 03:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271735 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 03:09:35 -0000 Author: araujo (ports committer) Date: Thu Sep 18 03:09:34 2014 New Revision: 271735 URL: http://svnweb.freebsd.org/changeset/base/271735 Log: Remove old comment, we already do 802.1q tagging. Phabric: D797 Reviewed by: kevlo Approved by: kevlo Sponsored by: QNAP Systems Inc. Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Sep 18 03:02:00 2014 (r271734) +++ head/sys/net/if_vlan.c Thu Sep 18 03:09:34 2014 (r271735) @@ -29,8 +29,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 From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 03:12:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89710C37; Thu, 18 Sep 2014 03:12:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 754F5F15; Thu, 18 Sep 2014 03:12:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I3C0k6049300; Thu, 18 Sep 2014 03:12:00 GMT (envelope-from davide@FreeBSD.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I3C080049299; Thu, 18 Sep 2014 03:12:00 GMT (envelope-from davide@FreeBSD.org) Message-Id: <201409180312.s8I3C080049299@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davide set sender to davide@FreeBSD.org using -f From: Davide Italiano Date: Thu, 18 Sep 2014 03:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271736 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 03:12:00 -0000 Author: davide Date: Thu Sep 18 03:11:59 2014 New Revision: 271736 URL: http://svnweb.freebsd.org/changeset/base/271736 Log: r258695 introduces a sanity check for makefs in order to verify that the minimum image size specified is always less than the maximum image size. If makefs(1) is invoked specifying minimum image size, but not maximum one, the program exits with an error. Example: # sudo -E makefs -M 538968064 -B be /home/davide/disk.img $DESTDIR makefs: `/home/davide/tftproot/mips' minsize of 538968064 rounded up to ffs bsize of 8192 exceeds maxsize 0. Lower bsize, or round the minimum and maximum sizes to bsize. Assert then that minsize < maxsize iff maxsize is specified. This change allows me to build MIPS images using makefs(1) and following what specified in the wiki again. Reviewed by: jmallett, ngie Modified: head/usr.sbin/makefs/ffs.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Thu Sep 18 03:09:34 2014 (r271735) +++ head/usr.sbin/makefs/ffs.c Thu Sep 18 03:11:59 2014 (r271736) @@ -361,7 +361,8 @@ ffs_validate(const char *dir, fsnode *ro if (ffs_opts->avgfpdir == -1) ffs_opts->avgfpdir = AFPDIR; - if (roundup(fsopts->minsize, ffs_opts->bsize) > fsopts->maxsize) + if (fsopts->maxsize > 0 && + roundup(fsopts->minsize, ffs_opts->bsize) > fsopts->maxsize) errx(1, "`%s' minsize of %lld rounded up to ffs bsize of %d " "exceeds maxsize %lld. Lower bsize, or round the minimum " "and maximum sizes to bsize.", dir, From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 05:18:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49E2DE05; Thu, 18 Sep 2014 05:18:37 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C0CDBB9A; Thu, 18 Sep 2014 05:18:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8I5IYvL093430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Sep 2014 09:18:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8I5IYH8093429; Thu, 18 Sep 2014 09:18:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 18 Sep 2014 09:18:34 +0400 From: Gleb Smirnoff To: Marcelo Araujo , kevlo@FreeBSD.org Subject: Re: svn commit: r271735 - head/sys/net Message-ID: <20140918051834.GD89442@FreeBSD.org> References: <201409180309.s8I39Zmh045601@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409180309.s8I39Zmh045601@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 05:18:37 -0000 On Thu, Sep 18, 2014 at 03:09:35AM +0000, Marcelo Araujo wrote: M> Author: araujo (ports committer) M> Date: Thu Sep 18 03:09:34 2014 M> New Revision: 271735 M> URL: http://svnweb.freebsd.org/changeset/base/271735 M> M> Log: M> Remove old comment, we already do 802.1q tagging. But the comment speaks about 802.1p priority tagging, which we do not support. So the comment was absolutely correct. I'd prefer to see patch reverted. M> Phabric: D797 M> Reviewed by: kevlo M> Approved by: kevlo M> Sponsored by: QNAP Systems Inc. M> M> Modified: M> head/sys/net/if_vlan.c M> M> Modified: head/sys/net/if_vlan.c M> ============================================================================== M> --- head/sys/net/if_vlan.c Thu Sep 18 03:02:00 2014 (r271734) M> +++ head/sys/net/if_vlan.c Thu Sep 18 03:09:34 2014 (r271735) M> @@ -29,8 +29,7 @@ M> M> /* M> * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. M> - * Might be extended some day to also handle IEEE 802.1p priority M> - * tagging. This is sort of sneaky in the implementation, since M> + * This is sort of sneaky in the implementation, since M> * we need to pretend to be enough of an Ethernet implementation M> * to make arp work. The way we do this is by telling everyone M> * that we are an Ethernet, and then catch the packets that M> -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 05:31:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7E7377; Thu, 18 Sep 2014 05:31:27 +0000 (UTC) Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [IPv6:2a00:1450:400c:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7BC1C6C; Thu, 18 Sep 2014 05:31:26 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id k48so308549wev.13 for ; Wed, 17 Sep 2014 22:31:24 -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:date:message-id :subject:from:to:cc:content-type; bh=Bd9pm3NLwbPV+35KwEEC26crCZYaKKgt4OxXW8SJcW0=; b=K0ycxsB5tcC8hX3tZ2KlQJfwtZVsgZ8s4nHSbYlI3h+N+Uv3Qrmzmqj2hdKjj31w+V 6JtGgMmmOfylCR+oqWPef3B7qTBnsLc+Oxk6pgr72y7jlrnsXS94u1/1GQxzHAQUkdy8 N+uk4Pwj14ei96/C4ZE0JssKUYeREC1fy2WrN0nT+2zhLMNU/D8qM7XjAvivp/bkX3wa eFA8q82YAokoq1ywUJONkV7o6+I882M5hLw0IpidePC97jpyJhenE0ogqGFTx5dicE14 xtfyBIEZwHRuKMPWoZ9tPn9BM1yGfTXo8W4HFu400jAyeqki0uPbgm0XoC9vDuXWiuQi ol9A== MIME-Version: 1.0 X-Received: by 10.181.27.197 with SMTP id ji5mr34323403wid.54.1411018284807; Wed, 17 Sep 2014 22:31:24 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Wed, 17 Sep 2014 22:31:24 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <20140918051834.GD89442@FreeBSD.org> References: <201409180309.s8I39Zmh045601@svn.freebsd.org> <20140918051834.GD89442@FreeBSD.org> Date: Thu, 18 Sep 2014 13:31:24 +0800 Message-ID: Subject: Re: svn commit: r271735 - head/sys/net From: Marcelo Araujo To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 05:31:28 -0000 2014-09-18 13:18 GMT+08:00 Gleb Smirnoff : > On Thu, Sep 18, 2014 at 03:09:35AM +0000, Marcelo Araujo wrote: > M> Author: araujo (ports committer) > M> Date: Thu Sep 18 03:09:34 2014 > M> New Revision: 271735 > M> URL: http://svnweb.freebsd.org/changeset/base/271735 > M> > M> Log: > M> Remove old comment, we already do 802.1q tagging. > > But the comment speaks about 802.1p priority tagging, which > we do not support. So the comment was absolutely correct. > > I'd prefer to see patch reverted. > Hello Glebs, I got confused with the packet tagged and packet to be tagged. My mistake, I'm gonna revert this revision. My apologies for the wrong explanation to Kevin. Thanks Glebs. > -- > Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 05:40:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 547B626F; Thu, 18 Sep 2014 05:40:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25AAAD2A; Thu, 18 Sep 2014 05:40:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I5eYte015556; Thu, 18 Sep 2014 05:40:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I5eXYF015555; Thu, 18 Sep 2014 05:40:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180540.s8I5eXYF015555@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 05:40: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: r271737 - stable/9/contrib/llvm/lib/Target/X86 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 05:40:34 -0000 Author: dim Date: Thu Sep 18 05:40:33 2014 New Revision: 271737 URL: http://svnweb.freebsd.org/changeset/base/271737 Log: MFC r271597: Pull in r217410 from upstream llvm trunk (by Bob Wilson): Set trunc store action to Expand for all X86 targets. When compiling without SSE2, isTruncStoreLegal(F64, F32) would return Legal, whereas with SSE2 it would return Expand. And since the Target doesn't seem to actually handle a truncstore for double -> float, it would just output a store of a full double in the space for a float hence overwriting other bits on the stack. Patch by Luqman Aden! This should fix clang -O0 on i386 assigning garbage to floats, in certain scenarios. PR: 187437 Submitted by: cebd@gmail.com Obtained from: http://llvm.org/viewvc/llvm-project?rev=217410&view=rev Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 03:11:59 2014 (r271736) +++ stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 05:40:33 2014 (r271737) @@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc setTruncStoreAction(MVT::i32, MVT::i8 , Expand); setTruncStoreAction(MVT::i16, MVT::i8, Expand); + setTruncStoreAction(MVT::f64, MVT::f32, Expand); + // SETOEQ and SETUNE require checking two conditions. setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand); setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand); @@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc AddPromotedToType (ISD::SELECT, VT, MVT::v2i64); } - setTruncStoreAction(MVT::f64, MVT::f32, Expand); - // Custom lower v2i64 and v2f64 selects. setOperationAction(ISD::LOAD, MVT::v2f64, Legal); setOperationAction(ISD::LOAD, MVT::v2i64, Legal); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 05:43:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E28E53FB; Thu, 18 Sep 2014 05:43:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE5F1DD1; Thu, 18 Sep 2014 05:43:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I5hJeU017455; Thu, 18 Sep 2014 05:43:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I5hJLd017454; Thu, 18 Sep 2014 05:43:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201409180543.s8I5hJLd017454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 18 Sep 2014 05:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271738 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 05:43:20 -0000 Author: araujo (ports committer) Date: Thu Sep 18 05:43:19 2014 New Revision: 271738 URL: http://svnweb.freebsd.org/changeset/base/271738 Log: Revert r271735. The comment is absolutely correct, we do not support 802.1p priority tagging. I got confused with the packet tagged and packet to be tagged. Spotted by: glebius Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Sep 18 05:40:33 2014 (r271737) +++ head/sys/net/if_vlan.c Thu Sep 18 05:43:19 2014 (r271738) @@ -29,7 +29,8 @@ /* * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. - * This is sort of sneaky in the implementation, since + * Might be extended some day to also handle IEEE 802.1p priority + * tagging. 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 From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 06:13:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E80BF8C8; Thu, 18 Sep 2014 06:13:30 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 874DDB4; Thu, 18 Sep 2014 06:13:29 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s8I64a56005866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Sep 2014 14:04:37 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.8/8.14.8/Submit) id s8I64aMJ005865; Thu, 18 Sep 2014 14:04:36 +0800 (CST) (envelope-from kevlo) Date: Thu, 18 Sep 2014 14:04:35 +0800 From: Kevin Lo To: Gleb Smirnoff Subject: Re: svn commit: r271735 - head/sys/net Message-ID: <20140918060435.GA5856@ns.kevlo.org> References: <201409180309.s8I39Zmh045601@svn.freebsd.org> <20140918051834.GD89442@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140918051834.GD89442@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Marcelo Araujo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 06:13:31 -0000 On Thu, Sep 18, 2014 at 09:18:34AM +0400, Gleb Smirnoff wrote: > > On Thu, Sep 18, 2014 at 03:09:35AM +0000, Marcelo Araujo wrote: > M> Author: araujo (ports committer) > M> Date: Thu Sep 18 03:09:34 2014 > M> New Revision: 271735 > M> URL: http://svnweb.freebsd.org/changeset/base/271735 > M> > M> Log: > M> Remove old comment, we already do 802.1q tagging. > > But the comment speaks about 802.1p priority tagging, which > we do not support. So the comment was absolutely correct. > > I'd prefer to see patch reverted. Sorry, I overlooked that. Marcelo has a patch with 802.1p tagging support, I thought the patch was committed. > M> Phabric: D797 > M> Reviewed by: kevlo > M> Approved by: kevlo > M> Sponsored by: QNAP Systems Inc. > M> > M> Modified: > M> head/sys/net/if_vlan.c > M> > M> Modified: head/sys/net/if_vlan.c > M> ============================================================================== > M> --- head/sys/net/if_vlan.c Thu Sep 18 03:02:00 2014 (r271734) > M> +++ head/sys/net/if_vlan.c Thu Sep 18 03:09:34 2014 (r271735) > M> @@ -29,8 +29,7 @@ > M> > M> /* > M> * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. > M> - * Might be extended some day to also handle IEEE 802.1p priority > M> - * tagging. This is sort of sneaky in the implementation, since > M> + * This is sort of sneaky in the implementation, since > M> * we need to pretend to be enough of an Ethernet implementation > M> * to make arp work. The way we do this is by telling everyone > M> * that we are an Ethernet, and then catch the packets that > M> > > -- > Totus tuus, Glebius. Kevin From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 06:34:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A461C9B; Thu, 18 Sep 2014 06:34:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEF1B245; Thu, 18 Sep 2014 06:34:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6YRuv040480; Thu, 18 Sep 2014 06:34:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6YRvU040479; Thu, 18 Sep 2014 06:34:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180634.s8I6YRvU040479@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:34: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: r271739 - stable/10/contrib/llvm/lib/Target/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 06:34:28 -0000 Author: dim Date: Thu Sep 18 06:34:27 2014 New Revision: 271739 URL: http://svnweb.freebsd.org/changeset/base/271739 Log: MFC r271597: Pull in r217410 from upstream llvm trunk (by Bob Wilson): Set trunc store action to Expand for all X86 targets. When compiling without SSE2, isTruncStoreLegal(F64, F32) would return Legal, whereas with SSE2 it would return Expand. And since the Target doesn't seem to actually handle a truncstore for double -> float, it would just output a store of a full double in the space for a float hence overwriting other bits on the stack. Patch by Luqman Aden! This should fix clang -O0 on i386 assigning garbage to floats, in certain scenarios. PR: 187437 Submitted by: cebd@gmail.com Approved by: re (marius) Obtained from: http://llvm.org/viewvc/llvm-project?rev=217410&view=rev Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 05:43:19 2014 (r271738) +++ stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 18 06:34:27 2014 (r271739) @@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc setTruncStoreAction(MVT::i32, MVT::i8 , Expand); setTruncStoreAction(MVT::i16, MVT::i8, Expand); + setTruncStoreAction(MVT::f64, MVT::f32, Expand); + // SETOEQ and SETUNE require checking two conditions. setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand); setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand); @@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc AddPromotedToType (ISD::SELECT, VT, MVT::v2i64); } - setTruncStoreAction(MVT::f64, MVT::f32, Expand); - // Custom lower v2i64 and v2f64 selects. setOperationAction(ISD::LOAD, MVT::v2f64, Legal); setOperationAction(ISD::LOAD, MVT::v2i64, Legal); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 06:40:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF17CEEE; Thu, 18 Sep 2014 06:40:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA2EF34D; Thu, 18 Sep 2014 06:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6er6T043154; Thu, 18 Sep 2014 06:40:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6eriY043153; Thu, 18 Sep 2014 06:40:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180640.s8I6eriY043153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271740 - stable/8/share/mk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 06:40:54 -0000 Author: dim Date: Thu Sep 18 06:40:53 2014 New Revision: 271740 URL: http://svnweb.freebsd.org/changeset/base/271740 Log: MFC r257658 (modified to apply to stable/8): For C++ programs, don't emit any explicit dependency to libstdc++.a or libc++.a during the early build stages (bootstrap-tools, build-tools, cross-tools), since it is not possible to know in advance which C++ library is available on the host system. Instead, just use the bootstrap compiler's built-in default. This should eventually make it possible to build stable/9 on head, or on stable/10, which ship without libstdc++ by default. [Note: this should get the stable/8 tinderbox at least a bit further in buildworld.] Modified: stable/8/share/mk/bsd.prog.mk Modified: stable/8/share/mk/bsd.prog.mk ============================================================================== --- stable/8/share/mk/bsd.prog.mk Thu Sep 18 06:34:27 2014 (r271739) +++ stable/8/share/mk/bsd.prog.mk Thu Sep 18 06:40:53 2014 (r271740) @@ -134,7 +134,7 @@ _EXTRADEPEND: .endif .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} -.if defined(PROG_CXX) +.if defined(PROG_CXX) && !defined(BOOTSTRAPPING) echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 06:45:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15F301A5; Thu, 18 Sep 2014 06:45:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB5CC389; Thu, 18 Sep 2014 06:45:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6jhNX045272; Thu, 18 Sep 2014 06:45:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6jhdh045271; Thu, 18 Sep 2014 06:45:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180645.s8I6jhdh045271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271741 - stable/8/share/mk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 06:45:44 -0000 Author: dim Date: Thu Sep 18 06:45:43 2014 New Revision: 271741 URL: http://svnweb.freebsd.org/changeset/base/271741 Log: Fixup mergeinfo after r271740. Modified: Directory Properties: stable/8/share/mk/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 06:47:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA4E3325; Thu, 18 Sep 2014 06:47:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A54F73A0; Thu, 18 Sep 2014 06:47:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I6lm6r045553; Thu, 18 Sep 2014 06:47:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I6lmDx045552; Thu, 18 Sep 2014 06:47:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409180647.s8I6lmDx045552@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 18 Sep 2014 06:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r271742 - stable/7/share/mk X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 06:47:48 -0000 Author: dim Date: Thu Sep 18 06:47:48 2014 New Revision: 271742 URL: http://svnweb.freebsd.org/changeset/base/271742 Log: MFC r257658 (modified to apply to stable/7): For C++ programs, don't emit any explicit dependency to libstdc++.a or libc++.a during the early build stages (bootstrap-tools, build-tools, cross-tools), since it is not possible to know in advance which C++ library is available on the host system. Instead, just use the bootstrap compiler's built-in default. This should eventually make it possible to build stable/9 on head, or on stable/10, which ship without libstdc++ by default. [Note: this should get the stable/7 tinderbox at least a bit further in buildworld.] Modified: stable/7/share/mk/bsd.prog.mk Directory Properties: stable/7/share/mk/ (props changed) Modified: stable/7/share/mk/bsd.prog.mk ============================================================================== --- stable/7/share/mk/bsd.prog.mk Thu Sep 18 06:45:43 2014 (r271741) +++ stable/7/share/mk/bsd.prog.mk Thu Sep 18 06:47:48 2014 (r271742) @@ -126,7 +126,7 @@ _EXTRADEPEND: .endif .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} -.if defined(PROG_CXX) +.if defined(PROG_CXX) && !defined(BOOTSTRAPPING) echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 07:21:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D4D48C9 for ; Thu, 18 Sep 2014 07:21:17 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1740D894 for ; Thu, 18 Sep 2014 07:21:16 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by gateway2.nyi.internal (Postfix) with ESMTP id 0D501207C6 for ; Thu, 18 Sep 2014 03:21:15 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute3.internal (MEProxy); Thu, 18 Sep 2014 03:21:15 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:from:to:cc:mime-version:content-transfer-encoding :content-type:in-reply-to:references:subject:date; s=mesmtp; bh= LEoBLf4XbK2zEDt/sjHRkQBFPR4=; b=IhMYjkXPtNaI6df37erUaZCeDzDBUnpk I8HnwsT9Tm5kZgo9yTQiOXkfJ5Ys3L+8qMXNZEjxVcN1yjnPmN5oH+nHf2wQwRBx ax/CfIpps6+kH9g8PHymedRD03VWXR1mmH+HJnxC7xJ07GI9+9WJpK+0qk5z4uiA mQb9TNz8wVo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:cc:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=LEoBLf4XbK2zEDt/sjHRkQBFPR4=; b=qm5 1ZBLWd9Mbc9ZKcBDv7YUaHbpLc/BQaAT1LIxs9FF6GSsei5tDyG/C0VEScJPWpka Z+ghFjxpO5GCfflcE6eqcISaadzoL8WFWfpOWRs6Z1IWRKXcGk13fvXaOLZIiWf3 jWrFpCIEQEZ8Ib4qcdTFnFcNaIIS8ho9he1Dp6Hc= Received: by web6.nyi.internal (Postfix, from userid 99) id DB02C4799C; Thu, 18 Sep 2014 03:21:14 -0400 (EDT) Message-Id: <1411024874.128099.168895241.4A95DCA1@webmail.messagingengine.com> X-Sasl-Enc: KYsHIklMKlHDTL5g3yNAtnDqxNL0YO+1NG/fCtAEA2u+ 1411024874 From: Bruce Simpson To: Kevin Lo , Gleb Smirnoff MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-68d12f42 In-Reply-To: <20140918060435.GA5856@ns.kevlo.org> References: <201409180309.s8I39Zmh045601@svn.freebsd.org> <20140918051834.GD89442@FreeBSD.org> <20140918060435.GA5856@ns.kevlo.org> Subject: Re: svn commit: r271735 - head/sys/net Date: Thu, 18 Sep 2014 08:21:14 +0100 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Marcelo Araujo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 07:21:17 -0000 On Thu, 18 Sep 2014, at 07:04, Kevin Lo wrote: > Sorry, I overlooked that. Marcelo has a patch with 802.1p tagging > support, > I thought the patch was committed. I agree the comment change should be reverted. I changed if_ethersubr.c many years ago to decode 802.1p tags into the mbuf packet header if they are present. However, to my knowledge, there is no support (e.g. in the form of a DiffServ / IntServ mapping) further up in the stack. If someone plans to add this, great -- that would be needed for any form of tangible 802.1p support. -- BMS (sent via webmail) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 08:36:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C28A9CAB; Thu, 18 Sep 2014 08:36:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABF4AF7A; Thu, 18 Sep 2014 08:36:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I8amh2096924; Thu, 18 Sep 2014 08:36:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I8akZG096906; Thu, 18 Sep 2014 08:36:46 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409180836.s8I8akZG096906@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Sep 2014 08:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271743 - in head/sys: amd64/linux32 compat/linux conf i386/linux modules/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 08:36:48 -0000 Author: bz Date: Thu Sep 18 08:36:45 2014 New Revision: 271743 URL: http://svnweb.freebsd.org/changeset/base/271743 Log: Implement most of timer_{create,settime,gettime,getoverrun,delete} for amd64/linux32. Fix the entirely bogus (untested) version from r161310 for i386/linux using the same shared code in compat/linux. It is unclear to me if we could support more clock mappings but the current set allows me to successfully run commercial 32bit linux software under linuxolator on amd64. Reviewed by: jhb Differential Revision: D784 MFC after: 3 days Sponsored by: DARPA, AFRL Added: head/sys/compat/linux/linux_timer.c (contents, props changed) head/sys/compat/linux/linux_timer.h (contents, props changed) Modified: head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/syscalls.master head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/i386/linux/linux.h head/sys/i386/linux/linux_machdep.c head/sys/i386/linux/syscalls.master head/sys/modules/linux/Makefile Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/amd64/linux32/linux.h Thu Sep 18 08:36:45 2014 (r271743) @@ -61,6 +61,11 @@ MALLOC_DECLARE(M_LINUX); #define PTRIN(v) (void *)(uintptr_t)(v) #define PTROUT(v) (l_uintptr_t)(uintptr_t)(v) +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) + /* * Provide a separate set of types for the Linux types. */ Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/amd64/linux32/linux32_dummy.c Thu Sep 18 08:36:45 2014 (r271743) @@ -73,11 +73,6 @@ DUMMY(epoll_create); DUMMY(epoll_ctl); DUMMY(epoll_wait); DUMMY(remap_file_pages); -DUMMY(timer_create); -DUMMY(timer_settime); -DUMMY(timer_gettime); -DUMMY(timer_getoverrun); -DUMMY(timer_delete); DUMMY(fstatfs64); DUMMY(mbind); DUMMY(get_mempolicy); Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/amd64/linux32/syscalls.master Thu Sep 18 08:36:45 2014 (r271743) @@ -435,11 +435,13 @@ 256 AUE_NULL STD { int linux_epoll_wait(void); } 257 AUE_NULL STD { int linux_remap_file_pages(void); } 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } -259 AUE_NULL STD { int linux_timer_create(void); } -260 AUE_NULL STD { int linux_timer_settime(void); } -261 AUE_NULL STD { int linux_timer_gettime(void); } -262 AUE_NULL STD { int linux_timer_getoverrun(void); } -263 AUE_NULL STD { int linux_timer_delete(void); } +259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ + struct sigevent *evp, l_timer_t *timerid); } +260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ + const struct itimerspec *new, struct itimerspec *old); } +261 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); } +262 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); } +263 AUE_NULL STD { int linux_timer_delete(l_timer_t timerid); } 264 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t which, struct l_timespec *tp); } 265 AUE_NULL STD { int linux_clock_gettime(clockid_t which, struct l_timespec *tp); } 266 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } Added: head/sys/compat/linux/linux_timer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linux/linux_timer.c Thu Sep 18 08:36:45 2014 (r271743) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif +#include + +static int +linux_convert_l_clockid(clockid_t *clock_id) +{ + + switch (*clock_id) { + case LINUX_CLOCK_REALTIME: + *clock_id = CLOCK_REALTIME; + break; + case LINUX_CLOCK_MONOTONIC: + *clock_id = CLOCK_MONOTONIC; + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig) +{ + + CP(*l_sig, *sig, sigev_notify); + switch (l_sig->sigev_notify) { + case L_SIGEV_SIGNAL: + sig->sigev_notify = SIGEV_SIGNAL; + CP(*l_sig, *sig, sigev_signo); + PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); + break; + case L_SIGEV_NONE: + sig->sigev_notify = SIGEV_NONE; + break; + case L_SIGEV_THREAD: +#if 0 + /* Seems to not be used anywhere (anymore)? */ + sig->sigev_notify = SIGEV_THREAD; + return (ENOSYS); +#else + return (EINVAL); +#endif + case L_SIGEV_THREAD_ID: + sig->sigev_notify = SIGEV_THREAD_ID; + CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id); + CP(*l_sig, *sig, sigev_signo); + PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} + +int +linux_timer_create(struct thread *td, struct linux_timer_create_args *uap) +{ + struct l_sigevent l_ev; + struct sigevent ev, *evp; + int error, id; + + if (uap->evp == NULL) { + evp = NULL; + } else { + error = copyin(uap->evp, &l_ev, sizeof(l_ev)); + if (error != 0) + return (error); + error = linux_convert_l_sigevent(&l_ev, &ev); + if (error != 0) + return (error); + evp = &ev; + } + error = linux_convert_l_clockid(&uap->clock_id); + if (error != 0) + return (error); + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + if (error == 0) { + error = copyout(&id, uap->timerid, sizeof(int)); + if (error != 0) + kern_ktimer_delete(td, id); + } + return (error); +} + +int +linux_timer_settime(struct thread *td, struct linux_timer_settime_args *uap) +{ + struct l_itimerspec l_val, l_oval; + struct itimerspec val, oval, *ovalp; + int error; + + error = copyin(uap->new, &l_val, sizeof(l_val)); + if (error != 0) + return (error); + ITS_CP(l_val, val); + ovalp = uap->old != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->old != NULL) { + ITS_CP(oval, l_oval); + error = copyout(&l_oval, uap->old, sizeof(l_oval)); + } + return (error); +} + +int +linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *uap) +{ + struct l_itimerspec l_val; + struct itimerspec val; + int error; + + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) { + ITS_CP(val, l_val); + error = copyout(&l_val, uap->setting, sizeof(l_val)); + } + return (error); +} + +int +linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *uap) +{ + + return (kern_ktimer_getoverrun(td, uap->timerid)); +} + +int +linux_timer_delete(struct thread *td, struct linux_timer_delete_args *uap) +{ + + return (kern_ktimer_delete(td, uap->timerid)); +} + Added: head/sys/compat/linux/linux_timer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linux/linux_timer.h Thu Sep 18 08:36:45 2014 (r271743) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * 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 _LINUX_TIMER_H +#define _LINUX_TIMER_H + +#ifndef __LINUX_ARCH_SIGEV_PREAMBLE_SIZE +#define __LINUX_ARCH_SIGEV_PREAMBLE_SIZE \ + (sizeof(l_int) * 2 + sizeof(l_sigval_t)) +#endif + +#define LINUX_SIGEV_MAX_SIZE 64 +#define LINUX_SIGEV_PAD_SIZE \ + ((LINUX_SIGEV_MAX_SIZE - __LINUX_ARCH_SIGEV_PREAMBLE_SIZE) / \ + sizeof(l_int)) + +#define LINUX_CLOCK_REALTIME 0 +#define LINUX_CLOCK_MONOTONIC 1 +#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 +#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 +#define LINUX_CLOCK_MONOTONIC_RAW 4 +#define LINUX_CLOCK_REALTIME_COARSE 5 +#define LINUX_CLOCK_MONOTONIC_COARSE 6 +#define LINUX_CLOCK_BOOTTIME 7 +#define LINUX_CLOCK_REALTIME_ALARM 8 +#define LINUX_CLOCK_BOOTTIME_ALARM 9 +#define LINUX_CLOCK_SGI_CYCLE 10 +#define LINUX_CLOCK_TAI 11 + +#define L_SIGEV_SIGNAL 0 +#define L_SIGEV_NONE 1 +#define L_SIGEV_THREAD 2 +#define L_SIGEV_THREAD_ID 4 + +#define TS_CP(src,dst,fld) do { \ + CP((src).fld,(dst).fld,tv_sec); \ + CP((src).fld,(dst).fld,tv_nsec); \ +} while (0) + +#define ITS_CP(src, dst) do { \ + TS_CP((src), (dst), it_interval); \ + TS_CP((src), (dst), it_value); \ +} while (0) + +struct l_sigevent { + l_sigval_t sigev_value; + l_int sigev_signo; + l_int sigev_notify; + union { + l_int _pad[LINUX_SIGEV_PAD_SIZE]; + l_int _tid; + struct { + l_uintptr_t _function; + l_uintptr_t _attribute; + } _l_sigev_thread; + } _l_sigev_un; +} +#if defined(__amd64__) && defined(COMPAT_LINUX32) +__packed +#endif +; + +struct l_itimerspec { + struct l_timespec it_interval; + struct l_timespec it_value; +}; + +#endif /* _LINUX_TIMER_H */ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/conf/files.amd64 Thu Sep 18 08:36:45 2014 (r271743) @@ -477,6 +477,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux32 compat/linux/linux_sysctl.c optional compat_linux32 compat/linux/linux_time.c optional compat_linux32 +compat/linux/linux_timer.c optional compat_linux32 compat/linux/linux_uid16.c optional compat_linux32 compat/linux/linux_util.c optional compat_linux32 dev/amr/amr_linux.c optional compat_linux32 amr Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/conf/files.i386 Thu Sep 18 08:36:45 2014 (r271743) @@ -83,6 +83,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_time.c optional compat_linux +compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/ndis/kern_ndis.c optional ndisapi pci Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/conf/files.pc98 Thu Sep 18 08:36:45 2014 (r271743) @@ -55,6 +55,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_time.c optional compat_linux +compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/svr4/imgact_svr4.c optional compat_svr4 Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/i386/linux/linux.h Thu Sep 18 08:36:45 2014 (r271743) @@ -54,6 +54,11 @@ MALLOC_DECLARE(M_LINUX); #define PTRIN(v) (void *)(v) #define PTROUT(v) (l_uintptr_t)(v) +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) + /* * Provide a separate set of types for the Linux types. */ Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/i386/linux/linux_machdep.c Thu Sep 18 08:36:45 2014 (r271743) @@ -980,37 +980,6 @@ linux_get_thread_area(struct thread *td, return (0); } -/* copied from kern/kern_time.c */ -int -linux_timer_create(struct thread *td, struct linux_timer_create_args *args) -{ - return sys_ktimer_create(td, (struct ktimer_create_args *) args); -} - -int -linux_timer_settime(struct thread *td, struct linux_timer_settime_args *args) -{ - return sys_ktimer_settime(td, (struct ktimer_settime_args *) args); -} - -int -linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *args) -{ - return sys_ktimer_gettime(td, (struct ktimer_gettime_args *) args); -} - -int -linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *args) -{ - return sys_ktimer_getoverrun(td, (struct ktimer_getoverrun_args *) args); -} - -int -linux_timer_delete(struct thread *td, struct linux_timer_delete_args *args) -{ - return sys_ktimer_delete(td, (struct ktimer_delete_args *) args); -} - /* XXX: this wont work with module - convert it */ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/i386/linux/syscalls.master Thu Sep 18 08:36:45 2014 (r271743) @@ -439,7 +439,7 @@ 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } 259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ struct sigevent *evp, l_timer_t *timerid); } -260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, \ +260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ const struct itimerspec *new, struct itimerspec *old); } 261 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); } 262 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); } Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Thu Sep 18 06:47:48 2014 (r271742) +++ head/sys/modules/linux/Makefile Thu Sep 18 08:36:45 2014 (r271743) @@ -13,6 +13,7 @@ SRCS= linux_fork.c linux${SFX}_dummy.c l linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ + linux_timer.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ device_if.h bus_if.h assym.s From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 08:40:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67FF7F01; Thu, 18 Sep 2014 08:40:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39910FA1; Thu, 18 Sep 2014 08:40:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I8e39p097578; Thu, 18 Sep 2014 08:40:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I8e1x5097557; Thu, 18 Sep 2014 08:40:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409180840.s8I8e1x5097557@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Sep 2014 08:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271744 - in head/sys: amd64/linux32 i386/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 08:40:03 -0000 Author: bz Date: Thu Sep 18 08:40:00 2014 New Revision: 271744 URL: http://svnweb.freebsd.org/changeset/base/271744 Log: Re-gen after r271743 implementing most of timer_{create,settime,gettime,getoverrun,delete}. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/amd64/linux32/linux32_proto.h Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 271743 2014-09-18 08:36:45Z bz */ #ifndef _LINUX_SYSPROTO_H_ @@ -781,19 +781,25 @@ struct linux_set_tid_address_args { char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; }; struct linux_timer_create_args { - register_t dummy; + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)]; + char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)]; }; struct linux_timer_settime_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; + char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; }; struct linux_timer_gettime_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)]; }; struct linux_timer_getoverrun_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; }; struct linux_timer_delete_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; }; struct linux_clock_settime_args { char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/amd64/linux32/linux32_syscall.h Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 271743 2014-09-18 08:36:45Z bz */ #define LINUX_SYS_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/amd64/linux32/linux32_syscalls.c Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 271743 2014-09-18 08:36:45Z bz */ const char *linux_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/amd64/linux32/linux32_sysent.c Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 271743 2014-09-18 08:36:45Z bz */ #include "opt_compat.h" @@ -278,11 +278,11 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_remap_file_pages */ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_set_tid_address */ - { 0, (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ - { 0, (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 260 = linux_timer_settime */ - { 0, (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 261 = linux_timer_gettime */ - { 0, (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 262 = linux_timer_getoverrun */ - { 0, (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 263 = linux_timer_delete */ + { AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ + { AS(linux_timer_settime_args), (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 260 = linux_timer_settime */ + { AS(linux_timer_gettime_args), (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 261 = linux_timer_gettime */ + { AS(linux_timer_getoverrun_args), (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 262 = linux_timer_getoverrun */ + { AS(linux_timer_delete_args), (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 263 = linux_timer_delete */ { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 264 = linux_clock_settime */ { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 265 = linux_clock_gettime */ { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_clock_getres */ Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/amd64/linux32/linux32_systrace_args.c Thu Sep 18 08:40:00 2014 (r271744) @@ -1720,27 +1720,43 @@ systrace_args(int sysnum, void *params, } /* linux_timer_create */ case 259: { - *n_args = 0; + struct linux_timer_create_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + uarg[1] = (intptr_t) p->evp; /* struct sigevent * */ + uarg[2] = (intptr_t) p->timerid; /* l_timer_t * */ + *n_args = 3; break; } /* linux_timer_settime */ case 260: { - *n_args = 0; + struct linux_timer_settime_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */ + uarg[3] = (intptr_t) p->old; /* struct itimerspec * */ + *n_args = 4; break; } /* linux_timer_gettime */ case 261: { - *n_args = 0; + struct linux_timer_gettime_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + uarg[1] = (intptr_t) p->setting; /* struct itimerspec * */ + *n_args = 2; break; } /* linux_timer_getoverrun */ case 262: { - *n_args = 0; + struct linux_timer_getoverrun_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + *n_args = 1; break; } /* linux_timer_delete */ case 263: { - *n_args = 0; + struct linux_timer_delete_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + *n_args = 1; break; } /* linux_clock_settime */ @@ -4829,18 +4845,71 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timer_create */ case 259: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "struct sigevent *"; + break; + case 2: + p = "l_timer_t *"; + break; + default: + break; + }; break; /* linux_timer_settime */ case 260: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "const struct itimerspec *"; + break; + case 3: + p = "struct itimerspec *"; + break; + default: + break; + }; break; /* linux_timer_gettime */ case 261: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + case 1: + p = "struct itimerspec *"; + break; + default: + break; + }; break; /* linux_timer_getoverrun */ case 262: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + default: + break; + }; break; /* linux_timer_delete */ case 263: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + default: + break; + }; break; /* linux_clock_settime */ case 264: @@ -6413,14 +6482,29 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_timer_create */ case 259: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_settime */ case 260: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_gettime */ case 261: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_getoverrun */ case 262: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_delete */ case 263: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_clock_settime */ case 264: if (ndx == 0 || ndx == 1) Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/i386/linux/linux_proto.h Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/i386/linux/syscalls.master 271743 2014-09-18 08:36:45Z bz */ #ifndef _LINUX_SYSPROTO_H_ @@ -787,6 +787,7 @@ struct linux_timer_create_args { }; struct linux_timer_settime_args { char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; }; Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/i386/linux/linux_syscall.h Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/i386/linux/syscalls.master 271743 2014-09-18 08:36:45Z bz */ #define LINUX_SYS_exit 1 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/i386/linux/linux_syscalls.c Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/i386/linux/syscalls.master 271743 2014-09-18 08:36:45Z bz */ const char *linux_syscallnames[] = { Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/i386/linux/linux_sysent.c Thu Sep 18 08:40:00 2014 (r271744) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: head/sys/i386/linux/syscalls.master 271743 2014-09-18 08:36:45Z bz */ #include Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Thu Sep 18 08:36:45 2014 (r271743) +++ head/sys/i386/linux/linux_systrace_args.c Thu Sep 18 08:40:00 2014 (r271744) @@ -1781,9 +1781,10 @@ systrace_args(int sysnum, void *params, case 260: { struct linux_timer_settime_args *p = params; iarg[0] = p->timerid; /* l_timer_t */ - uarg[1] = (intptr_t) p->new; /* const struct itimerspec * */ - uarg[2] = (intptr_t) p->old; /* struct itimerspec * */ - *n_args = 3; + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */ + uarg[3] = (intptr_t) p->old; /* struct itimerspec * */ + *n_args = 4; break; } /* linux_timer_gettime */ @@ -5012,9 +5013,12 @@ systrace_entry_setargdesc(int sysnum, in p = "l_timer_t"; break; case 1: - p = "const struct itimerspec *"; + p = "l_int"; break; case 2: + p = "const struct itimerspec *"; + break; + case 3: p = "struct itimerspec *"; break; default: From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 08:56:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3372E840; Thu, 18 Sep 2014 08:56:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EABB22D; Thu, 18 Sep 2014 08:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I8uPwM006696; Thu, 18 Sep 2014 08:56:25 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I8uPH9006695; Thu, 18 Sep 2014 08:56:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409180856.s8I8uPH9006695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Sep 2014 08:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271745 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 08:56:26 -0000 Author: bz Date: Thu Sep 18 08:56:25 2014 New Revision: 271745 URL: http://svnweb.freebsd.org/changeset/base/271745 Log: For consistency with the shared header file (and to avoid confusion with mbufs normally called *m in one place), rename the function arguments to "mem". This is a non-functional change. Reviewed by: gnn, eric.joyner intel.com MFC after: 3 days Modified: head/sys/dev/ixl/i40e_osdep.c Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Thu Sep 18 08:40:00 2014 (r271744) +++ head/sys/dev/ixl/i40e_osdep.c Thu Sep 18 08:56:25 2014 (r271745) @@ -49,21 +49,21 @@ i40e_dmamap_cb(void *arg, bus_dma_segmen } i40e_status -i40e_allocate_virt(struct i40e_hw *hw, struct i40e_virt_mem *m, u32 size) +i40e_allocate_virt(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size) { - m->va = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - return(m->va == NULL); + mem->va = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); + return(mem->va == NULL); } i40e_status -i40e_free_virt(struct i40e_hw *hw, struct i40e_virt_mem *m) +i40e_free_virt(struct i40e_hw *hw, struct i40e_virt_mem *mem) { - free(m->va, M_DEVBUF); + free(mem->va, M_DEVBUF); return(0); } i40e_status -i40e_allocate_dma(struct i40e_hw *hw, struct i40e_dma_mem *dma, +i40e_allocate_dma(struct i40e_hw *hw, struct i40e_dma_mem *mem, bus_size_t size, u32 alignment) { device_t dev = ((struct i40e_osdep *)hw->back)->dev; @@ -81,25 +81,25 @@ i40e_allocate_dma(struct i40e_hw *hw, st BUS_DMA_ALLOCNOW, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ - &dma->tag); + &mem->tag); if (err != 0) { device_printf(dev, "i40e_allocate_dma: bus_dma_tag_create failed, " "error %u\n", err); goto fail_0; } - err = bus_dmamem_alloc(dma->tag, (void **)&dma->va, - BUS_DMA_NOWAIT | BUS_DMA_ZERO, &dma->map); + err = bus_dmamem_alloc(mem->tag, (void **)&mem->va, + BUS_DMA_NOWAIT | BUS_DMA_ZERO, &mem->map); if (err != 0) { device_printf(dev, "i40e_allocate_dma: bus_dmamem_alloc failed, " "error %u\n", err); goto fail_1; } - err = bus_dmamap_load(dma->tag, dma->map, dma->va, + err = bus_dmamap_load(mem->tag, mem->map, mem->va, size, i40e_dmamap_cb, - &dma->pa, + &mem->pa, BUS_DMA_NOWAIT); if (err != 0) { device_printf(dev, @@ -107,28 +107,28 @@ i40e_allocate_dma(struct i40e_hw *hw, st "error %u\n", err); goto fail_2; } - dma->size = size; - bus_dmamap_sync(dma->tag, dma->map, + mem->size = size; + bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); return (0); fail_2: - bus_dmamem_free(dma->tag, dma->va, dma->map); + bus_dmamem_free(mem->tag, mem->va, mem->map); fail_1: - bus_dma_tag_destroy(dma->tag); + bus_dma_tag_destroy(mem->tag); fail_0: - dma->map = NULL; - dma->tag = NULL; + mem->map = NULL; + mem->tag = NULL; return (err); } i40e_status -i40e_free_dma(struct i40e_hw *hw, struct i40e_dma_mem *dma) +i40e_free_dma(struct i40e_hw *hw, struct i40e_dma_mem *mem) { - bus_dmamap_sync(dma->tag, dma->map, + bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(dma->tag, dma->map); - bus_dmamem_free(dma->tag, dma->va, dma->map); - bus_dma_tag_destroy(dma->tag); + bus_dmamap_unload(mem->tag, mem->map); + bus_dmamem_free(mem->tag, mem->va, mem->map); + bus_dma_tag_destroy(mem->tag); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 08:58:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D515D9B1; Thu, 18 Sep 2014 08:58:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE49324B; Thu, 18 Sep 2014 08:58:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I8wOAl007001; Thu, 18 Sep 2014 08:58:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I8wNGo006992; Thu, 18 Sep 2014 08:58:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409180858.s8I8wNGo006992@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Sep 2014 08:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271746 - in stable/10/sys: arm/conf netinet netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 08:58:25 -0000 Author: tuexen Date: Thu Sep 18 08:58:22 2014 New Revision: 271746 URL: http://svnweb.freebsd.org/changeset/base/271746 Log: MFC r270673: Announce SCTP support in the kern.features sysctl variables. MFC r270859: Enable SCTP support. It runs perfectly fine on a Wandboard quad. MFC r271204 with manual intervention: Fix the handling of sysctl variables when used with VIMAGE. While there do some cleanup of the code. MFC r271209: Fix a leak of an address, if the address is scheduled for removal and the stack is torn down. Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the issue. MFC r271219: Use SYSCTL_PROC instead of SYSCTL_VNET_PROC. Suggested by: glebius@ MFC r271221: Use union sctp_sockstore instead of struct sockaddr_storage. This eliminates some warnings when building in userland. Thanks to Patrick Laimbock for reporting this issue. Remove also some unnecessary casts. There should be no functional change. MFC r271228: Address another warnings reported by Patrick Laimbock when compiling in userspace. While there, improve consistency. MFC r271230: Address warnings generated by the clang analyzer. Approved by: re (kib) Modified: stable/10/sys/arm/conf/IMX6 stable/10/sys/netinet/sctp_asconf.c stable/10/sys/netinet/sctp_constants.h stable/10/sys/netinet/sctp_input.c stable/10/sys/netinet/sctp_os_bsd.h stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_sysctl.c stable/10/sys/netinet/sctp_sysctl.h stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c stable/10/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/IMX6 ============================================================================== --- stable/10/sys/arm/conf/IMX6 Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/arm/conf/IMX6 Thu Sep 18 08:58:22 2014 (r271746) @@ -25,7 +25,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -#options SCTP # Stream Control Transmission Protocol +options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: stable/10/sys/netinet/sctp_asconf.c ============================================================================== --- stable/10/sys/netinet/sctp_asconf.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_asconf.c Thu Sep 18 08:58:22 2014 (r271746) @@ -148,7 +148,7 @@ sctp_process_asconf_add_ip(struct sockad { struct sctp_nets *net; struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_store; + union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; @@ -177,7 +177,7 @@ sctp_process_asconf_add_ip(struct sockad #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); #endif - sa = (struct sockaddr *)&sa_store; + sa = &store.sa; switch (param_type) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -186,7 +186,7 @@ sctp_process_asconf_add_ip(struct sockad return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; - sin = (struct sockaddr_in *)&sa_store; + sin = &store.sin; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); @@ -209,7 +209,7 @@ sctp_process_asconf_add_ip(struct sockad return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; - sin6 = (struct sockaddr_in6 *)&sa_store; + sin6 = &store.sin6; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); @@ -302,7 +302,7 @@ sctp_process_asconf_delete_ip(struct soc struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_store; + union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; @@ -331,7 +331,7 @@ sctp_process_asconf_delete_ip(struct soc #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); #endif - sa = (struct sockaddr *)&sa_store; + sa = &store.sa; switch (param_type) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -340,7 +340,7 @@ sctp_process_asconf_delete_ip(struct soc return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; - sin = (struct sockaddr_in *)&sa_store; + sin = &store.sin; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); @@ -360,7 +360,7 @@ sctp_process_asconf_delete_ip(struct soc return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; - sin6 = (struct sockaddr_in6 *)&sa_store; + sin6 = &store.sin6; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); @@ -437,7 +437,7 @@ sctp_process_asconf_set_primary(struct s struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_store; + union sctp_sockstore store; struct sctp_paramhdr *ph; uint16_t param_type, aparam_length; @@ -465,7 +465,7 @@ sctp_process_asconf_set_primary(struct s #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); #endif - sa = (struct sockaddr *)&sa_store; + sa = &store.sa; switch (param_type) { #ifdef INET case SCTP_IPV4_ADDRESS: @@ -474,7 +474,7 @@ sctp_process_asconf_set_primary(struct s return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; - sin = (struct sockaddr_in *)&sa_store; + sin = &store.sin; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); @@ -492,7 +492,7 @@ sctp_process_asconf_set_primary(struct s return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; - sin6 = (struct sockaddr_in6 *)&sa_store; + sin6 = &store.sin6; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); @@ -1268,7 +1268,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sa; + sin6 = &ifa->address.sin6; aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + @@ -1283,7 +1283,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sa; + sin = &ifa->address.sin; aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + @@ -1925,7 +1925,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* we skip unspecifed addresses */ return; @@ -1958,7 +1958,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * SCTP_IPV6_V6ONLY(inp6)) return; - sin = (struct sockaddr_in *)&ifa->address.sa; + sin = &ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* we skip unspecifed addresses */ return; @@ -2115,7 +2115,7 @@ sctp_asconf_iterator_stcb(struct sctp_in else continue; } - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* we skip unspecifed addresses */ continue; @@ -2149,7 +2149,7 @@ sctp_asconf_iterator_stcb(struct sctp_in SCTP_IPV6_V6ONLY(inp6)) continue; - sin = (struct sockaddr_in *)&ifa->address.sa; + sin = &ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* we skip unspecifed addresses */ continue; @@ -2466,7 +2466,7 @@ sctp_find_valid_localaddr(struct sctp_tc if (stcb->asoc.scope.ipv4_addr_legal) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sctp_ifa->address.sa; + sin = &sctp_ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* skip unspecifed addresses */ continue; @@ -2500,7 +2500,7 @@ sctp_find_valid_localaddr(struct sctp_tc if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { continue; } - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; + sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* * we skip unspecifed @@ -2772,18 +2772,16 @@ sctp_process_initack_addresses(struct sc struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; + union sctp_sockstore store; #ifdef INET6 struct sctp_ipv6addr_param addr6_store; - struct sockaddr_in6 sin6; #endif #ifdef INET struct sctp_ipv4addr_param addr4_store; - struct sockaddr_in sin; #endif - struct sockaddr *sa; uint32_t vrf_id; SCTPDBG(SCTP_DEBUG_ASCONF2, "processing init-ack addresses\n"); @@ -2796,21 +2794,6 @@ sctp_process_initack_addresses(struct sc if ((offset + sizeof(struct sctp_paramhdr)) > length) { return; } - /* init the addresses */ -#ifdef INET6 - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(sin6); - sin6.sin6_port = stcb->rport; -#endif - -#ifdef INET - bzero(&sin, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_len = sizeof(sin); - sin.sin_port = stcb->rport; -#endif - /* go through the addresses in the init-ack */ ph = (struct sctp_paramhdr *) sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr), @@ -2833,9 +2816,11 @@ sctp_process_initack_addresses(struct sc a6p == NULL) { return; } - memcpy(&sin6.sin6_addr, a6p->addr, - sizeof(struct in6_addr)); - sa = (struct sockaddr *)&sin6; + memset(&store, 0, sizeof(union sctp_sockstore)); + store.sin6.sin6_family = AF_INET6; + store.sin6.sin6_len = sizeof(struct sockaddr_in6); + store.sin6.sin6_port = stcb->rport; + memcpy(&store.sin6.sin6_addr, a6p->addr, sizeof(struct in6_addr)); break; } #endif @@ -2852,8 +2837,11 @@ sctp_process_initack_addresses(struct sc a4p == NULL) { return; } - sin.sin_addr.s_addr = a4p->addr; - sa = (struct sockaddr *)&sin; + memset(&store, 0, sizeof(union sctp_sockstore)); + store.sin.sin_family = AF_INET; + store.sin.sin_len = sizeof(struct sockaddr_in); + store.sin.sin_port = stcb->rport; + store.sin.sin_addr.s_addr = a4p->addr; break; } #endif @@ -2867,7 +2855,7 @@ sctp_process_initack_addresses(struct sc } else { vrf_id = SCTP_DEFAULT_VRFID; } - sctp_ifa = sctp_find_ifa_by_addr(sa, vrf_id, + sctp_ifa = sctp_find_ifa_by_addr(&store.sa, vrf_id, SCTP_ADDR_NOT_LOCKED); if (sctp_ifa == NULL) { /* address doesn't exist anymore */ @@ -2878,7 +2866,7 @@ sctp_process_initack_addresses(struct sc SCTP_PCB_FLAGS_DO_ASCONF)) && stcb->asoc.asconf_supported) { /* queue an ASCONF DEL_IP_ADDRESS */ - status = sctp_asconf_queue_sa_delete(stcb, sa); + status = sctp_asconf_queue_sa_delete(stcb, &store.sa); /* * if queued ok, and in correct state, send * out the ASCONF. @@ -3125,7 +3113,7 @@ sctp_check_address_list_all(struct sctp_ switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - sin = (struct sockaddr_in *)&sctp_ifa->address.sin; + sin = &sctp_ifa->address.sin; if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred, &sin->sin_addr) != 0) { continue; @@ -3139,7 +3127,7 @@ sctp_check_address_list_all(struct sctp_ #endif #ifdef INET6 case AF_INET6: - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6; + sin6 = &sctp_ifa->address.sin6; if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred, &sin6->sin6_addr) != 0) { continue; Modified: stable/10/sys/netinet/sctp_constants.h ============================================================================== --- stable/10/sys/netinet/sctp_constants.h Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_constants.h Thu Sep 18 08:58:22 2014 (r271746) @@ -267,18 +267,9 @@ __FBSDID("$FreeBSD$"); /* how many addresses per assoc remote and local */ #define SCTP_SCALE_FOR_ADDR 2 -/* default AUTO_ASCONF mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_AUTO_ASCONF 1 - /* default MULTIPLE_ASCONF mode enable(1)/disable(0) value (sysctl) */ #define SCTP_DEFAULT_MULTIPLE_ASCONFS 0 -/* default MOBILITY_BASE mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_MOBILITY_BASE 0 - -/* default MOBILITY_FASTHANDOFF mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_MOBILITY_FASTHANDOFF 0 - /* * Theshold for rwnd updates, we have to read (sb_hiwat >> * SCTP_RWND_HIWAT_SHIFT) before we will look to see if we need to send a Modified: stable/10/sys/netinet/sctp_input.c ============================================================================== --- stable/10/sys/netinet/sctp_input.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_input.c Thu Sep 18 08:58:22 2014 (r271746) @@ -562,21 +562,12 @@ static void sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net) { - struct sockaddr_storage store; + union sctp_sockstore store; struct sctp_nets *r_net, *f_net; struct timeval tv; int req_prim = 0; uint16_t old_error_counter; -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif - if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_heartbeat_chunk)) { /* Invalid length */ return; @@ -586,12 +577,11 @@ sctp_handle_heartbeat_ack(struct sctp_he #ifdef INET case AF_INET: if (cp->heartbeat.hb_info.addr_len == sizeof(struct sockaddr_in)) { - sin = (struct sockaddr_in *)&store; - sin->sin_family = cp->heartbeat.hb_info.addr_family; - sin->sin_len = cp->heartbeat.hb_info.addr_len; - sin->sin_port = stcb->rport; - memcpy(&sin->sin_addr, cp->heartbeat.hb_info.address, - sizeof(sin->sin_addr)); + store.sin.sin_family = cp->heartbeat.hb_info.addr_family; + store.sin.sin_len = cp->heartbeat.hb_info.addr_len; + store.sin.sin_port = stcb->rport; + memcpy(&store.sin.sin_addr, cp->heartbeat.hb_info.address, + sizeof(store.sin.sin_addr)); } else { return; } @@ -600,12 +590,10 @@ sctp_handle_heartbeat_ack(struct sctp_he #ifdef INET6 case AF_INET6: if (cp->heartbeat.hb_info.addr_len == sizeof(struct sockaddr_in6)) { - sin6 = (struct sockaddr_in6 *)&store; - sin6->sin6_family = cp->heartbeat.hb_info.addr_family; - sin6->sin6_len = cp->heartbeat.hb_info.addr_len; - sin6->sin6_port = stcb->rport; - memcpy(&sin6->sin6_addr, cp->heartbeat.hb_info.address, - sizeof(sin6->sin6_addr)); + store.sin6.sin6_family = cp->heartbeat.hb_info.addr_family; + store.sin6.sin6_len = cp->heartbeat.hb_info.addr_len; + store.sin6.sin6_port = stcb->rport; + memcpy(&store.sin6.sin6_addr, cp->heartbeat.hb_info.address, sizeof(struct in6_addr)); } else { return; } @@ -614,7 +602,7 @@ sctp_handle_heartbeat_ack(struct sctp_he default: return; } - r_net = sctp_findnet(stcb, (struct sockaddr *)&store); + r_net = sctp_findnet(stcb, &store.sa); if (r_net == NULL) { SCTPDBG(SCTP_DEBUG_INPUT1, "Huh? I can't find the address I sent it to, discard\n"); return; @@ -2030,22 +2018,13 @@ sctp_process_cookie_new(struct mbuf *m, struct sctp_tcb *stcb; struct sctp_init_chunk *init_cp, init_buf; struct sctp_init_ack_chunk *initack_cp, initack_buf; - struct sockaddr_storage sa_store; - struct sockaddr *initack_src = (struct sockaddr *)&sa_store; + union sctp_sockstore store; struct sctp_association *asoc; int init_offset, initack_offset, initack_limit; int retval; int error = 0; uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE]; -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -2269,23 +2248,20 @@ sctp_process_cookie_new(struct mbuf *m, #ifdef INET case SCTP_IPV4_ADDRESS: /* source addr is IPv4 */ - sin = (struct sockaddr_in *)initack_src; - memset(sin, 0, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_addr.s_addr = cookie->laddress[0]; + memset(&store.sin, 0, sizeof(struct sockaddr_in)); + store.sin.sin_family = AF_INET; + store.sin.sin_len = sizeof(struct sockaddr_in); + store.sin.sin_addr.s_addr = cookie->laddress[0]; break; #endif #ifdef INET6 case SCTP_IPV6_ADDRESS: /* source addr is IPv6 */ - sin6 = (struct sockaddr_in6 *)initack_src; - memset(sin6, 0, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_scope_id = cookie->scope_id; - memcpy(&sin6->sin6_addr, cookie->laddress, - sizeof(sin6->sin6_addr)); + memset(&store.sin6, 0, sizeof(struct sockaddr_in6)); + store.sin6.sin6_family = AF_INET6; + store.sin6.sin6_len = sizeof(struct sockaddr_in6); + store.sin6.sin6_scope_id = cookie->scope_id; + memcpy(&store.sin6.sin6_addr, cookie->laddress, sizeof(struct in6_addr)); break; #endif default: @@ -2366,7 +2342,7 @@ sctp_process_cookie_new(struct mbuf *m, sctp_check_address_list(stcb, m, initack_offset + sizeof(struct sctp_init_ack_chunk), initack_limit - (initack_offset + sizeof(struct sctp_init_ack_chunk)), - initack_src, cookie->local_scope, cookie->site_scope, + &store.sa, cookie->local_scope, cookie->site_scope, cookie->ipv4_scope, cookie->loopback_scope); @@ -2906,9 +2882,9 @@ sctp_handle_cookie_ack(struct sctp_cooki SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_cookie_ack: handling COOKIE-ACK\n"); - if (stcb == NULL) + if ((stcb == NULL) || (net == NULL)) { return; - + } asoc = &stcb->asoc; sctp_stop_all_cookie_timers(stcb); Modified: stable/10/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 08:58:22 2014 (r271746) @@ -152,16 +152,10 @@ MALLOC_DECLARE(SCTP_M_MCORE); #define V_system_base_info VNET(system_base_info) #define SCTP_BASE_INFO(__m) V_system_base_info.sctppcbinfo.__m #define SCTP_BASE_STATS V_system_base_info.sctpstat -#define SCTP_BASE_STATS_SYSCTL VNET_NAME(system_base_info.sctpstat) -#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m -#define SCTP_BASE_SYSCTL(__m) VNET_NAME(system_base_info.sctpsysctl.__m) +#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m +#define SCTP_BASE_SYSCTL(__m) V_system_base_info.sctpsysctl.__m #define SCTP_BASE_VAR(__m) V_system_base_info.__m -/* - * - */ -#define USER_ADDR_NULL (NULL) /* FIX ME: temp */ - #define SCTP_PRINTF(params...) printf(params) #if defined(SCTP_DEBUG) #define SCTPDBG(level, params...) \ @@ -175,9 +169,9 @@ MALLOC_DECLARE(SCTP_M_MCORE); #define SCTPDBG_ADDR(level, addr) \ { \ do { \ - if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ - sctp_print_address(addr); \ - } \ + if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ + sctp_print_address(addr); \ + } \ } while (0); \ } #else Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_output.c Thu Sep 18 08:58:22 2014 (r271746) @@ -1881,7 +1881,7 @@ sctp_is_address_in_scope(struct sctp_ifa if (scope->ipv4_addr_legal) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sin; + sin = &ifa->address.sin; if (sin->sin_addr.s_addr == 0) { /* not in scope , unspecified */ return (0); @@ -1912,7 +1912,7 @@ sctp_is_address_in_scope(struct sctp_ifa return (0); } /* ok to use deprecated addresses? */ - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* skip unspecifed addresses */ return (0); @@ -1987,7 +1987,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct sctp_ipv4addr_param *ipv4p; struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sin; + sin = &ifa->address.sin; ipv4p = (struct sctp_ipv4addr_param *)parmh; parmh->param_type = htons(SCTP_IPV4_ADDRESS); parmh->param_length = htons(plen); @@ -2002,7 +2002,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct sctp_ipv6addr_param *ipv6p; struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; + sin6 = &ifa->address.sin6; ipv6p = (struct sctp_ipv6addr_param *)parmh; parmh->param_type = htons(SCTP_IPV6_ADDRESS); parmh->param_length = htons(plen); @@ -5921,8 +5921,8 @@ do_a_abort: parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); ph->param_type = htons(SCTP_HAS_NAT_SUPPORT); - ph->param_length = htons(sizeof(struct sctp_paramhdr)); - chunk_len += sizeof(struct sctp_paramhdr); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; } /* And now tell the peer which extensions we support */ num_ext = 0; @@ -13552,7 +13552,7 @@ sctp_v4src_match_nexthop(struct sctp_ifa } ifa = (struct ifaddr *)sifa->ifa; mask = (struct sockaddr_in *)(ifa->ifa_netmask); - sin = (struct sockaddr_in *)&sifa->address.sin; + sin = &sifa->address.sin; srcnetaddr.s_addr = (sin->sin_addr.s_addr & mask->sin_addr.s_addr); SCTPDBG(SCTP_DEBUG_OUTPUT1, "match_nexthop4: src address is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, &sifa->address.sa); Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 08:58:22 2014 (r271746) @@ -625,7 +625,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sctp_ifap->address.sin; + sin = &sctp_ifap->address.sin; if (SCTP_IFN_IS_IFT_LOOP(sctp_ifap->ifn_p) || (IN4_ISLOOPBACK_ADDRESS(&sin->sin_addr))) { sctp_ifap->src_is_loop = 1; @@ -645,7 +645,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo /* ok to use deprecated addresses? */ struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&sctp_ifap->address.sin6; + sin6 = &sctp_ifap->address.sin6; if (SCTP_IFN_IS_IFT_LOOP(sctp_ifap->ifn_p) || (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))) { sctp_ifap->src_is_loop = 1; @@ -974,7 +974,7 @@ sctp_does_stcb_own_this_addr(struct sctp { struct sockaddr_in *sin, *rsin; - sin = (struct sockaddr_in *)&laddr->ifa->address.sin; + sin = &laddr->ifa->address.sin; rsin = (struct sockaddr_in *)to; if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { SCTP_IPI_ADDR_RUNLOCK(); @@ -988,7 +988,7 @@ sctp_does_stcb_own_this_addr(struct sctp { struct sockaddr_in6 *sin6, *rsin6; - sin6 = (struct sockaddr_in6 *)&laddr->ifa->address.sin6; + sin6 = &laddr->ifa->address.sin6; rsin6 = (struct sockaddr_in6 *)to; if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { SCTP_IPI_ADDR_RUNLOCK(); @@ -2330,7 +2330,7 @@ sctp_findassociation_ep_asconf(struct mb struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) { struct sctp_tcb *stcb; - struct sockaddr_storage remote_store; + union sctp_sockstore remote_store; struct sctp_paramhdr parm_buf, *phdr; int ptype; int zero_address = 0; @@ -2372,7 +2372,7 @@ sctp_findassociation_ep_asconf(struct mb __FUNCTION__); return (NULL); } - sin6 = (struct sockaddr_in6 *)&remote_store; + sin6 = &remote_store.sin6; sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sin6->sin6_port = sh->src_port; @@ -2399,7 +2399,7 @@ sctp_findassociation_ep_asconf(struct mb __FUNCTION__); return (NULL); } - sin = (struct sockaddr_in *)&remote_store; + sin = &remote_store.sin; sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_port = sh->src_port; @@ -2422,7 +2422,7 @@ sctp_findassociation_ep_asconf(struct mb } } else { stcb = sctp_findassociation_ep_addr(inp_p, - (struct sockaddr *)&remote_store, netp, + &remote_store.sa, netp, dst, NULL); } return (stcb); @@ -3130,31 +3130,21 @@ continue_anyway: * too (before adding). */ struct sctp_ifa *ifa; - struct sockaddr_storage store_sa; + union sctp_sockstore store; - memset(&store_sa, 0, sizeof(store_sa)); + memset(&store, 0, sizeof(store)); switch (addr->sa_family) { #ifdef INET case AF_INET: - { - struct sockaddr_in *sin; - - sin = (struct sockaddr_in *)&store_sa; - memcpy(sin, addr, sizeof(struct sockaddr_in)); - sin->sin_port = 0; - break; - } + memcpy(&store.sin, addr, sizeof(struct sockaddr_in)); + store.sin.sin_port = 0; + break; #endif #ifdef INET6 case AF_INET6: - { - struct sockaddr_in6 *sin6; - - sin6 = (struct sockaddr_in6 *)&store_sa; - memcpy(sin6, addr, sizeof(struct sockaddr_in6)); - sin6->sin6_port = 0; - break; - } + memcpy(&store.sin6, addr, sizeof(struct sockaddr_in6)); + store.sin6.sin6_port = 0; + break; #endif default: break; @@ -3172,7 +3162,7 @@ continue_anyway: * pass things in via the sctp_ifap argument * (Panda). */ - ifa = sctp_find_ifa_by_addr((struct sockaddr *)&store_sa, + ifa = sctp_find_ifa_by_addr(&store.sa, vrf_id, SCTP_ADDR_NOT_LOCKED); } if (ifa == NULL) { @@ -5980,6 +5970,9 @@ sctp_pcb_finish(void) LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { LIST_REMOVE(wi, sctp_nxt_addr); SCTP_DECR_LADDR_COUNT(); + if (wi->action == SCTP_DEL_IP_ADDRESS) { + SCTP_FREE(wi->ifa, SCTP_M_IFA); + } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), wi); } SCTP_WQ_ADDR_UNLOCK(); @@ -6134,7 +6127,6 @@ sctp_load_addresses_from_init(struct sct peer_supports_prsctp = 0; peer_supports_auth = 0; peer_supports_asconf = 0; - peer_supports_asconf = 0; peer_supports_reconfig = 0; peer_supports_nrsack = 0; peer_supports_pktdrop = 0; Modified: stable/10/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/10/sys/netinet/sctp_sysctl.c Thu Sep 18 08:56:25 2014 (r271745) +++ stable/10/sys/netinet/sctp_sysctl.c Thu Sep 18 08:58:22 2014 (r271746) @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +FEATURE(sctp, "Stream Control Transmission Protocol"); /* * sysctl tunable variables @@ -102,9 +105,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_min_residual) = SCTPCTL_MIN_RESIDUAL_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_retran_chunk) = SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT; SCTP_BASE_SYSCTL(sctp_logging_level) = SCTPCTL_LOGGING_LEVEL_DEFAULT; - /* JRS - Variable for default congestion control module */ SCTP_BASE_SYSCTL(sctp_default_cc_module) = SCTPCTL_DEFAULT_CC_MODULE_DEFAULT; - /* RS - Variable for default stream scheduling module */ SCTP_BASE_SYSCTL(sctp_default_ss_module) = SCTPCTL_DEFAULT_SS_MODULE_DEFAULT; SCTP_BASE_SYSCTL(sctp_default_frag_interleave) = SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DEFAULT; SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT; @@ -127,7 +128,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; #if defined(SCTP_DEBUG) SCTP_BASE_SYSCTL(sctp_debug_on) = SCTPCTL_DEBUG_DEFAULT; -printf("debug = %d.\n", SCTP_BASE_SYSCTL(sctp_debug_on)); #endif #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_BASE_SYSCTL(sctp_output_unlocked) = SCTPCTL_OUTPUT_UNLOCKED_DEFAULT; @@ -137,7 +137,7 @@ printf("debug = %d.\n", SCTP_BASE_SYSCTL /* It returns an upper limit. No filtering is done here */ static unsigned int -number_of_addresses(struct sctp_inpcb *inp) +sctp_sysctl_number_of_addresses(struct sctp_inpcb *inp) { unsigned int cnt; struct sctp_vrf *vrf; @@ -187,7 +187,7 @@ number_of_addresses(struct sctp_inpcb *i } static int -copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) +sctp_sysctl_copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) { struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; @@ -252,7 +252,7 @@ copy_out_local_addresses(struct sctp_inp if (ipv4_addr_legal) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sctp_ifa->address.sa; + sin = &sctp_ifa->address.sin; if (sin->sin_addr.s_addr == 0) continue; if (prison_check_ip4(inp->ip_inp.inp.inp_cred, @@ -271,7 +271,7 @@ copy_out_local_addresses(struct sctp_inp if (ipv6_addr_legal) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; + sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) continue; if (prison_check_ip6(inp->ip_inp.inp.inp_cred, @@ -353,7 +353,7 @@ copy_out_local_addresses(struct sctp_inp * sysctl functions */ static int -sctp_assoclist(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) { unsigned int number_of_endpoints; unsigned int number_of_local_addresses; @@ -375,14 +375,14 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) number_of_remote_addresses = 0; SCTP_INP_INFO_RLOCK(); - if (req->oldptr == USER_ADDR_NULL) { + if (req->oldptr == NULL) { LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); number_of_endpoints++; - number_of_local_addresses += number_of_addresses(inp); + number_of_local_addresses += sctp_sysctl_number_of_addresses(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { number_of_associations++; - number_of_local_addresses += number_of_addresses(inp); + number_of_local_addresses += sctp_sysctl_number_of_addresses(inp); TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { number_of_remote_addresses++; } @@ -399,7 +399,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) req->oldidx = (n + n / 8); return (0); } - if (req->newptr != USER_ADDR_NULL) { + if (req->newptr != NULL) { SCTP_INP_INFO_RUNLOCK(); SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); @@ -437,7 +437,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) } SCTP_INP_INFO_RLOCK(); SCTP_INP_RLOCK(inp); - error = copy_out_local_addresses(inp, NULL, req); + error = sctp_sysctl_copy_out_local_addresses(inp, NULL, req); if (error) { SCTP_INP_DECR_REF(inp); return (error); @@ -488,7 +488,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) } SCTP_INP_INFO_RLOCK(); SCTP_INP_RLOCK(inp); - error = copy_out_local_addresses(inp, stcb, req); + error = sctp_sysctl_copy_out_local_addresses(inp, stcb, req); if (error) { SCTP_INP_DECR_REF(inp); atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -556,196 +556,97 @@ skip: return (error); } - -#define RANGECHK(var, min, max) \ - if ((var) < (min)) { (var) = (min); } \ - else if ((var) > (max)) { (var) = (max); } - static int -sysctl_sctp_udp_tunneling_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_udp_tunneling(SYSCTL_HANDLER_ARGS) { int error; - uint32_t old_sctp_udp_tunneling_port; + uint32_t old, new; SCTP_INP_INFO_RLOCK(); - old_sctp_udp_tunneling_port = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); + old = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); SCTP_INP_INFO_RUNLOCK(); - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), SCTPCTL_UDP_TUNNELING_PORT_MIN, SCTPCTL_UDP_TUNNELING_PORT_MAX); - if (old_sctp_udp_tunneling_port == SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { - error = 0; - goto out; - } - SCTP_INP_INFO_WLOCK(); - if (old_sctp_udp_tunneling_port) { - sctp_over_udp_stop(); - } - if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { - if (sctp_over_udp_start()) { - SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = 0; + new = old; + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < SCTPCTL_UDP_TUNNELING_PORT_MIN) || + (new > SCTPCTL_UDP_TUNNELING_PORT_MAX)) { + error = EINVAL; + } else { + SCTP_INP_INFO_WLOCK(); + SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = new; + if (old != 0) { + sctp_over_udp_stop(); } + if (new != 0) { + error = sctp_over_udp_start(); + } + SCTP_INP_INFO_WUNLOCK(); } - SCTP_INP_INFO_WUNLOCK(); } -out: return (error); } static int -sysctl_sctp_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_auth(SYSCTL_HANDLER_ARGS) { int error; + uint32_t new; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pr_enable), SCTPCTL_PR_ENABLE_MIN, SCTPCTL_PR_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_reconfig_enable), SCTPCTL_RECONFIG_ENABLE_MIN, SCTPCTL_RECONFIG_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pktdrop_enable), SCTPCTL_PKTDROP_ENABLE_MIN, SCTPCTL_PKTDROP_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), SCTPCTL_MAXCHUNKS_MIN, SCTPCTL_MAXCHUNKS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_hashtblsize), SCTPCTL_TCBHASHSIZE_MIN, SCTPCTL_TCBHASHSIZE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pcbtblsize), SCTPCTL_PCBHASHSIZE_MIN, SCTPCTL_PCBHASHSIZE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_min_split_point), SCTPCTL_MIN_SPLIT_POINT_MIN, SCTPCTL_MIN_SPLIT_POINT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_chunkscale), SCTPCTL_CHUNKSCALE_MIN, SCTPCTL_CHUNKSCALE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), SCTPCTL_DELAYED_SACK_TIME_MIN, SCTPCTL_DELAYED_SACK_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_sack_freq_default), SCTPCTL_SACK_FREQ_MIN, SCTPCTL_SACK_FREQ_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), SCTPCTL_SYS_RESOURCE_MIN, SCTPCTL_SYS_RESOURCE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), SCTPCTL_ASOC_RESOURCE_MIN, SCTPCTL_ASOC_RESOURCE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), SCTPCTL_HEARTBEAT_INTERVAL_MIN, SCTPCTL_HEARTBEAT_INTERVAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), SCTPCTL_PMTU_RAISE_TIME_MIN, SCTPCTL_PMTU_RAISE_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), SCTPCTL_SHUTDOWN_GUARD_TIME_MIN, SCTPCTL_SHUTDOWN_GUARD_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), SCTPCTL_SECRET_LIFETIME_MIN, SCTPCTL_SECRET_LIFETIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_max_default), SCTPCTL_RTO_MAX_MIN, SCTPCTL_RTO_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_min_default), SCTPCTL_RTO_MIN_MIN, SCTPCTL_RTO_MIN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_initial_default), SCTPCTL_RTO_INITIAL_MIN, SCTPCTL_RTO_INITIAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rto_max_default), SCTPCTL_INIT_RTO_MAX_MIN, SCTPCTL_INIT_RTO_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), SCTPCTL_VALID_COOKIE_LIFE_MIN, SCTPCTL_VALID_COOKIE_LIFE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), SCTPCTL_INIT_RTX_MAX_MIN, SCTPCTL_INIT_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), SCTPCTL_ASSOC_RTX_MAX_MIN, SCTPCTL_ASSOC_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_use_dac), SCTPCTL_CMT_USE_DAC_MIN, SCTPCTL_CMT_USE_DAC_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), SCTPCTL_CWND_MAXBURST_MIN, SCTPCTL_CWND_MAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nat_friendly), SCTPCTL_NAT_FRIENDLY_MIN, SCTPCTL_NAT_FRIENDLY_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_L2_abc_variable), SCTPCTL_ABC_L_VAR_MIN, SCTPCTL_ABC_L_VAR_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), SCTPCTL_MAX_CHAINED_MBUFS_MIN, SCTPCTL_MAX_CHAINED_MBUFS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_do_drain), SCTPCTL_DO_SCTP_DRAIN_MIN, SCTPCTL_DO_SCTP_DRAIN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_hb_maxburst), SCTPCTL_HB_MAX_BURST_MIN, SCTPCTL_HB_MAX_BURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), SCTPCTL_ABORT_AT_LIMIT_MIN, SCTPCTL_ABORT_AT_LIMIT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_data_order), SCTPCTL_STRICT_DATA_ORDER_MIN, SCTPCTL_STRICT_DATA_ORDER_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_min_residual), SCTPCTL_MIN_RESIDUAL_MIN, SCTPCTL_MIN_RESIDUAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_retran_chunk), SCTPCTL_MAX_RETRAN_CHUNK_MIN, SCTPCTL_MAX_RETRAN_CHUNK_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_logging_level), SCTPCTL_LOGGING_LEVEL_MIN, SCTPCTL_LOGGING_LEVEL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_ss_module), SCTPCTL_DEFAULT_SS_MODULE_MIN, SCTPCTL_DEFAULT_SS_MODULE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_bw), SCTPCTL_RTTVAR_BW_MIN, SCTPCTL_RTTVAR_BW_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_rtt), SCTPCTL_RTTVAR_RTT_MIN, SCTPCTL_RTTVAR_RTT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_eqret), SCTPCTL_RTTVAR_EQRET_MIN, SCTPCTL_RTTVAR_EQRET_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_steady_step), SCTPCTL_RTTVAR_STEADYS_MIN, SCTPCTL_RTTVAR_STEADYS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_diag_info_code), SCTPCTL_DIAG_INFO_CODE_MIN, SCTPCTL_DIAG_INFO_CODE_MAX); - -#ifdef SCTP_DEBUG - RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); -#endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); -#endif + new = SCTP_BASE_SYSCTL(sctp_auth_disable); + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < SCTPCTL_AUTH_DISABLE_MIN) || + (new > SCTPCTL_AUTH_DISABLE_MAX) || + ((new == 1) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1))) { + error = EINVAL; + } else { + SCTP_BASE_SYSCTL(sctp_auth_disable) = new; + } } return (error); } static int -sysctl_sctp_auth_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_asconf(SYSCTL_HANDLER_ARGS) { int error; + uint32_t new; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - if (SCTP_BASE_SYSCTL(sctp_auth_disable) < SCTPCTL_AUTH_DISABLE_MIN) { - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MIN; - } - if (SCTP_BASE_SYSCTL(sctp_auth_disable) > SCTPCTL_AUTH_DISABLE_MAX) { - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MAX; - } - if ((SCTP_BASE_SYSCTL(sctp_auth_disable) == 1) && - (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1)) { - /* - * You can't disable AUTH with disabling ASCONF - * first - */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 09:13:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7EB9F0B; Thu, 18 Sep 2014 09:13:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995E1628; Thu, 18 Sep 2014 09:13:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9DKvu016108; Thu, 18 Sep 2014 09:13:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9DKus016106; Thu, 18 Sep 2014 09:13:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409180913.s8I9DKus016106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Sep 2014 09:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271747 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 09:13:20 -0000 Author: kib Date: Thu Sep 18 09:13:20 2014 New Revision: 271747 URL: http://svnweb.freebsd.org/changeset/base/271747 Log: - Use NULL instead of 0 for fpcurthread. - Note the quirk with the interrupt enabled state of the dna handler. - Use just panic() instead of printf() and panic(). Print tid instead of pid, the fpu state is per-thread. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu Sep 18 08:58:22 2014 (r271746) +++ head/sys/amd64/amd64/fpu.c Thu Sep 18 09:13:20 2014 (r271747) @@ -362,7 +362,7 @@ fpuexit(struct thread *td) stop_emulating(); fpusave(curpcb->pcb_save); start_emulating(); - PCPU_SET(fpcurthread, 0); + PCPU_SET(fpcurthread, NULL); } critical_exit(); } @@ -602,16 +602,21 @@ fputrap_sse(void) return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } +static int err_count = 0; + /* - * Implement device not available (DNA) exception + * Device Not Available (DNA, #NM) exception handler. + * + * It would be better to switch FP context here (if curthread != + * fpcurthread) and not necessarily for every context switch, but it + * is too hard to access foreign pcb's. * - * It would be better to switch FP context here (if curthread != fpcurthread) - * and not necessarily for every context switch, but it is too hard to - * access foreign pcb's. + * The handler is entered with interrupts enabled, which allows the + * context switch to happen before critical enter() is executed, and + * causes restoration of FPU context on CPU other than that caused + * DNA. It is fine, since context switch started emulation on the + * current CPU as well. */ - -static int err_count = 0; - void fpudna(void) { @@ -625,11 +630,9 @@ fpudna(void) return; } if (PCPU_GET(fpcurthread) != NULL) { - printf("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", - PCPU_GET(fpcurthread), - PCPU_GET(fpcurthread)->td_proc->p_pid, - curthread, curthread->td_proc->p_pid); - panic("fpudna"); + panic("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), PCPU_GET(fpcurthread)->td_tid, + curthread, curthread->td_tid); } stop_emulating(); /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 09:21:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32E3F1C0; Thu, 18 Sep 2014 09:21:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DC79758; Thu, 18 Sep 2014 09:21:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9LTe8020496; Thu, 18 Sep 2014 09:21:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9LTkU020495; Thu, 18 Sep 2014 09:21:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409180921.s8I9LTkU020495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 09:21: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: r271748 - stable/10/sys/cam/scsi 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 09:21:30 -0000 Author: mav Date: Thu Sep 18 09:21:29 2014 New Revision: 271748 URL: http://svnweb.freebsd.org/changeset/base/271748 Log: MFC r271644: Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives. Submitted by: Sean Fagan Approved by: re (kib) Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu Sep 18 09:13:20 2014 (r271747) +++ stable/10/sys/cam/scsi/scsi_da.c Thu Sep 18 09:21:29 2014 (r271748) @@ -547,6 +547,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * PNY USB 3.0 Flash Drives + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "PNY", "USB 3.0 FD*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_RC16 + }, + { + /* * PNY USB Flash keys * PR: usb/75578, usb/72344, usb/65436 */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 09:22:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA39F319; Thu, 18 Sep 2014 09:22:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95308766; Thu, 18 Sep 2014 09:22:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9MbVa020732; Thu, 18 Sep 2014 09:22:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9MbgX020731; Thu, 18 Sep 2014 09:22:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409180922.s8I9MbgX020731@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 09:22: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: r271749 - stable/9/sys/cam/scsi 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 09:22:37 -0000 Author: mav Date: Thu Sep 18 09:22:37 2014 New Revision: 271749 URL: http://svnweb.freebsd.org/changeset/base/271749 Log: MFC r271644: Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives. Submitted by: Sean Fagan Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Sep 18 09:21:29 2014 (r271748) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Sep 18 09:22:37 2014 (r271749) @@ -548,6 +548,13 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * PNY USB 3.0 Flash Drives + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "PNY", "USB 3.0 FD*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_RC16 + }, + { + /* * PNY USB Flash keys * PR: usb/75578, usb/72344, usb/65436 */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 09:49:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D64BDAA4; Thu, 18 Sep 2014 09:49:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDF2F9AE; Thu, 18 Sep 2014 09:49:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9np81031025; Thu, 18 Sep 2014 09:49:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9nnbE031005; Thu, 18 Sep 2014 09:49:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409180949.s8I9nnbE031005@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Sep 2014 09:49: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: r271750 - stable/10/sys/netinet 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 09:49:52 -0000 Author: tuexen Date: Thu Sep 18 09:49:49 2014 New Revision: 271750 URL: http://svnweb.freebsd.org/changeset/base/271750 Log: MFC r271643: Chunk IDs are 8 bit entities, not 16 bit. Thanks to Peter Kasting from Google for drawing my attention to it. MFC r271665: The MTU is handled as a 32-bit entity within the SCTP stack. This was reported by Peter Kasting from Google. MFC r271670: Make a type conversion explicit. When compiling this code on Windows as part of the SCTP userland stack, this fixes a warning reported by Peter Kasting from Google. MFC r271672: Small cleanup which addresses a warning regaring the truncation of a 64-bit entity to a 32-bit entity. This issue was reported by Peter Kasting from Google. MFC r271673: Use a consistent type for the number of HMAC algorithms. This fixes a bug which resulted in a warning on the userland stack, when compiled on Windows. Thanks to Peter Kasting from Google for reporting the issue and provinding a potential fix. MFC r271674: Add a explict cast to silence a warning when building the userland stack on Windows. This issue was reported by Peter Kasting from Google. Approved by: re (kib) Modified: stable/10/sys/netinet/sctp_auth.c stable/10/sys/netinet/sctp_auth.h stable/10/sys/netinet/sctp_cc_functions.c stable/10/sys/netinet/sctp_os_bsd.h stable/10/sys/netinet/sctp_output.c stable/10/sys/netinet/sctp_pcb.c stable/10/sys/netinet/sctp_structs.h stable/10/sys/netinet/sctp_usrreq.c stable/10/sys/netinet/sctputil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/sctp_auth.c ============================================================================== --- stable/10/sys/netinet/sctp_auth.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_auth.c Thu Sep 18 09:49:49 2014 (r271750) @@ -631,7 +631,7 @@ sctp_copy_skeylist(const struct sctp_key sctp_hmaclist_t * -sctp_alloc_hmaclist(uint8_t num_hmacs) +sctp_alloc_hmaclist(uint16_t num_hmacs) { sctp_hmaclist_t *new_list; int alloc_size; @@ -1438,8 +1438,8 @@ sctp_auth_get_cookie_params(struct sctp_ p_random = (struct sctp_auth_random *)phdr; random_len = plen - sizeof(*p_random); } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; Modified: stable/10/sys/netinet/sctp_auth.h ============================================================================== --- stable/10/sys/netinet/sctp_auth.h Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_auth.h Thu Sep 18 09:49:49 2014 (r271750) @@ -154,7 +154,7 @@ sctp_auth_key_release(struct sctp_tcb *s /* hmac list handling */ -extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint8_t num_hmacs); +extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint16_t num_hmacs); extern void sctp_free_hmaclist(sctp_hmaclist_t * list); extern int sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id); extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t * list); Modified: stable/10/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/10/sys/netinet/sctp_cc_functions.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_cc_functions.c Thu Sep 18 09:49:49 2014 (r271750) @@ -1130,12 +1130,9 @@ sctp_cwnd_update_after_packet_dropped(st uint32_t * bottle_bw, uint32_t * on_queue) { uint32_t bw_avail; - int rtt; unsigned int incr; int old_cwnd = net->cwnd; - /* need real RTT in msd for this calc */ - rtt = net->rtt / 1000; /* get bottle neck bw */ *bottle_bw = ntohl(cp->bottle_bw); /* and whats on queue */ @@ -1144,10 +1141,11 @@ sctp_cwnd_update_after_packet_dropped(st * adjust the on-queue if our flight is more it could be that the * router has not yet gotten data "in-flight" to it */ - if (*on_queue < net->flight_size) + if (*on_queue < net->flight_size) { *on_queue = net->flight_size; - /* calculate the available space */ - bw_avail = (*bottle_bw * rtt) / 1000; + } + /* rtt is measured in micro seconds, bottle_bw in bytes per second */ + bw_avail = (uint32_t) (((uint64_t) (*bottle_bw) * net->rtt) / (uint64_t) 1000000); if (bw_avail > *bottle_bw) { /* * Cap the growth to no more than the bottle neck. This can @@ -1167,7 +1165,6 @@ sctp_cwnd_update_after_packet_dropped(st int seg_inflight, seg_onqueue, my_portion; net->partial_bytes_acked = 0; - /* how much are we over queue size? */ incr = *on_queue - bw_avail; if (stcb->asoc.seen_a_sack_this_pkt) { Modified: stable/10/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_os_bsd.h Thu Sep 18 09:49:49 2014 (r271750) @@ -322,7 +322,7 @@ typedef struct callout sctp_os_timer_t; /* MTU */ /*************************/ #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu -#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_mtu : 0) +#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((uint32_t)((rt != NULL) ? rt->rt_mtu : 0)) #define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0) #define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \ if (rt != NULL) \ Modified: stable/10/sys/netinet/sctp_output.c ============================================================================== --- stable/10/sys/netinet/sctp_output.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_output.c Thu Sep 18 09:49:49 2014 (r271750) @@ -11301,7 +11301,7 @@ sctp_send_hb(struct sctp_tcb *stcb, stru hb->heartbeat.hb_info.time_value_1 = now.tv_sec; hb->heartbeat.hb_info.time_value_2 = now.tv_usec; /* Did our user request this one, put it in */ - hb->heartbeat.hb_info.addr_family = net->ro._l_addr.sa.sa_family; + hb->heartbeat.hb_info.addr_family = (uint8_t) net->ro._l_addr.sa.sa_family; hb->heartbeat.hb_info.addr_len = net->ro._l_addr.sa.sa_len; if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { /* Modified: stable/10/sys/netinet/sctp_pcb.c ============================================================================== --- stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_pcb.c Thu Sep 18 09:49:49 2014 (r271750) @@ -6513,8 +6513,8 @@ sctp_load_addresses_from_init(struct sct } got_random = 1; } else if (ptype == SCTP_HMAC_LIST) { - int num_hmacs; - int i; + uint16_t num_hmacs; + uint16_t i; if (plen > sizeof(hmacs_store)) break; Modified: stable/10/sys/netinet/sctp_structs.h ============================================================================== --- stable/10/sys/netinet/sctp_structs.h Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_structs.h Thu Sep 18 09:49:49 2014 (r271750) @@ -418,8 +418,8 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { - uint16_t id; - uint16_t can_take_data; + uint8_t id; + uint8_t can_take_data; }; Modified: stable/10/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/10/sys/netinet/sctp_usrreq.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctp_usrreq.c Thu Sep 18 09:49:49 2014 (r271750) @@ -4208,12 +4208,13 @@ sctp_setopt(struct socket *so, int optna uint32_t i; SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, optsize); - if (optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) { + if ((optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) || + (shmac->shmac_number_of_idents > 0xffff)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } - hmaclist = sctp_alloc_hmaclist(shmac->shmac_number_of_idents); + hmaclist = sctp_alloc_hmaclist((uint16_t) shmac->shmac_number_of_idents); if (hmaclist == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM); error = ENOMEM; Modified: stable/10/sys/netinet/sctputil.c ============================================================================== --- stable/10/sys/netinet/sctputil.c Thu Sep 18 09:22:37 2014 (r271749) +++ stable/10/sys/netinet/sctputil.c Thu Sep 18 09:49:49 2014 (r271750) @@ -2403,8 +2403,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + (uint64_t) now.tv_usec; - /* computer rtt in ms */ - rtt = net->rtt / 1000; + /* compute rtt in ms */ + rtt = (int32_t) (net->rtt / 1000); if ((asoc->cc_functions.sctp_rtt_calculated) && (rtt_from_sack == SCTP_RTT_FROM_DATA)) { /* * Tell the CC module that a new update has just occurred From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 09:54:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF559D36; Thu, 18 Sep 2014 09:54:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0BFCA67; Thu, 18 Sep 2014 09:54:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8I9svIb035140; Thu, 18 Sep 2014 09:54:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8I9sv68035138; Thu, 18 Sep 2014 09:54:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409180954.s8I9sv68035138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 09:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271751 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 09:54:58 -0000 Author: glebius Date: Thu Sep 18 09:54:57 2014 New Revision: 271751 URL: http://svnweb.freebsd.org/changeset/base/271751 Log: Add if_inc_counter(), a generic method to update ifnet(9) counter w/o dereferencing the struct. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Sep 18 09:49:49 2014 (r271750) +++ head/sys/net/if.c Thu Sep 18 09:54:57 2014 (r271751) @@ -1422,6 +1422,56 @@ if_get_counter_compat(struct ifnet *ifp, } /* + * Increase an ifnet counter. Usually used for counters shared + * between the stack and a driver, but function supports them all. + */ +void +if_inc_counter(struct ifnet *ifp, ifnet_counter cnt, int64_t inc) +{ + + switch (cnt) { + case IFCOUNTER_IPACKETS: + ifp->if_ipackets += inc; + break; + case IFCOUNTER_IERRORS: + ifp->if_ierrors += inc; + break; + case IFCOUNTER_OPACKETS: + ifp->if_opackets += inc; + break; + case IFCOUNTER_OERRORS: + ifp->if_oerrors += inc; + break; + case IFCOUNTER_COLLISIONS: + ifp->if_collisions += inc; + break; + case IFCOUNTER_IBYTES: + ifp->if_ibytes += inc; + break; + case IFCOUNTER_OBYTES: + ifp->if_obytes += inc; + break; + case IFCOUNTER_IMCASTS: + ifp->if_imcasts += inc; + break; + case IFCOUNTER_OMCASTS: + ifp->if_omcasts += inc; + break; + case IFCOUNTER_IQDROPS: + ifp->if_iqdrops += inc; + break; + case IFCOUNTER_OQDROPS: + ifp->if_oqdrops += inc; + break; + case IFCOUNTER_NOPROTO: + ifp->if_noproto += inc; + break; + default: + panic("%s: unknown counter %d", __func__, cnt); + } +} + +/* * Copy data from ifnet to userland API structure if_data. */ void Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Sep 18 09:49:49 2014 (r271750) +++ head/sys/net/if_var.h Thu Sep 18 09:54:57 2014 (r271751) @@ -528,6 +528,7 @@ void if_register_com_alloc(u_char type, void if_deregister_com_alloc(u_char type); void if_data_copy(struct ifnet *, struct if_data *); uint64_t if_get_counter_compat(struct ifnet *, ifnet_counter); +void if_inc_counter(struct ifnet *, ifnet_counter, int64_t); #define IF_LLADDR(ifp) \ LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 10:01:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B999AF10; Thu, 18 Sep 2014 10:01:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A5FCB2F; Thu, 18 Sep 2014 10:01:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IA1v1Z039512; Thu, 18 Sep 2014 10:01:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IA1uLN039507; Thu, 18 Sep 2014 10:01:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181001.s8IA1uLN039507@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 10:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271752 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 10:01:57 -0000 Author: glebius Date: Thu Sep 18 10:01:56 2014 New Revision: 271752 URL: http://svnweb.freebsd.org/changeset/base/271752 Log: While not too late rename if_get_counter_compat() to if_get_counter_default(). The compat counters will go away, but the function will remain in its place, and in all places where it is going to be called. Discussed with: melifaro Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/net/if_vlan.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Sep 18 09:54:57 2014 (r271751) +++ head/sys/net/if.c Thu Sep 18 10:01:56 2014 (r271752) @@ -616,7 +616,7 @@ if_attach_internal(struct ifnet *ifp, in } if (ifp->if_get_counter == NULL) - ifp->if_get_counter = if_get_counter_compat; + ifp->if_get_counter = if_get_counter_default; if (!vmove) { #ifdef MAC @@ -1389,7 +1389,7 @@ if_rtdel(struct radix_node *rn, void *ar * Return counter values from old racy non-pcpu counters. */ uint64_t -if_get_counter_compat(struct ifnet *ifp, ifnet_counter cnt) +if_get_counter_default(struct ifnet *ifp, ifnet_counter cnt) { switch (cnt) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Sep 18 09:54:57 2014 (r271751) +++ head/sys/net/if_var.h Thu Sep 18 10:01:56 2014 (r271752) @@ -527,7 +527,7 @@ typedef void if_com_free_t(void *com, u_ void if_register_com_alloc(u_char type, if_com_alloc_t *a, if_com_free_t *f); void if_deregister_com_alloc(u_char type); void if_data_copy(struct ifnet *, struct if_data *); -uint64_t if_get_counter_compat(struct ifnet *, ifnet_counter); +uint64_t if_get_counter_default(struct ifnet *, ifnet_counter); void if_inc_counter(struct ifnet *, ifnet_counter, int64_t); #define IF_LLADDR(ifp) \ Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Sep 18 09:54:57 2014 (r271751) +++ head/sys/net/if_vlan.c Thu Sep 18 10:01:56 2014 (r271752) @@ -1152,7 +1152,7 @@ vlan_get_counter(struct ifnet *ifp, ifne case IFCOUNTER_OERRORS: return (counter_u64_fetch(ifv->ifv_oerrors)); default: - return (if_get_counter_compat(ifp, cnt)); + return (if_get_counter_default(ifp, cnt)); } /* NOTREACHED */ } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 10:33:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17E649FF; Thu, 18 Sep 2014 10:33:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 032F0E31; Thu, 18 Sep 2014 10:33:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IAXNPu054206; Thu, 18 Sep 2014 10:33:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IAXNZ1054205; Thu, 18 Sep 2014 10:33:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409181033.s8IAXNZ1054205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 18 Sep 2014 10:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271753 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 10:33:24 -0000 Author: trasz Date: Thu Sep 18 10:33:23 2014 New Revision: 271753 URL: http://svnweb.freebsd.org/changeset/base/271753 Log: Fix typos. Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Thu Sep 18 10:01:56 2014 (r271752) +++ head/sys/fs/autofs/autofs.c Thu Sep 18 10:33:23 2014 (r271753) @@ -430,7 +430,7 @@ autofs_trigger_one(struct autofs_node *a autofs_restore_sigmask(&oldset); if (error != 0) { /* - * XXX: For some reson this returns -1 + * XXX: For some reason this returns -1 * instead of EINTR, wtf?! */ error = EINTR; @@ -542,7 +542,7 @@ autofs_ioctl_request(struct autofs_daemo &autofs_softc->sc_lock); if (error != 0) { /* - * XXX: For some reson this returns -1 instead + * XXX: For some reason this returns -1 instead * of EINTR, wtf?! */ error = EINTR; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 10:46:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87927E36; Thu, 18 Sep 2014 10:46:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 592E8F5A; Thu, 18 Sep 2014 10:46:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IAkqBD059339; Thu, 18 Sep 2014 10:46:52 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IAkqcV059337; Thu, 18 Sep 2014 10:46:52 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409181046.s8IAkqcV059337@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 18 Sep 2014 10:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271754 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 10:46:52 -0000 Author: smh Date: Thu Sep 18 10:46:51 2014 New Revision: 271754 URL: http://svnweb.freebsd.org/changeset/base/271754 Log: Remove unused ZFS ARC functions * arc_data_buf_alloc * arc_data_buf_free MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Sep 18 10:33:23 2014 (r271753) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Sep 18 10:46:51 2014 (r271754) @@ -1503,23 +1503,6 @@ arc_space_return(uint64_t space, arc_spa atomic_add_64(&arc_size, -space); } -void * -arc_data_buf_alloc(uint64_t size) -{ - if (arc_evict_needed(ARC_BUFC_DATA)) - cv_signal(&arc_reclaim_thr_cv); - atomic_add_64(&arc_size, size); - return (zio_data_buf_alloc(size)); -} - -void -arc_data_buf_free(void *buf, uint64_t size) -{ - zio_data_buf_free(buf, size); - ASSERT(arc_size >= size); - atomic_add_64(&arc_size, -size); -} - arc_buf_t * arc_buf_alloc(spa_t *spa, int size, void *tag, arc_buf_contents_t type) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Thu Sep 18 10:33:23 2014 (r271753) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Thu Sep 18 10:46:51 2014 (r271754) @@ -83,8 +83,6 @@ typedef enum arc_space_type { void arc_space_consume(uint64_t space, arc_space_type_t type); void arc_space_return(uint64_t space, arc_space_type_t type); -void *arc_data_buf_alloc(uint64_t space); -void arc_data_buf_free(void *buf, uint64_t space); arc_buf_t *arc_buf_alloc(spa_t *spa, int size, void *tag, arc_buf_contents_t type); arc_buf_t *arc_loan_buf(spa_t *spa, int size); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 11:21:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C1596A7; Thu, 18 Sep 2014 11:21:06 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0828355; Thu, 18 Sep 2014 11:21:05 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8IBL0wj002601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2014 14:21:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8IBL0wj002601 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8IBL08a002599; Thu, 18 Sep 2014 14:21:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Sep 2014 14:21:00 +0300 From: Konstantin Belousov To: Edward Tomasz Napierala Subject: Re: svn commit: r271753 - head/sys/fs/autofs Message-ID: <20140918112100.GS2161@kib.kiev.ua> References: <201409181033.s8IAXNZ1054205@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IpljlC28XhFjURzf" Content-Disposition: inline In-Reply-To: <201409181033.s8IAXNZ1054205@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 11:21:06 -0000 --IpljlC28XhFjURzf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 18, 2014 at 10:33:23AM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Thu Sep 18 10:33:23 2014 > New Revision: 271753 > URL: http://svnweb.freebsd.org/changeset/base/271753 >=20 > Log: > Fix typos. > =20 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/sys/fs/autofs/autofs.c >=20 > Modified: head/sys/fs/autofs/autofs.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/fs/autofs/autofs.c Thu Sep 18 10:01:56 2014 (r271752) > +++ head/sys/fs/autofs/autofs.c Thu Sep 18 10:33:23 2014 (r271753) > @@ -430,7 +430,7 @@ autofs_trigger_one(struct autofs_node *a > autofs_restore_sigmask(&oldset); > if (error !=3D 0) { > /* > - * XXX: For some reson this returns -1 > + * XXX: For some reason this returns -1 > * instead of EINTR, wtf?! > */ > error =3D EINTR; > @@ -542,7 +542,7 @@ autofs_ioctl_request(struct autofs_daemo > &autofs_softc->sc_lock); > if (error !=3D 0) { > /* > - * XXX: For some reson this returns -1 instead > + * XXX: For some reason this returns -1 instead > * of EINTR, wtf?! > */ > error =3D EINTR; The -1 is ERESTART, i.e. it is correct error value which indicates that syscall return path must restart the syscall after the trip to userland. This behaviour is controlled by SA_RESTART flag, see sigaction(2). There are some syscalls, which explicitely deny restarting, mostly to correctly handle timeout values, most prominent is select(2) family. The comment above is definitely inappropriate, and translation of ERESTART to EINTR may be wrong as well. --IpljlC28XhFjURzf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUGsAcAAoJEJDCuSvBvK1BJZcP/1V0BdWox5Ac+PEPNSEu8pnX GV+7+rhPPzadarXWf3qF0AM8wJFEwbbFZA4CvqQ1meSmCIdXVatYpcn0t5gQBtQI cbOCJOzwhkCEFw2DgFEVh8gusFqEUZiNOLeFXa8d5ERtZboUX2OHIo5ewflgmEDq St/piJda4DzE6v+9vm3ctI9iBf1IcIok9+UzNwtk6+fI1ZdurVmNDw6rLqNha3fD kThy+SZNLzB83qJMJDiO57uiMRDeKaOxFSQD7bqy3gg9nk+fucAGC1LONIe6Z/QJ G/H71cBE+e8JBvA21wKSb/RY9f3B59ErnZYOva0Hey5fnBqcEs8BrYTlwdgfcKJE Cjn1aSCqlW5VcmkRn0m3qgyb0eMoIGCtTkpeM02D+TKfq+R2fuxnqJd4hcqBrwS1 D4Q4AXDktBsjbVZQIdL4YE0sj1F1h3k3hsBRSFWsEuPvZAaIGVG1mos1iULh6+3G kxzV0OzY/ANuAsLkWwcELa5qrWwvIAUJMHBBw7GCBGDo95Egw0ij2lY5E1ABGyad NaWIYfdMkVRQqIJ/lFxZhkbW9kM+qBD6woOTPUDzB8a3zLF30lmEZaqYlpHI24T5 SK/juzM3id4FdjpnOpPGnZwNSiD6HmKloq9Ako4TYDkEgQQ+GOCngA5odcLfmurB j9pmQImjJ9Ud1HiDGzo/ =Oi6+ -----END PGP SIGNATURE----- --IpljlC28XhFjURzf-- From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 11:52:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8279B69; Thu, 18 Sep 2014 11:52:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2C5883B; Thu, 18 Sep 2014 11:52:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IBqSNS090895; Thu, 18 Sep 2014 11:52:28 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IBqSNA090894; Thu, 18 Sep 2014 11:52:28 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409181152.s8IBqSNA090894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 18 Sep 2014 11:52: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: r271755 - stable/10/usr.sbin/ctld 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 11:52:29 -0000 Author: trasz Date: Thu Sep 18 11:52:28 2014 New Revision: 271755 URL: http://svnweb.freebsd.org/changeset/base/271755 Log: MFC r271571: Fix two small nits in ctl.conf(5). Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctl.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 10:46:51 2014 (r271754) +++ stable/10/usr.sbin/ctld/ctl.conf.5 Thu Sep 18 11:52:28 2014 (r271755) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2014 +.Dd September 14, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -93,6 +93,7 @@ The default is Create a .Sy portal-group configuration context, +defining a new portal-group, which can then be assigned to any number of targets. .It Ic target Ar name Create a @@ -282,7 +283,7 @@ The CTL-specific options passed to the k All CTL-specific options are documented in the .Sx OPTIONS section of -.Xr ctladm 8 +.Xr ctladm 8 . .It Ic path Ar path The path to the file or device node used to back the LUN. .It Ic serial Ar string From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 12:20:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DBDE846; Thu, 18 Sep 2014 12:20:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 390DDAA1; Thu, 18 Sep 2014 12:20:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ICKKGH003341; Thu, 18 Sep 2014 12:20:20 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ICKKOO003340; Thu, 18 Sep 2014 12:20:20 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409181220.s8ICKKOO003340@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Thu, 18 Sep 2014 12:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271756 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 12:20:20 -0000 Author: dumbbell Date: Thu Sep 18 12:20:19 2014 New Revision: 271756 URL: http://svnweb.freebsd.org/changeset/base/271756 Log: vt(4): Fix out-of-bounds array access in VT_ACTIVATE ioctl handling CID: 1229964 MFC after: 3 days Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Sep 18 11:52:28 2014 (r271755) +++ head/sys/dev/vt/vt_core.c Thu Sep 18 12:20:19 2014 (r271756) @@ -2131,7 +2131,7 @@ skip_thunk: win = *(int *)data - 1; DPRINTF(5, "%s%d: VT_ACTIVATE ttyv%d ", SC_DRIVER_NAME, VT_UNIT(vw), win); - if ((win > VT_MAXWINDOWS) || (win < 0)) + if ((win >= VT_MAXWINDOWS) || (win < 0)) return (EINVAL); return (vt_proc_window_switch(vd->vd_windows[win])); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:00:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C436810A; Thu, 18 Sep 2014 13:00:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF61EA3; Thu, 18 Sep 2014 13:00:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ID03cG020994; Thu, 18 Sep 2014 13:00:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ID03jI020993; Thu, 18 Sep 2014 13:00:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409181300.s8ID03jI020993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Sep 2014 13:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271757 - head/sys/boot/amd64/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:00:03 -0000 Author: emaste Date: Thu Sep 18 13:00:03 2014 New Revision: 271757 URL: http://svnweb.freebsd.org/changeset/base/271757 Log: Wrap long lines introduced in r268227 Modified: head/sys/boot/amd64/efi/bootinfo.c Modified: head/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- head/sys/boot/amd64/efi/bootinfo.c Thu Sep 18 12:20:19 2014 (r271756) +++ head/sys/boot/amd64/efi/bootinfo.c Thu Sep 18 13:00:03 2014 (r271757) @@ -236,10 +236,14 @@ bi_load_efi_data(struct preloaded_file * if (efi_find_framebuffer(&efifb) == 0) { printf("EFI framebuffer information:\n"); - printf("addr, size 0x%lx, 0x%lx\n", efifb.fb_addr, efifb.fb_size); - printf("dimensions %d x %d\n", efifb.fb_width, efifb.fb_height); + printf("addr, size 0x%lx, 0x%lx\n", efifb.fb_addr, + efifb.fb_size); + printf("dimensions %d x %d\n", efifb.fb_width, + efifb.fb_height); printf("stride %d\n", efifb.fb_stride); - printf("masks 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", efifb.fb_mask_red, efifb.fb_mask_green, efifb.fb_mask_blue, efifb.fb_mask_reserved); + printf("masks 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", + efifb.fb_mask_red, efifb.fb_mask_green, efifb.fb_mask_blue, + efifb.fb_mask_reserved); file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), &efifb); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:12:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE21FA58; Thu, 18 Sep 2014 13:12:21 +0000 (UTC) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com [IPv6:2a00:1450:4010:c04::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16CFF278; Thu, 18 Sep 2014 13:12:20 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id l4so1106373lbv.16 for ; Thu, 18 Sep 2014 06:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=RZVeHw1jRGRKO5WnCZDHNAqQq6YcdNJ9gQzwo3kVi0M=; b=APaiKD0vHQjHRqYeICt73s6ZDlS+t8TzjkC+6lARzJZyx/CRWxYC+6BSHa0uzXV5rR OSAWE87ZVylBJFZw8IbFDEe8g4lrR0FCpAz2Kt/eDFN117KLeUm97CRxhVJGVXucsMwU nfdZFCIYyo7xnR04dWscnCq5Jtk1graq02fVQRUnbBkaxVuy81iwhB+RfX+96tiy1H+N KqYes4hrOrVSWfbwQ0MPg4G1YeCvuaHZQfgaEaHjUQgWdmSE+5G1fs63y1sBXr4LASLY 07wSb/qpM0X7C0x43KuDeKawiY+GZkxdm6HoKu9rJh9cQZh8Km0qUru1oMaoGNd+QE+6 Yk6Q== X-Received: by 10.112.14.33 with SMTP id m1mr4326450lbc.16.1411045938905; Thu, 18 Sep 2014 06:12:18 -0700 (PDT) Received: from pc5.home (aead216.neoplus.adsl.tpnet.pl. [79.186.3.216]) by mx.google.com with ESMTPSA id bm4sm6633782lbc.22.2014.09.18.06.12.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Sep 2014 06:12:18 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 18 Sep 2014 15:12:16 +0200 From: Edward Tomasz Napierala To: Konstantin Belousov Subject: Re: svn commit: r271753 - head/sys/fs/autofs Message-ID: <20140918131216.GA18337@pc5.home> Mail-Followup-To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201409181033.s8IAXNZ1054205@svn.freebsd.org> <20140918112100.GS2161@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140918112100.GS2161@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:12:22 -0000 On 0918T1421, Konstantin Belousov wrote: > On Thu, Sep 18, 2014 at 10:33:23AM +0000, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Thu Sep 18 10:33:23 2014 > > New Revision: 271753 > > URL: http://svnweb.freebsd.org/changeset/base/271753 > > > > Log: > > Fix typos. > > > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/sys/fs/autofs/autofs.c > > > > Modified: head/sys/fs/autofs/autofs.c > > ============================================================================== > > --- head/sys/fs/autofs/autofs.c Thu Sep 18 10:01:56 2014 (r271752) > > +++ head/sys/fs/autofs/autofs.c Thu Sep 18 10:33:23 2014 (r271753) > > @@ -430,7 +430,7 @@ autofs_trigger_one(struct autofs_node *a > > autofs_restore_sigmask(&oldset); > > if (error != 0) { > > /* > > - * XXX: For some reson this returns -1 > > + * XXX: For some reason this returns -1 > > * instead of EINTR, wtf?! > > */ > > error = EINTR; > > @@ -542,7 +542,7 @@ autofs_ioctl_request(struct autofs_daemo > > &autofs_softc->sc_lock); > > if (error != 0) { > > /* > > - * XXX: For some reson this returns -1 instead > > + * XXX: For some reason this returns -1 instead > > * of EINTR, wtf?! > > */ > > error = EINTR; > The -1 is ERESTART, i.e. it is correct error value which indicates that > syscall return path must restart the syscall after the trip to userland. > This behaviour is controlled by SA_RESTART flag, see sigaction(2). Ah, I didn't realize it's a valid error number. > There are some syscalls, which explicitely deny restarting, mostly to > correctly handle timeout values, most prominent is select(2) family. > > The comment above is definitely inappropriate, and translation of ERESTART > to EINTR may be wrong as well. The whole point of this is to fail the syscall with EINTR. However, I'm not sure what makes cv_wait_sig(9) to return with ERESTART instead of EINTR. Is SA_RESTART set by default? From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:24:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22FDF2CB; Thu, 18 Sep 2014 13:24:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E5073E6; Thu, 18 Sep 2014 13:24:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IDO6LM035381; Thu, 18 Sep 2014 13:24:06 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IDO6du035380; Thu, 18 Sep 2014 13:24:06 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409181324.s8IDO6du035380@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Thu, 18 Sep 2014 13:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271758 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:24:07 -0000 Author: dumbbell Date: Thu Sep 18 13:24:06 2014 New Revision: 271758 URL: http://svnweb.freebsd.org/changeset/base/271758 Log: vt(4): Use strncpy() to copy into a fixed-size buffer CID: 1230007 MFC after: 3 days Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Sep 18 13:00:03 2014 (r271757) +++ head/sys/dev/vt/vt_core.c Thu Sep 18 13:24:06 2014 (r271758) @@ -796,7 +796,8 @@ vt_allocate_keyboard(struct vt_device *v continue; bzero(&ki, sizeof(ki)); - strcpy(ki.kb_name, k->kb_name); + strncpy(ki.kb_name, k->kb_name, sizeof(ki.kb_name)); + ki.kb_name[sizeof(ki.kb_name) - 1] = '\0'; ki.kb_unit = k->kb_unit; kbdd_ioctl(k0, KBADDKBD, (caddr_t) &ki); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:39:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BEE8AA7; Thu, 18 Sep 2014 13:39:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76F9C77C; Thu, 18 Sep 2014 13:39:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IDdm1m041171; Thu, 18 Sep 2014 13:39:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IDdmTH041170; Thu, 18 Sep 2014 13:39:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409181339.s8IDdmTH041170@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 18 Sep 2014 13:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271759 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:39:48 -0000 Author: trasz Date: Thu Sep 18 13:39:47 2014 New Revision: 271759 URL: http://svnweb.freebsd.org/changeset/base/271759 Log: Add missing links to taskqueue(9). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Sep 18 13:24:06 2014 (r271758) +++ head/share/man/man9/Makefile Thu Sep 18 13:39:47 2014 (r271759) @@ -1390,6 +1390,7 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_cancel.9 \ + taskqueue.9 taskqueue_cancel_timeout.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ @@ -1397,13 +1398,18 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ taskqueue.9 taskqueue_drain_all.9 \ + taskqueue.9 taskqueue_drain_timeout.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ + taskqueue.9 taskqueue_enqueue_timeout.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_set_callback.9 \ + taskqueue.9 taskqueue_start_threads.9 \ + taskqueue.9 taskqueue_start_threads_pinned.9 \ taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:53:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F552EB4; Thu, 18 Sep 2014 13:53:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29E8E8F2; Thu, 18 Sep 2014 13:53:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IDreRv049571; Thu, 18 Sep 2014 13:53:40 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IDre2A049570; Thu, 18 Sep 2014 13:53:40 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181353.s8IDre2A049570@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 13:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271760 - stable/10/usr.sbin/unbound/local-setup 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:53:40 -0000 Author: des Date: Thu Sep 18 13:53:39 2014 New Revision: 271760 URL: http://svnweb.freebsd.org/changeset/base/271760 Log: MFH (r271255): fix parsing of ipv6 nameserver lines Approved by: re (kib) Modified: stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh ============================================================================== --- stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu Sep 18 13:39:47 2014 (r271759) +++ stable/10/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu Sep 18 13:53:39 2014 (r271760) @@ -178,7 +178,7 @@ gen_forward_conf() { echo "forward-zone:" echo " name: ." for forwarder ; do - if expr "${forwarder}" : "^[0-9:.]\{1,\}$" >/dev/null ; then + if expr "${forwarder}" : "^[0-9A-Fa-f:.]\{1,\}$" >/dev/null ; then echo " forward-addr: ${forwarder}" else echo " forward-host: ${forwarder}" From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:56:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAE589B; Thu, 18 Sep 2014 13:56:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5FAA921; Thu, 18 Sep 2014 13:56:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IDuWPT050023; Thu, 18 Sep 2014 13:56:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IDuWRe050022; Thu, 18 Sep 2014 13:56:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409181356.s8IDuWRe050022@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 18 Sep 2014 13:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271761 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:56:33 -0000 Author: trasz Date: Thu Sep 18 13:56:32 2014 New Revision: 271761 URL: http://svnweb.freebsd.org/changeset/base/271761 Log: Add missing link to TIMEOUT_TASK_INIT(9). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Sep 18 13:53:39 2014 (r271760) +++ head/share/man/man9/Makefile Thu Sep 18 13:56:32 2014 (r271761) @@ -1410,7 +1410,8 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 taskqueue_set_callback.9 \ taskqueue.9 taskqueue_start_threads.9 \ taskqueue.9 taskqueue_start_threads_pinned.9 \ - taskqueue.9 taskqueue_unblock.9 + taskqueue.9 taskqueue_unblock.9 \ + taskqueue.9 TIMEOUT_TASK_INIT.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:58:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B08F9269; Thu, 18 Sep 2014 13:58:41 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37E4594C; Thu, 18 Sep 2014 13:58:41 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8IDwaMW037676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2014 16:58:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8IDwaMW037676 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8IDwaUV037675; Thu, 18 Sep 2014 16:58:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Sep 2014 16:58:36 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271753 - head/sys/fs/autofs Message-ID: <20140918135835.GV2161@kib.kiev.ua> References: <201409181033.s8IAXNZ1054205@svn.freebsd.org> <20140918112100.GS2161@kib.kiev.ua> <20140918131216.GA18337@pc5.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cbsCxbAnPLQXdgdB" Content-Disposition: inline In-Reply-To: <20140918131216.GA18337@pc5.home> User-Agent: Mutt/1.5.23 (2014-03-12) 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.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:58:41 -0000 --cbsCxbAnPLQXdgdB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 18, 2014 at 03:12:16PM +0200, Edward Tomasz Napierala wrote: > On 0918T1421, Konstantin Belousov wrote: > > On Thu, Sep 18, 2014 at 10:33:23AM +0000, Edward Tomasz Napierala wrote: > > > Author: trasz > > > Date: Thu Sep 18 10:33:23 2014 > > > New Revision: 271753 > > > URL: http://svnweb.freebsd.org/changeset/base/271753 > > >=20 > > > Log: > > > Fix typos. > > > =20 > > > Sponsored by: The FreeBSD Foundation > > >=20 > > > Modified: > > > head/sys/fs/autofs/autofs.c > > >=20 > > > Modified: head/sys/fs/autofs/autofs.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/fs/autofs/autofs.c Thu Sep 18 10:01:56 2014 (r271752) > > > +++ head/sys/fs/autofs/autofs.c Thu Sep 18 10:33:23 2014 (r271753) > > > @@ -430,7 +430,7 @@ autofs_trigger_one(struct autofs_node *a > > > autofs_restore_sigmask(&oldset); > > > if (error !=3D 0) { > > > /* > > > - * XXX: For some reson this returns -1 > > > + * XXX: For some reason this returns -1 > > > * instead of EINTR, wtf?! > > > */ > > > error =3D EINTR; > > > @@ -542,7 +542,7 @@ autofs_ioctl_request(struct autofs_daemo > > > &autofs_softc->sc_lock); > > > if (error !=3D 0) { > > > /* > > > - * XXX: For some reson this returns -1 instead > > > + * XXX: For some reason this returns -1 instead > > > * of EINTR, wtf?! > > > */ > > > error =3D EINTR; > > The -1 is ERESTART, i.e. it is correct error value which indicates that > > syscall return path must restart the syscall after the trip to userland. > > This behaviour is controlled by SA_RESTART flag, see sigaction(2). >=20 > Ah, I didn't realize it's a valid error number. >=20 > > There are some syscalls, which explicitely deny restarting, mostly to > > correctly handle timeout values, most prominent is select(2) family. > >=20 > > The comment above is definitely inappropriate, and translation of EREST= ART > > to EINTR may be wrong as well. >=20 > The whole point of this is to fail the syscall with EINTR. However, > I'm not sure what makes cv_wait_sig(9) to return with ERESTART instead > of EINTR. Is SA_RESTART set by default? When SA_RESTART set, interruption of cv_wait_sig() by signal causes it to return ERESTART instead of EINTR. Default disposition is either ignoring of signals, or generating core dump, so question about SA_RESTART does not make sense. Despite this, ps_sigintr signal mask of the restartable signals is clear by default, so typical interrupt causes ERESTART before default termination action happens. Can you explain why this matters for autofs code ? Normal action for the kernel code is to pass errors from sig_wait class of functions to upper levels verbatim, except when the timeout must not be restarted. --cbsCxbAnPLQXdgdB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUGuULAAoJEJDCuSvBvK1BPv4P/i1StBas+CT+xt2HHIgPjLDH aEwE7jvFxBNH7DBSewFfvmc8V9szu+7ydiYhAl+KTZZhHTJF/U+Y2duqiAT/dFZt q1wVFHqEmzlZx2NfRnjwRRp8dQ1Dh1/umuLCG1S15Ox7o+ov8urotFp635p0T1zA WkJgZ6q7yMJuoUi15bJw7YWnFCEw5e7s0VHXFx74KmvuNRdIpYxwT2mJdsnvWSgs OKnx/k/Sz75RCjdDiUYzWJITb+nW6Kfb5IYWbWsglHn57ndULPBEAO1NcZEW//Wz qvzQRq0y56K08z5D5GxshWEooB4r/osXA0LY/tK5bATTvmbkPZmtQ8y1Bf0NLPE5 74PsuowoQusO96FhXeTgeYc3BH3xohKI/7aIzrKB/Hbx/r0bsM8a4KMFsargHW0Z qorjeGQUZba/dR1EG52ZKgRZkvewo813TNebb50Qa1vtUW5UNNITE5pooV6w1hfK e/qzQGeRGx/X0CJWASJ+9DkGrzoVAKcN0hG6xNc33K+k/F/JSCL1P9G09H126Ql8 +dwXI/V8mUc0l10E+i6x3hIGgQ02wohLYl0rDFU7WHheVpGaqdKOLNqLgty83PZO f2mrLO9i2b46jYVFSDwtc/l0lEx+jIv3ga5lCponzJZS78NvHVcl8Rg1Idfp6S0z lJRRhlZu0UHq01bldfXD =kch9 -----END PGP SIGNATURE----- --cbsCxbAnPLQXdgdB-- From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 13:59:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6308A3DD; Thu, 18 Sep 2014 13:59:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4347F95A; Thu, 18 Sep 2014 13:59:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IDxbB8050457; Thu, 18 Sep 2014 13:59:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IDxaOW050452; Thu, 18 Sep 2014 13:59:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409181359.s8IDxaOW050452@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Sep 2014 13:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271762 - in head/sys/boot: amd64/boot1.efi efi/include 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 13:59:37 -0000 Author: emaste Date: Thu Sep 18 13:59:36 2014 New Revision: 271762 URL: http://svnweb.freebsd.org/changeset/base/271762 Log: Switch to text mode in UEFI boot The loader previously failed to display on MacBooks and other systems where the UEFI firmware remained in graphics mode. Submitted by: Rafael Espíndola Added: head/sys/boot/efi/include/eficonsctl.h (contents, props changed) Modified: head/sys/boot/amd64/boot1.efi/boot1.c head/sys/boot/efi/libefi/libefi.c Modified: head/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- head/sys/boot/amd64/boot1.efi/boot1.c Thu Sep 18 13:56:32 2014 (r271761) +++ head/sys/boot/amd64/boot1.efi/boot1.c Thu Sep 18 13:59:36 2014 (r271762) @@ -26,6 +26,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define _PATH_LOADER "/boot/loader.efi" #define _PATH_KERNEL "/boot/kernel/kernel" @@ -97,6 +98,7 @@ strcmp(const char *s1, const char *s2) static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; +static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; static EFI_BLOCK_IO *bootdev; static EFI_DEVICE_PATH *bootdevpath; @@ -109,11 +111,20 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E UINTN i, nparts = sizeof(handles); EFI_STATUS status; EFI_DEVICE_PATH *devpath; + EFI_BOOT_SERVICES *BS; + EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; char *path = _PATH_LOADER; systab = Xsystab; image = Ximage; + BS = systab->BootServices; + status = BS->LocateProtocol(&ConsoleControlGUID, NULL, + (VOID **)&ConsoleControl); + if (status == EFI_SUCCESS) + (void)ConsoleControl->SetMode(ConsoleControl, + EfiConsoleControlScreenText); + printf(" \n>> FreeBSD EFI boot block\n"); printf(" Loader path: %s\n", path); Added: head/sys/boot/efi/include/eficonsctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/eficonsctl.h Thu Sep 18 13:59:36 2014 (r271762) @@ -0,0 +1,253 @@ +/*- + * Copyright (c) 2004 - 2010, Intel Corporation. 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 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 HOLDER 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. + */ + +/* + * Original Module Name: ConsoleControl.h + * Abstract: Abstraction of a Text mode or GOP/UGA screen + */ + +/* $FreeBSD$ */ + +#ifndef _EFI_CONS_CTL_H +#define _EFI_CONS_CTL_H + +#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ + { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } + +typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; + + +typedef enum { + EfiConsoleControlScreenText, + EfiConsoleControlScreenGraphics, + EfiConsoleControlScreenMaxValue +} EFI_CONSOLE_CONTROL_SCREEN_MODE; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, + OUT BOOLEAN *GopUgaExists, OPTIONAL + OUT BOOLEAN *StdInLocked OPTIONAL + ) +/*++ + + Routine Description: + Return the current video mode information. Also returns info about existence + of Graphics Output devices or UGA Draw devices in system, and if the Std In + device is locked. All the arguments are optional and only returned if a non + NULL pointer is passed in. + + Arguments: + This - Protocol instance pointer. + Mode - Are we in text of grahics mode. + GopUgaExists - TRUE if Console Spliter has found a GOP or UGA device + StdInLocked - TRUE if StdIn device is keyboard locked + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode + ) +/*++ + + Routine Description: + Set the current mode to either text or graphics. Graphics is + for Quiet Boot. + + Arguments: + This - Protocol instance pointer. + Mode - Mode to set the + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN CHAR16 *Password + ) +/*++ + + Routine Description: + Lock Std In devices until Password is typed. + + Arguments: + This - Protocol instance pointer. + Password - Password needed to unlock screen. NULL means unlock keyboard + + Returns: + EFI_SUCCESS - Mode information returned. + EFI_DEVICE_ERROR - Std In not locked + +--*/ +; + + + +struct _EFI_CONSOLE_CONTROL_PROTOCOL { + EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; +}; + +extern EFI_GUID gEfiConsoleControlProtocolGuid; + +#endif +/*- + * Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved. + * + * This program and the accompanying materials are licensed and made available + * under the terms and conditions of the BSD License which accompanies this + * distribution. The full text of the license may be found at + * http://opensource.org/licenses/bsd-license.php + * + * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR + * IMPLIED. + * + * Original Module Name: ConsoleControl.h + * Abstract: Abstraction of a Text mode or GOP/UGA screen + */ + +/* $FreeBSD */ + +#ifndef _EFI_CONS_CTL_H +#define _EFI_CONS_CTL_H + +#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ + { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } + +typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; + + +typedef enum { + EfiConsoleControlScreenText, + EfiConsoleControlScreenGraphics, + EfiConsoleControlScreenMaxValue +} EFI_CONSOLE_CONTROL_SCREEN_MODE; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, + OUT BOOLEAN *GopUgaExists, OPTIONAL + OUT BOOLEAN *StdInLocked OPTIONAL + ) +/*++ + + Routine Description: + Return the current video mode information. Also returns info about existence + of Graphics Output devices or UGA Draw devices in system, and if the Std In + device is locked. All the arguments are optional and only returned if a non + NULL pointer is passed in. + + Arguments: + This - Protocol instance pointer. + Mode - Are we in text of grahics mode. + GopUgaExists - TRUE if Console Spliter has found a GOP or UGA device + StdInLocked - TRUE if StdIn device is keyboard locked + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode + ) +/*++ + + Routine Description: + Set the current mode to either text or graphics. Graphics is + for Quiet Boot. + + Arguments: + This - Protocol instance pointer. + Mode - Mode to set the + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN CHAR16 *Password + ) +/*++ + + Routine Description: + Lock Std In devices until Password is typed. + + Arguments: + This - Protocol instance pointer. + Password - Password needed to unlock screen. NULL means unlock keyboard + + Returns: + EFI_SUCCESS - Mode information returned. + EFI_DEVICE_ERROR - Std In not locked + +--*/ +; + + + +struct _EFI_CONSOLE_CONTROL_PROTOCOL { + EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; +}; + +extern EFI_GUID gEfiConsoleControlProtocolGuid; + +#endif Modified: head/sys/boot/efi/libefi/libefi.c ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Thu Sep 18 13:56:32 2014 (r271761) +++ head/sys/boot/efi/libefi/libefi.c Thu Sep 18 13:59:36 2014 (r271762) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -82,6 +83,9 @@ void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) { static EFI_GUID image_protocol = LOADED_IMAGE_PROTOCOL; + static EFI_GUID console_control_protocol = + EFI_CONSOLE_CONTROL_PROTOCOL_GUID; + EFI_CONSOLE_CONTROL_PROTOCOL *console_control = NULL; EFI_LOADED_IMAGE *img; CHAR16 *argp, *args, **argv; EFI_STATUS status; @@ -92,6 +96,12 @@ efi_main(EFI_HANDLE image_handle, EFI_SY BS = ST->BootServices; RS = ST->RuntimeServices; + status = BS->LocateProtocol(&console_control_protocol, NULL, + (VOID **)&console_control); + if (status == EFI_SUCCESS) + (void)console_control->SetMode(console_control, + EfiConsoleControlScreenText); + heapsize = 2 * 1024 * 1024; status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, EFI_SIZE_TO_PAGES(heapsize), &heap); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:02:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C334565; Thu, 18 Sep 2014 14:02:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA499F9; Thu, 18 Sep 2014 14:02:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IE2Qha054316; Thu, 18 Sep 2014 14:02:26 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IE2Q0c054315; Thu, 18 Sep 2014 14:02:26 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181402.s8IE2Q0c054315@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 14:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271763 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:02:26 -0000 Author: will Date: Thu Sep 18 14:02:25 2014 New Revision: 271763 URL: http://svnweb.freebsd.org/changeset/base/271763 Log: Fix an assert to tolerate spare parents with more than 2 children. This can occur if a spare is being spared, which would yield three children: the original pool drive, the previous spare, and the spare that is replacing it. MFC after: 1 week Sponsored by: Spectra Logic Affects: All ZFS versions starting 7 Jun 2006 (illumos 94de1d4c) MFSpectraBSD: r668345 on 2013/06/04 17:10:43 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Thu Sep 18 13:59:36 2014 (r271762) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Thu Sep 18 14:02:25 2014 (r271763) @@ -653,6 +653,7 @@ get_replication(nvlist_t *nvroot, boolea dontreport = 0; vdev_size = -1ULL; for (c = 0; c < children; c++) { + boolean_t is_replacing, is_spare; nvlist_t *cnv = child[c]; char *path; struct stat64 statbuf; @@ -669,16 +670,19 @@ get_replication(nvlist_t *nvroot, boolea * If this is a replacing or spare vdev, then * get the real first child of the vdev. */ - if (strcmp(childtype, - VDEV_TYPE_REPLACING) == 0 || - strcmp(childtype, VDEV_TYPE_SPARE) == 0) { + is_replacing = strcmp(childtype, + VDEV_TYPE_REPLACING) == 0; + is_spare = strcmp(childtype, + VDEV_TYPE_SPARE) == 0; + if (is_replacing || is_spare) { nvlist_t **rchild; uint_t rchildren; verify(nvlist_lookup_nvlist_array(cnv, ZPOOL_CONFIG_CHILDREN, &rchild, &rchildren) == 0); - assert(rchildren == 2); + assert((is_replacing && rchildren == 2) + || (is_spare && rchildren >= 2)); cnv = rchild[0]; verify(nvlist_lookup_string(cnv, From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:09:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32312B0C; Thu, 18 Sep 2014 14:09:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D78FA72; Thu, 18 Sep 2014 14:09:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IE9g0r055885; Thu, 18 Sep 2014 14:09:42 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IE9gU2055884; Thu, 18 Sep 2014 14:09:42 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181409.s8IE9gU2055884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 14:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271764 - head/cddl/contrib/opensolaris/lib/libzfs/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:09:43 -0000 Author: will Date: Thu Sep 18 14:09:42 2014 New Revision: 271764 URL: http://svnweb.freebsd.org/changeset/base/271764 Log: zfs_setprop_error(): Handle errno value E2BIG. This errno value is emitted by dsl_props_set_check() in sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c, and is used to mean that the property value is too long. For the record, the maximum length is ZAP_MAXVALUELEN, which is 8*1024 bytes. Instead of claiming an unknown error (and abort()ing), provide something more specific to the scenario involved. As far as I can tell, E2BIG is not emitted for any other scenario. MFC after: 1 week Sponsored by: Spectra Logic Affects: All ZFS versions starting 27 Feb 2009 (illumos ccba0801) This change modified the value returned by dsl_props_set_check(), so that it can distinguish between a name that's too long and a value that's too long, but libzfs was not updated accordingly. MFSpectraBSD: r1051499 on 2014/03/28 11:07:59 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 18 14:02:25 2014 (r271763) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Sep 18 14:09:42 2014 (r271764) @@ -1457,6 +1457,12 @@ zfs_setprop_error(libzfs_handle_t *hdl, (void) zfs_error(hdl, EZFS_DSREADONLY, errbuf); break; + case E2BIG: + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property value too long")); + (void) zfs_error(hdl, EZFS_BADPROP, errbuf); + break; + case ENOTSUP: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "pool and or dataset must be upgraded to set this " From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:21:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AD194D5; Thu, 18 Sep 2014 14:21:15 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C169C78; Thu, 18 Sep 2014 14:21:14 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3346E25D3871; Thu, 18 Sep 2014 14:21:05 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 59B2AC770F1; Thu, 18 Sep 2014 14:21:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id HjuTT9w4ge2A; Thu, 18 Sep 2014 14:21:02 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 36907C770DB; Thu, 18 Sep 2014 14:20:52 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271762 - in head/sys/boot: amd64/boot1.efi efi/include efi/libefi From: "Bjoern A. Zeeb" In-Reply-To: <201409181359.s8IDxaOW050452@svn.freebsd.org> Date: Thu, 18 Sep 2014 14:20:50 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201409181359.s8IDxaOW050452@svn.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:21:15 -0000 On 18 Sep 2014, at 13:59 , Ed Maste wrote: > Author: emaste > Date: Thu Sep 18 13:59:36 2014 > New Revision: 271762 > URL: http://svnweb.freebsd.org/changeset/base/271762 >=20 > Log: > Switch to text mode in UEFI boot >=20 > The loader previously failed to display on MacBooks and other systems > where the UEFI firmware remained in graphics mode. >=20 > Submitted by: Rafael Esp=EDndola >=20 > Added: > head/sys/boot/efi/include/eficonsctl.h (contents, props changed) > Modified: > head/sys/boot/amd64/boot1.efi/boot1.c > head/sys/boot/efi/libefi/libefi.c Thanks a lot; that massively helps debugging (as you can at least see = what=92s going on). Eventually we might want to make that dependent on = environment variables maybe? For example on the Mac I have been using this for a while to see kernel = boot messages: % sudo nvram boot-args boot-args -v But I am not entirely confident with variable naming or sharing on = dual-boot machines yet. It seems the new world order has quite a bit to = discover (research) still ;-) =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:27:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4438D7BF; Thu, 18 Sep 2014 14:27:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1575ECBE; Thu, 18 Sep 2014 14:27:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IERbQe064972; Thu, 18 Sep 2014 14:27:37 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IERb33064971; Thu, 18 Sep 2014 14:27:37 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181427.s8IERb33064971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 14:27: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: r271766 - stable/10/lib/libpam/modules/pam_login_access 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:27:38 -0000 Author: des Date: Thu Sep 18 14:27:37 2014 New Revision: 271766 URL: http://svnweb.freebsd.org/changeset/base/271766 Log: MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset. Approved by: re (gjb) PR: 83099 Modified: stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:16:14 2014 (r271765) +++ stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:27:37 2014 (r271766) @@ -79,7 +79,14 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int gethostname(hostname, sizeof hostname); - if (rhost == NULL || *(const char *)rhost == '\0') { + if (rhost != NULL && *(const char *)rhost != '\0') { + PAM_LOG("Checking login.access for user %s from host %s", + (const char *)user, (const char *)rhost); + if (login_access(user, rhost) != 0) + return (PAM_SUCCESS); + PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", + user, rhost); + } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) @@ -87,12 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_LOG("Checking login.access for user %s from host %s", - (const char *)user, (const char *)rhost); - if (login_access(user, rhost) != 0) - return (PAM_SUCCESS); - PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", - user, rhost); + PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); + return (PAM_AUTHINFO_UNAVAIL); } return (PAM_AUTH_ERR); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:31:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D28C59E1; Thu, 18 Sep 2014 14:31:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A335FCF1; Thu, 18 Sep 2014 14:31:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEVImi068893; Thu, 18 Sep 2014 14:31:18 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEVI4C068892; Thu, 18 Sep 2014 14:31:18 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181431.s8IEVI4C068892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 14:31: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: r271767 - stable/9/lib/libpam/modules/pam_login_access 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:31:18 -0000 Author: des Date: Thu Sep 18 14:31:18 2014 New Revision: 271767 URL: http://svnweb.freebsd.org/changeset/base/271767 Log: MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset. PR: 83099 Modified: stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:27:37 2014 (r271766) +++ stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:31:18 2014 (r271767) @@ -79,7 +79,14 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int gethostname(hostname, sizeof hostname); - if (rhost == NULL || *(const char *)rhost == '\0') { + if (rhost != NULL && *(const char *)rhost != '\0') { + PAM_LOG("Checking login.access for user %s from host %s", + (const char *)user, (const char *)rhost); + if (login_access(user, rhost) != 0) + return (PAM_SUCCESS); + PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", + user, rhost); + } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) @@ -87,12 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_LOG("Checking login.access for user %s from host %s", - (const char *)user, (const char *)rhost); - if (login_access(user, rhost) != 0) - return (PAM_SUCCESS); - PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", - user, rhost); + PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); + return (PAM_AUTHINFO_UNAVAIL); } return (PAM_AUTH_ERR); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:31:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6E63B26; Thu, 18 Sep 2014 14:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97CCACFA; Thu, 18 Sep 2014 14:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEVSCf068971; Thu, 18 Sep 2014 14:31:28 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEVS85068970; Thu, 18 Sep 2014 14:31:28 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409181431.s8IEVS85068970@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Thu, 18 Sep 2014 14:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271768 - stable/8/lib/libpam/modules/pam_login_access X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:31:28 -0000 Author: des Date: Thu Sep 18 14:31:28 2014 New Revision: 271768 URL: http://svnweb.freebsd.org/changeset/base/271768 Log: MFH (r271256, r271617): avoid segfault if PAM_RHOST nor PAM_TTY are unset. PR: 83099 Modified: stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c Directory Properties: stable/8/lib/libpam/ (props changed) Modified: stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c ============================================================================== --- stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:31:18 2014 (r271767) +++ stable/8/lib/libpam/modules/pam_login_access/pam_login_access.c Thu Sep 18 14:31:28 2014 (r271768) @@ -79,7 +79,14 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int gethostname(hostname, sizeof hostname); - if (rhost == NULL || *(const char *)rhost == '\0') { + if (rhost != NULL && *(const char *)rhost != '\0') { + PAM_LOG("Checking login.access for user %s from host %s", + (const char *)user, (const char *)rhost); + if (login_access(user, rhost) != 0) + return (PAM_SUCCESS); + PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", + user, rhost); + } else if (tty != NULL && *(const char *)tty != '\0') { PAM_LOG("Checking login.access for user %s on tty %s", (const char *)user, (const char *)tty); if (login_access(user, tty) != 0) @@ -87,12 +94,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int PAM_VERBOSE_ERROR("%s is not allowed to log in on %s", user, tty); } else { - PAM_LOG("Checking login.access for user %s from host %s", - (const char *)user, (const char *)rhost); - if (login_access(user, rhost) != 0) - return (PAM_SUCCESS); - PAM_VERBOSE_ERROR("%s is not allowed to log in from %s", - user, rhost); + PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required"); + return (PAM_AUTHINFO_UNAVAIL); } return (PAM_AUTH_ERR); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:33:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AA4AC9D; Thu, 18 Sep 2014 14:33:01 +0000 (UTC) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2AA8D97; Thu, 18 Sep 2014 14:32:59 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id d1so289017wiv.2 for ; Thu, 18 Sep 2014 07:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=FVnkZaYPMJTbfTTfIzZdLDeGCHQuliZPYQbSpFayEQE=; b=aatP5jFEUwV2GTXp4aI1DieKlbjAZa8wH2HEiW3f/DKFonxSKVHWKbKwIcxWBXThZq ynW+cDAA+4NQuuF5aY2ix74X4TM9eZRS20HU+7fcMBX337+6ZZGpZprfxDDWSEzHt485 QmWKCrsSxZzYxyxEU7KD8grk+eAJM9yvPIpaan7WOXdGmlizm9r5okH8hl/ejZ5tQExx migaLEvBc6C+hRmX2hcXI6BtG4WXC++tcztxlxB4Ss1tENWCgBCJDIOHvbxCH6878W13 D0h0YLtBXqVy9aN5lj1RFQkWfr5aA8oNKGzceSXOdSsUfAdfzfLR2IWTO9k7SHBWMJ0P 8EFg== MIME-Version: 1.0 X-Received: by 10.194.108.41 with SMTP id hh9mr5384061wjb.68.1411050776864; Thu, 18 Sep 2014 07:32:56 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.199 with HTTP; Thu, 18 Sep 2014 07:32:56 -0700 (PDT) In-Reply-To: <1411024874.128099.168895241.4A95DCA1@webmail.messagingengine.com> References: <201409180309.s8I39Zmh045601@svn.freebsd.org> <20140918051834.GD89442@FreeBSD.org> <20140918060435.GA5856@ns.kevlo.org> <1411024874.128099.168895241.4A95DCA1@webmail.messagingengine.com> Date: Thu, 18 Sep 2014 07:32:56 -0700 X-Google-Sender-Auth: CDTXVpD-7zMmZdua6fwkWUqDozs Message-ID: Subject: Re: svn commit: r271735 - head/sys/net From: Adrian Chadd To: Bruce Simpson Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Marcelo Araujo , Gleb Smirnoff , "svn-src-head@freebsd.org" , Kevin Lo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:33:01 -0000 There is in pfsense. Let me see about twisting some arms again... :) -a On 18 September 2014 00:21, Bruce Simpson wrote: > On Thu, 18 Sep 2014, at 07:04, Kevin Lo wrote: >> Sorry, I overlooked that. Marcelo has a patch with 802.1p tagging >> support, >> I thought the patch was committed. > > I agree the comment change should be reverted. I changed if_ethersubr.c > many years ago to decode 802.1p tags into the mbuf packet header if they > are present. > > However, to my knowledge, there is no support (e.g. in the form of a > DiffServ / IntServ mapping) further up in the stack. If someone plans to > add this, great -- that would be needed for any form of tangible 802.1p > support. > > -- > BMS (sent via webmail) > From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:38:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CECBF56; Thu, 18 Sep 2014 14:38:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1320EDDC; Thu, 18 Sep 2014 14:38:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEcLip070878; Thu, 18 Sep 2014 14:38:21 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEcITk070853; Thu, 18 Sep 2014 14:38:18 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409181438.s8IEcITk070853@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Thu, 18 Sep 2014 14:38:18 +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: r271769 - in stable/10/sys: dev/drm2 dev/fb dev/vt dev/vt/hw/efifb dev/vt/hw/fb dev/vt/hw/vga kern powerpc/ps3 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:38:21 -0000 Author: dumbbell Date: Thu Sep 18 14:38:18 2014 New Revision: 271769 URL: http://svnweb.freebsd.org/changeset/base/271769 Log: vt(4): Merge several bug fixes and improvements SVN revisions in this MFC: 269779 270705 270706 271180 271250 271253 271682 271684 Detailed commit list: r269779: fbd: Fix a bug where vt_fb_attach() success would be considered a failure vt_fb_attach() currently always returns 0, but it could return a code defined in errno.h. However, it doesn't return a CN_* code. So checking its return value against CN_DEAD (which is 0) is incorrect, and in this case, a success becomes a failure. The consequence was unimportant, because the caller (drm_fb_helper.c) would only log an error message in this case. The console would still work. Approved by: nwhitehorn r270705: vt(4): Add cngrab() and cnungrab() callbacks They are used when a panic occurs or when entering a DDB session for instance. cngrab() forces a vt-switch to the console window, no matter if the original window is another terminal or an X session. However, cnungrab() doesn't vt-switch back to the original window currently. r270706: drm: Don't "taskqueue" vt-switch if under DDB/panic situation If DDB is active, we can't use a taskqueue thread to switch away from the X window, because this thread can't run. Reviewed by: ray@ Approved by: ray@ r271180: vt_vga: vd_setpixel_t and vd_drawrect_t are noop in text mode r271250: vt(4): Change the terminal and buffer sizes, even without a font This fixes a bug where scroll lock would not work for tty #0 when using vt_vga's textmode. The reason was that this window is created with a static 256x100 buffer, larger than the real size of 80x25. Now, in vt_change_font() and vt_compute_drawable_area(), we still perform operations even of the window has no font loaded (this is the case in textmode here vw->vw_font == NULL). One of these operation resizes the buffer accordingly. In vt_compute_drawable_area(), we take the terminal size as is (ie. 80x25) for the drawable area. The font argument to vt_set_border() is removed (it was never used) and the code now uses the computed drawable area instead of re-doing its own calculation. Reported by: Harald Schmalzbauer Tested by: Harald Schmalzbauer r271253: pause_sbt(): Take the cold path (ie. use DELAY()) if KDB is active This fixes a panic in the i915 driver when one uses debug.kdb.enter=1 under vt(4). PR: 193269 Reported by: emaste@ Submitted by: avg@ r271682: vt(4): Fix a LOR which occurs during a call to vt_upgrade() Reported by: kib@ Review: https://reviews.freebsd.org/D785 Reviewed by: ray@ Approved by: ray@ r271684: vt(4): Use vt_fb_drawrect() and vt_fb_setpixel() in all vt_fb-derivative Review: https://reviews.freebsd.org/D789 Reviewed by: nwhitehorn Approved by: nwhitehorn Approved by: re (gjb) Modified: stable/10/sys/dev/drm2/drm_fb_helper.c stable/10/sys/dev/fb/fbd.c stable/10/sys/dev/vt/hw/efifb/efifb.c stable/10/sys/dev/vt/hw/fb/vt_early_fb.c stable/10/sys/dev/vt/hw/fb/vt_fb.c stable/10/sys/dev/vt/hw/fb/vt_fb.h stable/10/sys/dev/vt/hw/vga/vt_vga.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_core.c stable/10/sys/kern/kern_synch.c stable/10/sys/kern/subr_terminal.c stable/10/sys/powerpc/ps3/ps3_syscons.c stable/10/sys/sys/terminal.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- stable/10/sys/dev/drm2/drm_fb_helper.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/drm2/drm_fb_helper.c Thu Sep 18 14:38:18 2014 (r271769) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include #if defined(__FreeBSD__) + +#include + struct vt_kms_softc { struct drm_fb_helper *fb_helper; struct task fb_mode_task; @@ -65,7 +68,11 @@ vt_kms_postswitch(void *arg) struct vt_kms_softc *sc; sc = (struct vt_kms_softc *)arg; - taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task); + + if (!kdb_active && panicstr == NULL) + taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task); + else + drm_fb_helper_restore_fbdev_mode(sc->fb_helper); return (0); } Modified: stable/10/sys/dev/fb/fbd.c ============================================================================== --- stable/10/sys/dev/fb/fbd.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/fb/fbd.c Thu Sep 18 14:38:18 2014 (r271769) @@ -246,8 +246,9 @@ fbd_register(struct fb_info* info) return (err); if (first) { - if (vt_fb_attach(info) == CN_DEAD) - return (ENXIO); + err = vt_fb_attach(info); + if (err) + return (err); } return (0); Modified: stable/10/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- stable/10/sys/dev/vt/hw/efifb/efifb.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/efifb/efifb.c Thu Sep 18 14:38:18 2014 (r271769) @@ -62,6 +62,8 @@ static struct vt_driver vt_efifb_driver .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ Modified: stable/10/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/fb/vt_early_fb.c Thu Sep 18 14:38:18 2014 (r271769) @@ -61,6 +61,8 @@ static struct vt_driver vt_fb_early_driv .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_priority = VD_PRIORITY_GENERIC, }; Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 18 14:38:18 2014 (r271769) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -static vd_drawrect_t vt_fb_drawrect; -static vd_setpixel_t vt_fb_setpixel; - static struct vt_driver vt_fb_driver = { .vd_name = "fb", .vd_init = vt_fb_init, @@ -146,7 +143,7 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff return (EINVAL); } -static void +void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color) { struct fb_info *info; @@ -181,7 +178,7 @@ vt_fb_setpixel(struct vt_device *vd, int } -static void +void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, term_color_t color) { Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.h Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.h Thu Sep 18 14:38:18 2014 (r271769) @@ -40,6 +40,8 @@ vd_init_t vt_fb_init; vd_blank_t vt_fb_blank; vd_bitblt_text_t vt_fb_bitblt_text; vd_bitblt_bmp_t vt_fb_bitblt_bitmap; +vd_drawrect_t vt_fb_drawrect; +vd_setpixel_t vt_fb_setpixel; vd_postswitch_t vt_fb_postswitch; vd_fb_ioctl_t vt_fb_ioctl; vd_fb_mmap_t vt_fb_mmap; Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- stable/10/sys/dev/vt/hw/vga/vt_vga.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/hw/vga/vt_vga.c Thu Sep 18 14:38:18 2014 (r271769) @@ -352,6 +352,9 @@ static void vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) { + if (vd->vd_flags & VDF_TEXTMODE) + return; + vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color, 0x80 >> (x % 8)); } @@ -362,6 +365,9 @@ vga_drawrect(struct vt_device *vd, int x { int x, y; + if (vd->vd_flags & VDF_TEXTMODE) + return; + for (y = y1; y <= y2; y++) { if (fill || (y == y1) || (y == y2)) { for (x = x1; x <= x2; x++) Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/vt.h Thu Sep 18 14:38:18 2014 (r271769) @@ -256,6 +256,8 @@ struct vt_window { term_rect_t vw_draw_area; /* (?) Drawable area. */ unsigned int vw_number; /* (c) Window number. */ int vw_kbdmode; /* (?) Keyboard mode. */ + int vw_prev_kbdmode;/* (?) Previous mode. */ + int vw_grabbed; /* (?) Grab count. */ char *vw_kbdsq; /* Escape sequence queue*/ unsigned int vw_flags; /* (d) Per-window flags. */ int vw_mouse_level;/* Mouse op mode. */ Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/dev/vt/vt_core.c Thu Sep 18 14:38:18 2014 (r271769) @@ -70,6 +70,9 @@ static tc_done_t vtterm_done; static tc_cnprobe_t vtterm_cnprobe; static tc_cngetc_t vtterm_cngetc; +static tc_cngrab_t vtterm_cngrab; +static tc_cnungrab_t vtterm_cnungrab; + static tc_opened_t vtterm_opened; static tc_ioctl_t vtterm_ioctl; static tc_mmap_t vtterm_mmap; @@ -86,6 +89,9 @@ const struct terminal_class vt_termclass .tc_cnprobe = vtterm_cnprobe, .tc_cngetc = vtterm_cngetc, + .tc_cngrab = vtterm_cngrab, + .tc_cnungrab = vtterm_cnungrab, + .tc_opened = vtterm_opened, .tc_ioctl = vtterm_ioctl, .tc_mmap = vtterm_mmap, @@ -188,6 +194,7 @@ static struct vt_window vt_conswindow = .vw_device = &vt_consdev, .vw_terminal = &vt_consterm, .vw_kbdmode = K_XLATE, + .vw_grabbed = 0, }; static struct terminal vt_consterm = { .tm_class = &vt_termclass, @@ -420,10 +427,16 @@ vt_compute_drawable_area(struct vt_windo struct vt_device *vd; struct vt_font *vf; - if (vw->vw_font == NULL) + vd = vw->vw_device; + + if (vw->vw_font == NULL) { + vw->vw_draw_area.tr_begin.tp_col = 0; + vw->vw_draw_area.tr_begin.tp_row = 0; + vw->vw_draw_area.tr_end.tp_col = vd->vd_width; + vw->vw_draw_area.tr_end.tp_row = vd->vd_height; return; + } - vd = vw->vw_device; vf = vw->vw_font; /* @@ -1211,6 +1224,64 @@ vtterm_cngetc(struct terminal *tm) } static void +vtterm_cngrab(struct terminal *tm) +{ + struct vt_device *vd; + struct vt_window *vw; + keyboard_t *kbd; + + vw = tm->tm_softc; + vd = vw->vw_device; + + if (!cold) + vt_window_switch(vw); + + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd == NULL) + return; + + if (vw->vw_grabbed++ > 0) + return; + + /* + * Make sure the keyboard is accessible even when the kbd device + * driver is disabled. + */ + kbdd_enable(kbd); + + /* We shall always use the keyboard in the XLATE mode here. */ + vw->vw_prev_kbdmode = vw->vw_kbdmode; + vw->vw_kbdmode = K_XLATE; + (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + + kbdd_poll(kbd, TRUE); +} + +static void +vtterm_cnungrab(struct terminal *tm) +{ + struct vt_device *vd; + struct vt_window *vw; + keyboard_t *kbd; + + vw = tm->tm_softc; + vd = vw->vw_device; + + kbd = kbd_get_keyboard(vd->vd_keyboard); + if (kbd == NULL) + return; + + if (--vw->vw_grabbed > 0) + return; + + kbdd_poll(kbd, FALSE); + + vw->vw_kbdmode = vw->vw_prev_kbdmode; + (void)kbdd_ioctl(kbd, KDSKBMODE, (caddr_t)&vw->vw_kbdmode); + kbdd_disable(kbd); +} + +static void vtterm_opened(struct terminal *tm, int opened) { struct vt_window *vw = tm->tm_softc; @@ -1228,30 +1299,40 @@ vtterm_opened(struct terminal *tm, int o } static int -vt_set_border(struct vt_window *vw, struct vt_font *vf, term_color_t c) +vt_set_border(struct vt_window *vw, term_color_t c) { struct vt_device *vd = vw->vw_device; - int x, y, off_x, off_y; if (vd->vd_driver->vd_drawrect == NULL) return (ENOTSUP); - x = vd->vd_width - 1; - y = vd->vd_height - 1; - off_x = vw->vw_draw_area.tr_begin.tp_col; - off_y = vw->vw_draw_area.tr_begin.tp_row; - /* Top bar. */ - if (off_y > 0) - vd->vd_driver->vd_drawrect(vd, 0, 0, x, off_y - 1, 1, c); + if (vw->vw_draw_area.tr_begin.tp_row > 0) + vd->vd_driver->vd_drawrect(vd, + 0, 0, + vd->vd_width - 1, vw->vw_draw_area.tr_begin.tp_row - 1, + 1, c); + /* Left bar. */ - if (off_x > 0) - vd->vd_driver->vd_drawrect(vd, 0, off_y, off_x - 1, y - off_y, + if (vw->vw_draw_area.tr_begin.tp_col > 0) + vd->vd_driver->vd_drawrect(vd, + 0, 0, + vw->vw_draw_area.tr_begin.tp_col - 1, vd->vd_height - 1, + 1, c); + + /* Right bar. */ + if (vw->vw_draw_area.tr_end.tp_col < vd->vd_width) + vd->vd_driver->vd_drawrect(vd, + vw->vw_draw_area.tr_end.tp_col - 1, 0, + vd->vd_width - 1, vd->vd_height - 1, + 1, c); + + /* Bottom bar. */ + if (vw->vw_draw_area.tr_end.tp_row < vd->vd_height) + vd->vd_driver->vd_drawrect(vd, + 0, vw->vw_draw_area.tr_end.tp_row - 1, + vd->vd_width - 1, vd->vd_height - 1, 1, c); - /* Right bar. May be 1 pixel wider than necessary due to rounding. */ - vd->vd_driver->vd_drawrect(vd, x - off_x, off_y, x, y - off_y, 1, c); - /* Bottom bar. May be 1 mixel taller than necessary due to rounding. */ - vd->vd_driver->vd_drawrect(vd, 0, y - off_y, x, y, 1, c); return (0); } @@ -1283,11 +1364,6 @@ vt_change_font(struct vt_window *vw, str VT_UNLOCK(vd); return (EBUSY); } - if (vd->vd_flags & VDF_TEXTMODE) { - /* Our device doesn't need fonts. */ - VT_UNLOCK(vd); - return (ENOTTY); - } vw->vw_flags |= VWF_BUSY; VT_UNLOCK(vd); @@ -1302,7 +1378,7 @@ vt_change_font(struct vt_window *vw, str /* Actually apply the font to the current window. */ VT_LOCK(vd); - if (vw->vw_font != vf) { + if (vw->vw_font != vf && vw->vw_font != NULL && vf != NULL) { /* * In case vt_change_font called to update size we don't need * to update font link. @@ -1325,7 +1401,7 @@ vt_change_font(struct vt_window *vw, str /* Force a full redraw the next timer tick. */ if (vd->vd_curwindow == vw) { - vt_set_border(vw, vf, TC_BLACK); + vt_set_border(vw, TC_BLACK); vd->vd_flags |= VDF_INVALID; vt_resume_flush_timer(vw->vw_device, 0); } @@ -2247,7 +2323,6 @@ vt_allocate(struct vt_driver *drv, void main_vd->vd_driver->vd_name, drv->vd_name); } vd = main_vd; - VT_LOCK(vd); if (vd->vd_flags & VDF_ASYNC) { /* Stop vt_flush periodic task. */ @@ -2263,6 +2338,7 @@ vt_allocate(struct vt_driver *drv, void * Reset VDF_TEXTMODE flag, driver who require that flag (vt_vga) will * set it. */ + VT_LOCK(vd); vd->vd_flags &= ~VDF_TEXTMODE; vd->vd_driver = drv; Modified: stable/10/sys/kern/kern_synch.c ============================================================================== --- stable/10/sys/kern/kern_synch.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/kern/kern_synch.c Thu Sep 18 14:38:18 2014 (r271769) @@ -363,7 +363,7 @@ pause_sbt(const char *wmesg, sbintime_t if (sbt == 0) sbt = tick_sbt; - if (cold) { + if (cold || kdb_active) { /* * We delay one second at a time to avoid overflowing the * system specific DELAY() function(s): Modified: stable/10/sys/kern/subr_terminal.c ============================================================================== --- stable/10/sys/kern/subr_terminal.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/kern/subr_terminal.c Thu Sep 18 14:38:18 2014 (r271769) @@ -476,13 +476,17 @@ termcn_cnregister(struct terminal *tm) static void termcn_cngrab(struct consdev *cp) { + struct terminal *tm = cp->cn_arg; + tm->tm_class->tc_cngrab(tm); } static void termcn_cnungrab(struct consdev *cp) { + struct terminal *tm = cp->cn_arg; + tm->tm_class->tc_cnungrab(tm); } static void Modified: stable/10/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- stable/10/sys/powerpc/ps3/ps3_syscons.c Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/powerpc/ps3/ps3_syscons.c Thu Sep 18 14:38:18 2014 (r271769) @@ -78,6 +78,8 @@ static struct vt_driver vt_ps3fb_driver .vd_blank = vt_fb_blank, .vd_bitblt_text = vt_fb_bitblt_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_drawrect = vt_fb_drawrect, + .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ Modified: stable/10/sys/sys/terminal.h ============================================================================== --- stable/10/sys/sys/terminal.h Thu Sep 18 14:31:28 2014 (r271768) +++ stable/10/sys/sys/terminal.h Thu Sep 18 14:38:18 2014 (r271769) @@ -155,6 +155,9 @@ typedef void tc_done_t(struct terminal * typedef void tc_cnprobe_t(struct terminal *tm, struct consdev *cd); typedef int tc_cngetc_t(struct terminal *tm); +typedef void tc_cngrab_t(struct terminal *tm); +typedef void tc_cnungrab_t(struct terminal *tm); + typedef void tc_opened_t(struct terminal *tm, int opened); typedef int tc_ioctl_t(struct terminal *tm, u_long cmd, caddr_t data, struct thread *td); @@ -175,6 +178,10 @@ struct terminal_class { tc_cnprobe_t *tc_cnprobe; tc_cngetc_t *tc_cngetc; + /* DDB & panic handling. */ + tc_cngrab_t *tc_cngrab; + tc_cnungrab_t *tc_cnungrab; + /* Misc. */ tc_opened_t *tc_opened; tc_ioctl_t *tc_ioctl; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:38:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1622210C; Thu, 18 Sep 2014 14:38:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAB53DDE; Thu, 18 Sep 2014 14:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEcSVO070986; Thu, 18 Sep 2014 14:38:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEcSjo070979; Thu, 18 Sep 2014 14:38:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181438.s8IEcSjo070979@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 14:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271770 - in head/sys: net netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:38:29 -0000 Author: glebius Date: Thu Sep 18 14:38:28 2014 New Revision: 271770 URL: http://svnweb.freebsd.org/changeset/base/271770 Log: Add a function to set if_get_counter method for an ifnet. To be used in the drivers that are already converted to "Juniper drvapi". This can be revisited in future. Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/netgraph/ng_ppp.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Sep 18 14:38:18 2014 (r271769) +++ head/sys/net/if.c Thu Sep 18 14:38:28 2014 (r271770) @@ -4095,6 +4095,13 @@ void if_setqflushfn(if_t ifp, if_qflush_ } +void +if_setgetcounterfn(if_t ifp, if_get_counter_t fn) +{ + + ifp->if_get_counter = fn; +} + /* Revisit these - These are inline functions originally. */ int drbr_inuse_drv(if_t ifh, struct buf_ring *br) Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Sep 18 14:38:18 2014 (r271769) +++ head/sys/net/if_var.h Thu Sep 18 14:38:28 2014 (r271770) @@ -609,6 +609,7 @@ void if_setioctlfn(if_t ifp, int (*)(if_ void if_setstartfn(if_t ifp, void (*)(if_t)); void if_settransmitfn(if_t ifp, if_transmit_fn_t); void if_setqflushfn(if_t ifp, if_qflush_fn_t); +void if_setgetcounterfn(if_t ifp, if_get_counter_t); /* Revisit the below. These are inline functions originally */ int drbr_inuse_drv(if_t ifp, struct buf_ring *br); Modified: head/sys/netgraph/ng_ppp.c ============================================================================== --- head/sys/netgraph/ng_ppp.c Thu Sep 18 14:38:18 2014 (r271769) +++ head/sys/netgraph/ng_ppp.c Thu Sep 18 14:38:28 2014 (r271770) @@ -237,6 +237,7 @@ static ng_rcvdata_t ng_ppp_rcvdata; static ng_disconnect_t ng_ppp_disconnect; static ng_rcvdata_t ng_ppp_rcvdata_inet; +static ng_rcvdata_t ng_ppp_rcvdata_inet_fast; static ng_rcvdata_t ng_ppp_rcvdata_ipv6; static ng_rcvdata_t ng_ppp_rcvdata_ipx; static ng_rcvdata_t ng_ppp_rcvdata_atalk; @@ -793,6 +794,19 @@ ng_ppp_rcvdata_inet(hook_p hook, item_p } /* + * Receive data on a hook inet and pass it directly to first link. + */ +static int +ng_ppp_rcvdata_inet_fast(hook_p hook, item_p item) +{ + const node_p node = NG_HOOK_NODE(hook); + const priv_p priv = NG_NODE_PRIVATE(node); + + return (ng_ppp_link_xmit(node, item, PROT_IP, priv->activeLinks[0], + NGI_M(item)->m_pkthdr.len)); +} + +/* * Receive data on a hook ipv6. */ static int @@ -2530,6 +2544,20 @@ ng_ppp_update(node_p node, int newConf) link->seq = MP_NOSEQ; } } + + if (priv->hooks[HOOK_INDEX_INET] != NULL) { + if (priv->conf.enableIP == 1 && + priv->numActiveLinks == 1 && + priv->conf.enableMultilink == 0 && + priv->conf.enableCompression == 0 && + priv->conf.enableEncryption == 0 && + priv->conf.enableVJCompression == 0) + NG_HOOK_SET_RCVDATA(priv->hooks[HOOK_INDEX_INET], + ng_ppp_rcvdata_inet_fast); + else + NG_HOOK_SET_RCVDATA(priv->hooks[HOOK_INDEX_INET], + ng_ppp_rcvdata_inet); + } } /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:41:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE7584BE; Thu, 18 Sep 2014 14:41:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C91A7EA9; Thu, 18 Sep 2014 14:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEfwN6075488; Thu, 18 Sep 2014 14:41:58 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEfvR1075223; Thu, 18 Sep 2014 14:41:57 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181441.s8IEfvR1075223@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 14:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271771 - in head: bin/csh etc/mail lib/libc usr.bin/grep usr.sbin/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:41:59 -0000 Author: will Date: Thu Sep 18 14:41:57 2014 New Revision: 271771 URL: http://svnweb.freebsd.org/changeset/base/271771 Log: Fix incremental builds involving non-root users with read-only source files. Makefiles should not assume that source files can be overwritten. This is the common case for Perforce source trees. This is a followup commit to r211243 in the same vein. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: r1036319 on 2014/01/29, r1046711 on 2014/03/06 Modified: head/bin/csh/Makefile head/etc/mail/Makefile head/lib/libc/Makefile head/usr.bin/grep/Makefile head/usr.sbin/mtree/Makefile Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Thu Sep 18 14:38:28 2014 (r271770) +++ head/bin/csh/Makefile Thu Sep 18 14:41:57 2014 (r271771) @@ -94,7 +94,7 @@ GENHDRS+= iconv.h SRCS+= iconv_stub.c iconv.h: ${.CURDIR}/iconv_stub.h - cp ${.CURDIR}/iconv_stub.h ${.TARGET} + cp -f ${.CURDIR}/iconv_stub.h ${.TARGET} .endif .endif Modified: head/etc/mail/Makefile ============================================================================== --- head/etc/mail/Makefile Thu Sep 18 14:38:28 2014 (r271770) +++ head/etc/mail/Makefile Thu Sep 18 14:41:57 2014 (r271771) @@ -69,7 +69,7 @@ SENDMAIL_MC!= hostname SENDMAIL_MC:= ${SENDMAIL_MC}.mc ${SENDMAIL_MC}: - cp freebsd.mc ${SENDMAIL_MC} + cp -f freebsd.mc ${SENDMAIL_MC} .endif .ifndef SENDMAIL_SUBMIT_MC @@ -77,7 +77,7 @@ SENDMAIL_SUBMIT_MC!= hostname SENDMAIL_SUBMIT_MC:= ${SENDMAIL_SUBMIT_MC}.submit.mc ${SENDMAIL_SUBMIT_MC}: - cp freebsd.submit.mc ${SENDMAIL_SUBMIT_MC} + cp -f freebsd.submit.mc ${SENDMAIL_SUBMIT_MC} .endif INSTALL_CF= ${SENDMAIL_MC:R}.cf Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Thu Sep 18 14:38:28 2014 (r271770) +++ head/lib/libc/Makefile Thu Sep 18 14:41:57 2014 (r271771) @@ -151,11 +151,11 @@ KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c libkern: libkern.gen libkern.${LIBC_ARCH} libkern.gen: ${KQSRCS} ${KSRCS} - cp -p ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern + cp -fp ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern libkern.${LIBC_ARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) - cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH} + cp -fp ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH} .endif .include Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Thu Sep 18 14:38:28 2014 (r271770) +++ head/usr.bin/grep/Makefile Thu Sep 18 14:41:57 2014 (r271771) @@ -11,7 +11,7 @@ PROG= bsdgrep CLEANFILES+= bsdgrep.1 bsdgrep.1: grep.1 - cp ${.ALLSRC} ${.TARGET} + cp -f ${.ALLSRC} ${.TARGET} .endif SRCS= file.c grep.c queue.c util.c Modified: head/usr.sbin/mtree/Makefile ============================================================================== --- head/usr.sbin/mtree/Makefile Thu Sep 18 14:38:28 2014 (r271770) +++ head/usr.sbin/mtree/Makefile Thu Sep 18 14:41:57 2014 (r271771) @@ -17,6 +17,6 @@ LDADD= -lmd CLEANFILES+= fmtree.8 fmtree.8: mtree.8 - cp ${.ALLSRC} ${.TARGET} + cp -f ${.ALLSRC} ${.TARGET} .include From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:43:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3853620; Thu, 18 Sep 2014 14:43:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEA32EBF; Thu, 18 Sep 2014 14:43:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEhNJd075894; Thu, 18 Sep 2014 14:43:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEhNqw075893; Thu, 18 Sep 2014 14:43:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181443.s8IEhNqw075893@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 14:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271772 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:43:24 -0000 Author: glebius Date: Thu Sep 18 14:43:23 2014 New Revision: 271772 URL: http://svnweb.freebsd.org/changeset/base/271772 Log: Accidentially, ng_ppp changes leaked out with r271770. The proper commit message should have been: In case if ng_ppp(4) runs only IPv4, with one link, w/o any encryption and compression, set faster rcvhook method. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_ppp.c Modified: head/sys/netgraph/ng_ppp.c ============================================================================== --- head/sys/netgraph/ng_ppp.c Thu Sep 18 14:41:57 2014 (r271771) +++ head/sys/netgraph/ng_ppp.c Thu Sep 18 14:43:23 2014 (r271772) @@ -660,7 +660,7 @@ ng_ppp_rcvmsg(node_p node, item_p item, &priv->bundleStats : &priv->links[linkNum].stats; /* Make 64bit reply. */ - if (msg->header.cmd == NGM_PPP_GET_LINK_STATS64 || + if (msg->header.cmd == NGM_PPP_GET_LINK_STATS64 || msg->header.cmd == NGM_PPP_GETCLR_LINK_STATS64) { NG_MKRESPONSE(resp, msg, sizeof(struct ng_ppp_link_stat64), M_NOWAIT); @@ -669,7 +669,7 @@ ng_ppp_rcvmsg(node_p node, item_p item, bcopy(stats, resp->data, sizeof(*stats)); } else /* Make 32bit reply. */ - if (msg->header.cmd == NGM_PPP_GET_LINK_STATS || + if (msg->header.cmd == NGM_PPP_GET_LINK_STATS || msg->header.cmd == NGM_PPP_GETCLR_LINK_STATS) { struct ng_ppp_link_stat *rs; NG_MKRESPONSE(resp, msg, @@ -1091,10 +1091,10 @@ ng_ppp_comp_xmit(node_p node, item_p ite proto != PROT_COMPD && proto != PROT_CRYPTD && priv->hooks[HOOK_INDEX_COMPRESS] != NULL) { - struct mbuf *m; + struct mbuf *m; int error; - NGI_GET_M(item, m); + NGI_GET_M(item, m); if ((m = ng_ppp_addproto(m, proto, 0)) == NULL) { NG_FREE_ITEM(item); return (ENOBUFS); @@ -1197,8 +1197,8 @@ ng_ppp_rcvdata_decompress(hook_p hook, i } NGI_GET_M(item, m); if ((m = ng_ppp_cutproto(m, &proto)) == NULL) { - NG_FREE_ITEM(item); - return (EIO); + NG_FREE_ITEM(item); + return (EIO); } NGI_M(item) = m; if (!PROT_VALID(proto)) { @@ -1225,7 +1225,7 @@ ng_ppp_crypt_xmit(node_p node, item_p it struct mbuf *m; int error; - NGI_GET_M(item, m); + NGI_GET_M(item, m); if ((m = ng_ppp_addproto(m, proto, 0)) == NULL) { NG_FREE_ITEM(item); return (ENOBUFS); @@ -1297,8 +1297,8 @@ ng_ppp_rcvdata_decrypt(hook_p hook, item } NGI_GET_M(item, m); if ((m = ng_ppp_cutproto(m, &proto)) == NULL) { - NG_FREE_ITEM(item); - return (EIO); + NG_FREE_ITEM(item); + return (EIO); } NGI_M(item) = m; if (!PROT_VALID(proto)) { @@ -1613,7 +1613,7 @@ ng_ppp_mp_recv(node_p node, item_p item, TAILQ_INSERT_AFTER(&priv->frags, qent, frag, f_qent); inserted = 1; break; - } else if (diff == 0) { /* should never happen! */ + } else if (diff == 0) { /* should never happen! */ link->stats.dupFragments++; NG_FREE_M(frag->data); TAILQ_INSERT_HEAD(&priv->fragsfree, frag, f_qent); @@ -1847,7 +1847,7 @@ ng_ppp_frag_process(node_p node, item_p if (item != NULL) { /* Stats */ priv->bundleStats.recvFrames++; - priv->bundleStats.recvOctets += + priv->bundleStats.recvOctets += NGI_M(item)->m_pkthdr.len; /* Drop mutex for the sending time. @@ -2383,10 +2383,9 @@ ng_ppp_mp_strategy(node_p node, int len, struct ng_ppp_link *const link = &priv->links[priv->activeLinks[sortByLatency[i]]]; - if (distrib[sortByLatency[slow]] == 0 - || (distrib[sortByLatency[i]] > 0 - && link->conf.bandwidth < - slowLink->conf.bandwidth)) { + if (distrib[sortByLatency[slow]] == 0 || + (distrib[sortByLatency[i]] > 0 && + link->conf.bandwidth < slowLink->conf.bandwidth)) { slow = i; slowLink = link; } @@ -2488,7 +2487,7 @@ ng_ppp_update(node_p node, int newConf) if (priv->links[i].conf.bandwidth == 0) continue; - + hdrBytes = MP_AVERAGE_LINK_OVERHEAD + (priv->links[i].conf.enableACFComp ? 0 : 2) + (priv->links[i].conf.enableProtoComp ? 1 : 2) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:44:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2926789; Thu, 18 Sep 2014 14:44:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82633ED1; Thu, 18 Sep 2014 14:44:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEimcd076283; Thu, 18 Sep 2014 14:44:48 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEimqv076281; Thu, 18 Sep 2014 14:44:48 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409181444.s8IEimqv076281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 18 Sep 2014 14:44:48 +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: r271773 - in stable/10/sys: kern 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:44:48 -0000 Author: grehan Date: Thu Sep 18 14:44:47 2014 New Revision: 271773 URL: http://svnweb.freebsd.org/changeset/base/271773 Log: MFC tty fixes, r259549 and r259663 Keep tty_makedev as a function to preserve the KBI on 10-stable (it is a macro in CURRENT). The changes for this are direct commits to 10-stable. r259549 (glebius): - Rename tty_makedev() into tty_makedevf() and make it capable to fail and return error. - Use make_dev_p() in tty_makedevf() instead of make_dev_cred(). - Always pass MAKEDEV_CHECKNAME flag. - Optionally pass MAKEDEV_REF flag. - Provide macro for compatibility with old API. This fixes races with simultaneous creation and desctruction of ttys, and makes it possible to call tty_makedevf() from device cloners. A race in tty_watermarks() still exist, since the latter drops lock for M_WAITOK allocation. This will be addressed in separate commit. r259663 (glebius): Move list of ttys handling from the allocating procedures, to the device creation stage. A device creation can fail, and in that case an entry already on the list will be freed. KBI issue pointed out by: kib Reviewed by: kib (KBI addition) Approved by: re (kib) Modified: stable/10/sys/kern/tty.c stable/10/sys/sys/tty.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Thu Sep 18 14:43:23 2014 (r271772) +++ stable/10/sys/kern/tty.c Thu Sep 18 14:44:47 2014 (r271773) @@ -289,7 +289,7 @@ ttydev_open(struct cdev *dev, int oflags goto done; ttydisc_open(tp); - tty_watermarks(tp); + tty_watermarks(tp); /* XXXGL: drops lock */ } /* Wait for Carrier Detect. */ @@ -1007,11 +1007,6 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo knlist_init_mtx(&tp->t_inpoll.si_note, tp->t_mtx); knlist_init_mtx(&tp->t_outpoll.si_note, tp->t_mtx); - sx_xlock(&tty_list_sx); - TAILQ_INSERT_TAIL(&tty_list, tp, t_list); - tty_list_count++; - sx_xunlock(&tty_list_sx); - return (tp); } @@ -1020,11 +1015,6 @@ tty_dealloc(void *arg) { struct tty *tp = arg; - sx_xlock(&tty_list_sx); - TAILQ_REMOVE(&tty_list, tp, t_list); - tty_list_count--; - sx_xunlock(&tty_list_sx); - /* Make sure we haven't leaked buffers. */ MPASS(ttyinq_getsize(&tp->t_inq) == 0); MPASS(ttyoutq_getsize(&tp->t_outq) == 0); @@ -1065,6 +1055,11 @@ tty_rel_free(struct tty *tp) tp->t_dev = NULL; tty_unlock(tp); + sx_xlock(&tty_list_sx); + TAILQ_REMOVE(&tty_list, tp, t_list); + tty_list_count--; + sx_xunlock(&tty_list_sx); + if (dev != NULL) destroy_dev_sched_cb(dev, tty_dealloc, tp); } @@ -1174,24 +1169,23 @@ SYSCTL_PROC(_kern, OID_AUTO, ttys, CTLTY * the user. */ -void -tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) +static int +tty_vmakedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, va_list ap) { - va_list ap; - struct cdev *dev; + struct cdev *dev, *init, *lock, *cua, *cinit, *clock; const char *prefix = "tty"; char name[SPECNAMELEN - 3]; /* for "tty" and "cua". */ uid_t uid; gid_t gid; mode_t mode; + int error; /* Remove "tty" prefix from devices like PTY's. */ if (tp->t_flags & TF_NOPREFIX) prefix = ""; - va_start(ap, fmt); vsnrprintf(name, sizeof name, 32, fmt, ap); - va_end(ap); if (cred == NULL) { /* System device. */ @@ -1205,57 +1199,121 @@ tty_makedev(struct tty *tp, struct ucred mode = S_IRUSR|S_IWUSR|S_IWGRP; } + flags = flags & TTYMK_CLONING ? MAKEDEV_REF : 0; + flags |= MAKEDEV_CHECKNAME; + /* Master call-in device. */ - dev = make_dev_cred(&ttydev_cdevsw, 0, cred, - uid, gid, mode, "%s%s", prefix, name); + error = make_dev_p(flags, &dev, &ttydev_cdevsw, cred, uid, gid, mode, + "%s%s", prefix, name); + if (error) + return (error); dev->si_drv1 = tp; wakeup(&dev->si_drv1); tp->t_dev = dev; + init = lock = cua = cinit = clock = NULL; + /* Slave call-in devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_INIT, cred, - uid, gid, mode, "%s%s.init", prefix, name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_init_in; - - dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_LOCK, cred, - uid, gid, mode, "%s%s.lock", prefix, name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_lock_in; + error = make_dev_p(flags, &init, &ttyil_cdevsw, cred, uid, + gid, mode, "%s%s.init", prefix, name); + if (error) + goto fail; + dev_depends(dev, init); + dev2unit(init) = TTYUNIT_INIT; + init->si_drv1 = tp; + wakeup(&init->si_drv1); + init->si_drv2 = &tp->t_termios_init_in; + + error = make_dev_p(flags, &lock, &ttyil_cdevsw, cred, uid, + gid, mode, "%s%s.lock", prefix, name); + if (error) + goto fail; + dev_depends(dev, lock); + dev2unit(lock) = TTYUNIT_LOCK; + lock->si_drv1 = tp; + wakeup(&lock->si_drv1); + lock->si_drv2 = &tp->t_termios_lock_in; } /* Call-out devices. */ if (tp->t_flags & TF_CALLOUT) { - dev = make_dev_cred(&ttydev_cdevsw, TTYUNIT_CALLOUT, cred, + error = make_dev_p(flags, &cua, &ttydev_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); + if (error) + goto fail; + dev_depends(dev, cua); + dev2unit(cua) = TTYUNIT_CALLOUT; + cua->si_drv1 = tp; + wakeup(&cua->si_drv1); /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, - TTYUNIT_CALLOUT | TTYUNIT_INIT, cred, + error = make_dev_p(flags, &cinit, &ttyil_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_init_out; + if (error) + goto fail; + dev_depends(dev, cinit); + dev2unit(cinit) = TTYUNIT_CALLOUT | TTYUNIT_INIT; + cinit->si_drv1 = tp; + wakeup(&cinit->si_drv1); + cinit->si_drv2 = &tp->t_termios_init_out; - dev = make_dev_cred(&ttyil_cdevsw, - TTYUNIT_CALLOUT | TTYUNIT_LOCK, cred, + error = make_dev_p(flags, &clock, &ttyil_cdevsw, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name); - dev_depends(tp->t_dev, dev); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); - dev->si_drv2 = &tp->t_termios_lock_out; + if (error) + goto fail; + dev_depends(dev, clock); + dev2unit(clock) = TTYUNIT_CALLOUT | TTYUNIT_LOCK; + clock->si_drv1 = tp; + wakeup(&clock->si_drv1); + clock->si_drv2 = &tp->t_termios_lock_out; } } + + sx_xlock(&tty_list_sx); + TAILQ_INSERT_TAIL(&tty_list, tp, t_list); + tty_list_count++; + sx_xunlock(&tty_list_sx); + + return (0); + +fail: + destroy_dev(dev); + if (init) + destroy_dev(init); + if (lock) + destroy_dev(lock); + if (cinit) + destroy_dev(cinit); + if (clock) + destroy_dev(clock); + + return (error); +} + +int +tty_makedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, ...) +{ + va_list ap; + int error; + + va_start(ap, fmt); + error = tty_vmakedevf(tp, cred, flags, fmt, ap); + va_end(ap); + + return (error); +} + +void +tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void) tty_vmakedevf(tp, cred, 0, fmt, ap); + va_end(ap); } /* Modified: stable/10/sys/sys/tty.h ============================================================================== --- stable/10/sys/sys/tty.h Thu Sep 18 14:43:23 2014 (r271772) +++ stable/10/sys/sys/tty.h Thu Sep 18 14:44:47 2014 (r271773) @@ -173,6 +173,9 @@ void tty_rel_gone(struct tty *tp); /* Device node creation. */ void tty_makedev(struct tty *tp, struct ucred *cred, const char *fmt, ...) __printflike(3, 4); +int tty_makedevf(struct tty *tp, struct ucred *cred, int flags, + const char *fmt, ...) __printflike(4, 5); +#define TTYMK_CLONING 0x1 #define tty_makealias(tp,fmt,...) \ make_dev_alias((tp)->t_dev, fmt, ## __VA_ARGS__) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:47:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D2D58F5; Thu, 18 Sep 2014 14:47:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08DE9EF0; Thu, 18 Sep 2014 14:47:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IElDGO076952; Thu, 18 Sep 2014 14:47:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IElDm7076946; Thu, 18 Sep 2014 14:47:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181447.s8IElDm7076946@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 14:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271774 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:47:14 -0000 Author: glebius Date: Thu Sep 18 14:47:13 2014 New Revision: 271774 URL: http://svnweb.freebsd.org/changeset/base/271774 Log: While not too late rename 'ifnet_counter' to 'ift_counter'. One of the imporant moments that we discussed with Marcel and Anuranjan was that a converted driver should return false for 'grep ifnet if_driver.c' :) Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/net/if_vlan.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Sep 18 14:44:47 2014 (r271773) +++ head/sys/net/if.c Thu Sep 18 14:47:13 2014 (r271774) @@ -1389,7 +1389,7 @@ if_rtdel(struct radix_node *rn, void *ar * Return counter values from old racy non-pcpu counters. */ uint64_t -if_get_counter_default(struct ifnet *ifp, ifnet_counter cnt) +if_get_counter_default(struct ifnet *ifp, ift_counter cnt) { switch (cnt) { @@ -1426,7 +1426,7 @@ if_get_counter_default(struct ifnet *ifp * between the stack and a driver, but function supports them all. */ void -if_inc_counter(struct ifnet *ifp, ifnet_counter cnt, int64_t inc) +if_inc_counter(struct ifnet *ifp, ift_counter cnt, int64_t inc) { switch (cnt) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Sep 18 14:44:47 2014 (r271773) +++ head/sys/net/if_var.h Thu Sep 18 14:47:13 2014 (r271774) @@ -108,7 +108,7 @@ typedef enum { IFCOUNTER_IQDROPS, IFCOUNTER_OQDROPS, IFCOUNTER_NOPROTO, -} ifnet_counter; +} ift_counter; typedef struct ifnet * if_t; @@ -117,7 +117,7 @@ typedef int (*if_ioctl_fn_t)(if_t, u_lon typedef void (*if_init_fn_t)(void *); typedef void (*if_qflush_fn_t)(if_t); typedef int (*if_transmit_fn_t)(if_t, struct mbuf *); -typedef uint64_t (*if_get_counter_t)(if_t, ifnet_counter); +typedef uint64_t (*if_get_counter_t)(if_t, ift_counter); /* * Structure defining a network interface. @@ -527,8 +527,8 @@ typedef void if_com_free_t(void *com, u_ void if_register_com_alloc(u_char type, if_com_alloc_t *a, if_com_free_t *f); void if_deregister_com_alloc(u_char type); void if_data_copy(struct ifnet *, struct if_data *); -uint64_t if_get_counter_default(struct ifnet *, ifnet_counter); -void if_inc_counter(struct ifnet *, ifnet_counter, int64_t); +uint64_t if_get_counter_default(struct ifnet *, ift_counter); +void if_inc_counter(struct ifnet *, ift_counter, int64_t); #define IF_LLADDR(ifp) \ LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Sep 18 14:44:47 2014 (r271773) +++ head/sys/net/if_vlan.c Thu Sep 18 14:47:13 2014 (r271774) @@ -201,7 +201,7 @@ static void vlan_init(void *foo); static void vlan_input(struct ifnet *ifp, struct mbuf *m); static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr); static void vlan_qflush(struct ifnet *ifp); -static uint64_t vlan_get_counter(struct ifnet *ifp, ifnet_counter cnt); +static uint64_t vlan_get_counter(struct ifnet *ifp, ift_counter cnt); static int vlan_setflag(struct ifnet *ifp, int flag, int status, int (*func)(struct ifnet *, int)); static int vlan_setflags(struct ifnet *ifp, int status); @@ -1132,7 +1132,7 @@ vlan_transmit(struct ifnet *ifp, struct } static uint64_t -vlan_get_counter(struct ifnet *ifp, ifnet_counter cnt) +vlan_get_counter(struct ifnet *ifp, ift_counter cnt) { struct ifvlan *ifv; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:48:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86968BA3; Thu, 18 Sep 2014 14:48:06 +0000 (UTC) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB67EFE; Thu, 18 Sep 2014 14:48:06 +0000 (UTC) Received: by mail-ig0-f174.google.com with SMTP id r10so1298266igi.13 for ; Thu, 18 Sep 2014 07:48:05 -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:content-type:content-transfer-encoding; bh=SP2gg0yTuNujyn2uY3YMsHNY92LTFo1KSWdWnS1GS9I=; b=FJsXqF36lNpj6t5pBTwD3SiySdZkNZYqaFc38d3jw/mMisNC0Lu9g9d9VFVewGCZvJ LSha+HSDWO3pIH3HmzlMC6Xl0L0qnT2I3hRH75i47q3TuOcB0+gXP5fpILEmW5gLFMZC a5VI2QDNmLun3ztas8HO+t5NBkKM3fvrhJdHouO9IzVBumvmaSc0IW3TgA4RehW+NOI7 UcEmMaiG5eW91Lj9xsPY8eDtauHdabVKDDv3WQjUjUMXwUqRb/z5Lkp2i3sN7HWIkdcC AOaCvKrhh7dT6pgtspnmMFuMeFE26K8d4UOXQoAlp2vZhOlRAIQKcHwuArV9uZh7ZRHE P4eA== X-Received: by 10.43.136.134 with SMTP id ik6mr12552085icc.6.1411051684790; Thu, 18 Sep 2014 07:48:04 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.44.196 with HTTP; Thu, 18 Sep 2014 07:47:43 -0700 (PDT) In-Reply-To: References: <201409181359.s8IDxaOW050452@svn.freebsd.org> From: Ed Maste Date: Thu, 18 Sep 2014 10:47:43 -0400 X-Google-Sender-Auth: w7mLOuK97KjYwAkb0bIDK07Quuw Message-ID: Subject: Re: svn commit: r271762 - in head/sys/boot: amd64/boot1.efi efi/include efi/libefi To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:48:06 -0000 On 18 September 2014 10:20, Bjoern A. Zeeb wrote: > > Thanks a lot; that massively helps debugging (as you can at least see wh= at=E2=80=99s going on). Eventually we might want to make that dependent o= n environment variables maybe? > > For example on the Mac I have been using this for a while to see kernel b= oot messages: > > % sudo nvram boot-args > boot-args -v > > But I am not entirely confident with variable naming or sharing on dual-b= oot machines yet. It seems the new world order has quite a bit to discover= (research) still ;-) Yes, once we add nvram environment variable support we will want to provide a choice of switching to text mode in the loader or remaining in graphics mode and hiding the boot process. You are correct that there's a lot to sort out for dual-boot cases. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:50:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A00ECED6; Thu, 18 Sep 2014 14:50:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BBD8F27; Thu, 18 Sep 2014 14:50:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEoL2n078237; Thu, 18 Sep 2014 14:50:21 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEoLGm078236; Thu, 18 Sep 2014 14:50:21 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181450.s8IEoLGm078236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 14:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271775 - head/kerberos5/lib/libasn1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:50:21 -0000 Author: will Date: Thu Sep 18 14:50:21 2014 New Revision: 271775 URL: http://svnweb.freebsd.org/changeset/base/271775 Log: Fix incremental builds involving non-root users with read-only source files. This is a followup commit to r271771. MFC after: 1 month Modified: head/kerberos5/lib/libasn1/Makefile Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Thu Sep 18 14:47:13 2014 (r271774) +++ head/kerberos5/lib/libasn1/Makefile Thu Sep 18 14:50:21 2014 (r271775) @@ -112,10 +112,10 @@ ${GEN_KX509}: kx509.asn1 .SUFFIXES: .h .c .x .hx .x.c: - cp ${.IMPSRC} ${.TARGET} + cp -f ${.IMPSRC} ${.TARGET} .hx.h: - cp ${.IMPSRC} ${.TARGET} + cp -f ${.IMPSRC} ${.TARGET} .include From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:50:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82A2E95; Thu, 18 Sep 2014 14:50:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4A7F31; Thu, 18 Sep 2014 14:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEopns078330; Thu, 18 Sep 2014 14:50:51 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEopbq078329; Thu, 18 Sep 2014 14:50:51 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409181450.s8IEopbq078329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 18 Sep 2014 14:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271776 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:50:51 -0000 Author: smh Date: Thu Sep 18 14:50:50 2014 New Revision: 271776 URL: http://svnweb.freebsd.org/changeset/base/271776 Log: MFC r271429: Persist vdev_resilver_txg changes to avoid panic caused by validation vs a vdev_resilver_txg value from a previous resilver. Approved by: re (glebius) Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Sep 18 14:50:21 2014 (r271775) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Sep 18 14:50:50 2014 (r271776) @@ -1951,12 +1951,15 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t /* * If the vdev was resilvering and no longer has any - * DTLs then reset its resilvering flag. + * DTLs then reset its resilvering flag and dirty + * the top level so that we persist the change. */ if (vd->vdev_resilver_txg != 0 && range_tree_space(vd->vdev_dtl[DTL_MISSING]) == 0 && - range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) + range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) { vd->vdev_resilver_txg = 0; + vdev_config_dirty(vd->vdev_top); + } mutex_exit(&vd->vdev_dtl_lock); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:53:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB2FF2A3; Thu, 18 Sep 2014 14:53:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95A11FEB; Thu, 18 Sep 2014 14:53:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IErUvj081430; Thu, 18 Sep 2014 14:53:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IErUUi081429; Thu, 18 Sep 2014 14:53:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201409181453.s8IErUUi081429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 18 Sep 2014 14:53: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: r271777 - stable/10/usr.sbin/bsdinstall/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:53:30 -0000 Author: nwhitehorn Date: Thu Sep 18 14:53:30 2014 New Revision: 271777 URL: http://svnweb.freebsd.org/changeset/base/271777 Log: MFC r271552: Make the default choice for the chroot shell at the end be "No". This allows just pressing enter repeatedly to successfully install a reasonable system. Approved by: re (gjb) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Thu Sep 18 14:50:50 2014 (r271776) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Thu Sep 18 14:53:30 2014 (r271777) @@ -252,7 +252,8 @@ if [ ! -z "$BSDINSTALL_FETCHDEST" ]; the fi dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \ - --yesno "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 + --default-button no --yesno \ + "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 if [ $? -eq 0 ]; then clear mount -t devfs devfs "$BSDINSTALL_CHROOT/dev" From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:54:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E2183D7; Thu, 18 Sep 2014 14:54:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D5BFF3; Thu, 18 Sep 2014 14:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEsKqt081602; Thu, 18 Sep 2014 14:54:20 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEsKlM081601; Thu, 18 Sep 2014 14:54:20 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181454.s8IEsKlM081601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 14:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271778 - head/lib/libunbound X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 14:54:21 -0000 Author: will Date: Thu Sep 18 14:54:20 2014 New Revision: 271778 URL: http://svnweb.freebsd.org/changeset/base/271778 Log: Fix incremental builds involving non-root users with read-only source files. This is a followup commit to r271771. MFC after: 1 month Modified: head/lib/libunbound/Makefile Modified: head/lib/libunbound/Makefile ============================================================================== --- head/lib/libunbound/Makefile Thu Sep 18 14:53:30 2014 (r271777) +++ head/lib/libunbound/Makefile Thu Sep 18 14:54:20 2014 (r271778) @@ -33,7 +33,7 @@ LDADD+= -lssl -lcrypto -lpthread # Misnamed file in upstream source configlexer.l: configlexer.lex - cp -p ${.ALLSRC} ${.TARGET} + cp -fp ${.ALLSRC} ${.TARGET} CLEANFILES+= configlexer.l # Symbol prefix for lex and yacc From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 15:10:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 007E6CD7; Thu, 18 Sep 2014 15:10:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCFB8254; Thu, 18 Sep 2014 15:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IFAN9I087810; Thu, 18 Sep 2014 15:10:23 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IFAMCa087803; Thu, 18 Sep 2014 15:10:22 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201409181510.s8IFAMCa087803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 18 Sep 2014 15:10: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: r271779 - in stable/10/lib/msun: . ld128 ld80 man src 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 15:10:24 -0000 Author: tijl Date: Thu Sep 18 15:10:22 2014 New Revision: 271779 URL: http://svnweb.freebsd.org/changeset/base/271779 Log: MFC r257770 r257818 r257823 r260066 r260067 r260089 r260145 r268587 r268588 r268589 r268590 r268593 r268597 r269758 r270845 r270847 r270893 r270932 r270947 r271147 Merge libm work by kargl, bde and das from the past few months. Besides optimisations and small bug fixes this includes new implementations for C99 functions expl, coshl, sinhl, tanhl, erfl and erfcl. Approved by: re (kib) Added: stable/10/lib/msun/ld128/k_expl.h - copied unchanged from r260066, head/lib/msun/ld128/k_expl.h stable/10/lib/msun/ld128/s_erfl.c - copied unchanged from r268593, head/lib/msun/ld128/s_erfl.c stable/10/lib/msun/ld80/k_expl.h - copied unchanged from r260066, head/lib/msun/ld80/k_expl.h stable/10/lib/msun/ld80/s_erfl.c - copied unchanged from r268593, head/lib/msun/ld80/s_erfl.c stable/10/lib/msun/src/e_coshl.c - copied, changed from r260067, head/lib/msun/src/e_coshl.c stable/10/lib/msun/src/e_sinhl.c - copied, changed from r260067, head/lib/msun/src/e_sinhl.c stable/10/lib/msun/src/s_tanhl.c - copied, changed from r260067, head/lib/msun/src/s_tanhl.c Modified: stable/10/lib/msun/Makefile stable/10/lib/msun/Symbol.map stable/10/lib/msun/ld128/s_expl.c stable/10/lib/msun/ld80/s_expl.c stable/10/lib/msun/man/cosh.3 stable/10/lib/msun/man/erf.3 stable/10/lib/msun/man/sinh.3 stable/10/lib/msun/man/tanh.3 stable/10/lib/msun/src/e_cosh.c stable/10/lib/msun/src/e_lgamma_r.c stable/10/lib/msun/src/e_lgammaf_r.c stable/10/lib/msun/src/e_pow.c stable/10/lib/msun/src/e_sinh.c stable/10/lib/msun/src/imprecise.c stable/10/lib/msun/src/math.h stable/10/lib/msun/src/s_erf.c stable/10/lib/msun/src/s_erff.c stable/10/lib/msun/src/s_round.c stable/10/lib/msun/src/s_roundf.c stable/10/lib/msun/src/s_roundl.c stable/10/lib/msun/src/s_tanh.c stable/10/lib/msun/src/s_tanhf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/Makefile ============================================================================== --- stable/10/lib/msun/Makefile Thu Sep 18 14:54:20 2014 (r271778) +++ stable/10/lib/msun/Makefile Thu Sep 18 15:10:22 2014 (r271779) @@ -72,7 +72,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c s_lround.c s_lroundf.c s_lroundl.c s_modff.c \ s_nan.c s_nearbyint.c s_nextafter.c s_nextafterf.c \ s_nexttowardf.c s_remquo.c s_remquof.c \ - s_rint.c s_rintf.c s_round.c s_roundf.c s_roundl.c \ + s_rint.c s_rintf.c s_round.c s_roundf.c \ s_scalbln.c s_scalbn.c s_scalbnf.c s_signbit.c \ s_signgam.c s_significand.c s_significandf.c s_sin.c s_sinf.c \ s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_tgammaf.c s_trunc.c s_truncf.c \ @@ -97,13 +97,14 @@ COMMON_SRCS+= s_copysignl.c s_fabsl.c s_ .if ${LDBL_PREC} != 53 # If long double != double use these; otherwise, we alias the double versions. COMMON_SRCS+= e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \ - e_fmodl.c e_hypotl.c e_remainderl.c e_sqrtl.c \ + e_coshl.c e_fmodl.c e_hypotl.c \ + e_remainderl.c e_sinhl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ - s_csqrtl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ + s_csqrtl.c s_erfl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ s_frexpl.c s_logbl.c s_logl.c s_nanl.c s_nextafterl.c \ - s_nexttoward.c s_remquol.c s_rintl.c s_scalbnl.c \ - s_sinl.c s_tanl.c s_truncl.c w_cabsl.c + s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c s_scalbnl.c \ + s_sinl.c s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c .endif # C99 complex functions @@ -161,9 +162,9 @@ MLINKS+=cimag.3 cimagf.3 cimag.3 cimagl. cimag.3 creal.3 cimag.3 crealf.3 cimag.3 creall.3 MLINKS+=copysign.3 copysignf.3 copysign.3 copysignl.3 MLINKS+=cos.3 cosf.3 cos.3 cosl.3 -MLINKS+=cosh.3 coshf.3 +MLINKS+=cosh.3 coshf.3 cosh.3 coshl.3 MLINKS+=csqrt.3 csqrtf.3 csqrt.3 csqrtl.3 -MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 +MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 erf.3 erfl.3 erf.3 erfcl.3 MLINKS+=exp.3 expm1.3 exp.3 expm1f.3 exp.3 expm1l.3 exp.3 pow.3 exp.3 powf.3 \ exp.3 exp2.3 exp.3 exp2f.3 exp.3 exp2l.3 exp.3 expf.3 exp.3 expl.3 MLINKS+=fabs.3 fabsf.3 fabs.3 fabsl.3 @@ -209,11 +210,11 @@ MLINKS+=round.3 roundf.3 round.3 roundl. MLINKS+=scalbn.3 scalbln.3 scalbn.3 scalblnf.3 scalbn.3 scalblnl.3 MLINKS+=scalbn.3 scalbnf.3 scalbn.3 scalbnl.3 MLINKS+=sin.3 sinf.3 sin.3 sinl.3 -MLINKS+=sinh.3 sinhf.3 +MLINKS+=sinh.3 sinhf.3 sinh.3 sinhl.3 MLINKS+=sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 cbrtl.3 sqrt.3 sqrtf.3 \ sqrt.3 sqrtl.3 MLINKS+=tan.3 tanf.3 tan.3 tanl.3 -MLINKS+=tanh.3 tanhf.3 +MLINKS+=tanh.3 tanhf.3 tanh.3 tanhl.3 MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3 .include Modified: stable/10/lib/msun/Symbol.map ============================================================================== --- stable/10/lib/msun/Symbol.map Thu Sep 18 14:54:20 2014 (r271778) +++ stable/10/lib/msun/Symbol.map Thu Sep 18 15:10:22 2014 (r271779) @@ -260,23 +260,23 @@ FBSD_1.3 { ccosf; ccosh; ccoshf; + coshl; ctan; ctanf; ctanh; ctanhf; + erfcl; + erfl; expl; expm1l; log10l; log1pl; log2l; logl; + sinhl; + tanhl; /* Implemented as weak aliases for imprecise versions */ - coshl; - erfcl; - erfl; lgammal; powl; - sinhl; - tanhl; tgammal; }; Copied: stable/10/lib/msun/ld128/k_expl.h (from r260066, head/lib/msun/ld128/k_expl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/ld128/k_expl.h Thu Sep 18 15:10:22 2014 (r271779, copy of r260066, head/lib/msun/ld128/k_expl.h) @@ -0,0 +1,328 @@ +/* from: FreeBSD: head/lib/msun/ld128/s_expl.c 251345 2013-06-03 20:09:22Z kargl */ + +/*- + * Copyright (c) 2009-2013 Steven G. Kargl + * 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. + * + * Optimized by Bruce D. Evans. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ld128 version of k_expl.h. See ../ld80/s_expl.c for most comments. + * + * See ../src/e_exp.c and ../src/k_exp.h for precision-independent comments + * about the secondary kernels. + */ + +#define INTERVALS 128 +#define LOG2_INTERVALS 7 +#define BIAS (LDBL_MAX_EXP - 1) + +static const double +/* + * ln2/INTERVALS = L1+L2 (hi+lo decomposition for multiplication). L1 must + * have at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(INTERVALS)) lowest + * bits zero so that multiplication of it by n is exact. + */ +INV_L = 1.8466496523378731e+2, /* 0x171547652b82fe.0p-45 */ +L2 = -1.0253670638894731e-29; /* -0x1.9ff0342542fc3p-97 */ +static const long double +/* 0x1.62e42fefa39ef35793c768000000p-8 */ +L1 = 5.41521234812457272982212595914567508e-3L; + +/* + * XXX values in hex in comments have been lost (or were never present) + * from here. + */ +static const long double +/* + * Domain [-0.002708, 0.002708], range ~[-2.4021e-38, 2.4234e-38]: + * |exp(x) - p(x)| < 2**-124.9 + * (0.002708 is ln2/(2*INTERVALS) rounded up a little). + * + * XXX the coeffs aren't very carefully rounded, and I get 3.6 more bits. + */ +A2 = 0.5, +A3 = 1.66666666666666666666666666651085500e-1L, +A4 = 4.16666666666666666666666666425885320e-2L, +A5 = 8.33333333333333333334522877160175842e-3L, +A6 = 1.38888888888888888889971139751596836e-3L; + +static const double +A7 = 1.9841269841269470e-4, /* 0x1.a01a01a019f91p-13 */ +A8 = 2.4801587301585286e-5, /* 0x1.71de3ec75a967p-19 */ +A9 = 2.7557324277411235e-6, /* 0x1.71de3ec75a967p-19 */ +A10 = 2.7557333722375069e-7; /* 0x1.27e505ab56259p-22 */ + +static const struct { + /* + * hi must be rounded to at most 106 bits so that multiplication + * by r1 in expm1l() is exact, but it is rounded to 88 bits due to + * historical accidents. + * + * XXX it is wasteful to use long double for both hi and lo. ld128 + * exp2l() uses only float for lo (in a very differently organized + * table; ld80 exp2l() is different again. It uses 2 doubles in a + * table organized like this one. 1 double and 1 float would + * suffice). There are different packing/locality/alignment/caching + * problems with these methods. + * + * XXX C's bad %a format makes the bits unreadable. They happen + * to all line up for the hi values 1 before the point and 88 + * in 22 nybbles, but for the low values the nybbles are shifted + * randomly. + */ + long double hi; + long double lo; +} tbl[INTERVALS] = { + 0x1p0L, 0x0p0L, + 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L, + 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L, + 0x1.04315e86e7f84bd738f9a2p0L, 0xd.a47e6ed040bb4bfc05af6455e9b8p-96L, + 0x1.059b0d31585743ae7c548ep0L, 0xb.68ca417fe53e3495f7df4baf84a0p-92L, + 0x1.0706b29ddf6ddc6dc403a8p0L, 0x1.d87b27ed07cb8b092ac75e311753p-88L, + 0x1.0874518759bc808c35f25cp0L, 0x1.9427fa2b041b2d6829d8993a0d01p-88L, + 0x1.09e3ecac6f3834521e060cp0L, 0x5.84d6b74ba2e023da730e7fccb758p-92L, + 0x1.0b5586cf9890f6298b92b6p0L, 0x1.1842a98364291408b3ceb0a2a2bbp-88L, + 0x1.0cc922b7247f7407b705b8p0L, 0x9.3dc5e8aac564e6fe2ef1d431fd98p-92L, + 0x1.0e3ec32d3d1a2020742e4ep0L, 0x1.8af6a552ac4b358b1129e9f966a4p-88L, + 0x1.0fb66affed31af232091dcp0L, 0x1.8a1426514e0b627bda694a400a27p-88L, + 0x1.11301d0125b50a4ebbf1aep0L, 0xd.9318ceac5cc47ab166ee57427178p-92L, + 0x1.12abdc06c31cbfb92bad32p0L, 0x4.d68e2f7270bdf7cedf94eb1cb818p-92L, + 0x1.1429aaea92ddfb34101942p0L, 0x1.b2586d01844b389bea7aedd221d4p-88L, + 0x1.15a98c8a58e512480d573cp0L, 0x1.d5613bf92a2b618ee31b376c2689p-88L, + 0x1.172b83c7d517adcdf7c8c4p0L, 0x1.0eb14a792035509ff7d758693f24p-88L, + 0x1.18af9388c8de9bbbf70b9ap0L, 0x3.c2505c97c0102e5f1211941d2840p-92L, + 0x1.1a35beb6fcb753cb698f68p0L, 0x1.2d1c835a6c30724d5cfae31b84e5p-88L, + 0x1.1bbe084045cd39ab1e72b4p0L, 0x4.27e35f9acb57e473915519a1b448p-92L, + 0x1.1d4873168b9aa7805b8028p0L, 0x9.90f07a98b42206e46166cf051d70p-92L, + 0x1.1ed5022fcd91cb8819ff60p0L, 0x1.121d1e504d36c47474c9b7de6067p-88L, + 0x1.2063b88628cd63b8eeb028p0L, 0x1.50929d0fc487d21c2b84004264dep-88L, + 0x1.21f49917ddc962552fd292p0L, 0x9.4bdb4b61ea62477caa1dce823ba0p-92L, + 0x1.2387a6e75623866c1fadb0p0L, 0x1.c15cb593b0328566902df69e4de2p-88L, + 0x1.251ce4fb2a63f3582ab7dep0L, 0x9.e94811a9c8afdcf796934bc652d0p-92L, + 0x1.26b4565e27cdd257a67328p0L, 0x1.d3b249dce4e9186ddd5ff44e6b08p-92L, + 0x1.284dfe1f5638096cf15cf0p0L, 0x3.ca0967fdaa2e52d7c8106f2e262cp-92L, + 0x1.29e9df51fdee12c25d15f4p0L, 0x1.a24aa3bca890ac08d203fed80a07p-88L, + 0x1.2b87fd0dad98ffddea4652p0L, 0x1.8fcab88442fdc3cb6de4519165edp-88L, + 0x1.2d285a6e4030b40091d536p0L, 0xd.075384589c1cd1b3e4018a6b1348p-92L, + 0x1.2ecafa93e2f5611ca0f45cp0L, 0x1.523833af611bdcda253c554cf278p-88L, + 0x1.306fe0a31b7152de8d5a46p0L, 0x3.05c85edecbc27343629f502f1af2p-92L, + 0x1.32170fc4cd8313539cf1c2p0L, 0x1.008f86dde3220ae17a005b6412bep-88L, + 0x1.33c08b26416ff4c9c8610cp0L, 0x1.96696bf95d1593039539d94d662bp-88L, + 0x1.356c55f929ff0c94623476p0L, 0x3.73af38d6d8d6f9506c9bbc93cbc0p-92L, + 0x1.371a7373aa9caa7145502ep0L, 0x1.4547987e3e12516bf9c699be432fp-88L, + 0x1.38cae6d05d86585a9cb0d8p0L, 0x1.bed0c853bd30a02790931eb2e8f0p-88L, + 0x1.3a7db34e59ff6ea1bc9298p0L, 0x1.e0a1d336163fe2f852ceeb134067p-88L, + 0x1.3c32dc313a8e484001f228p0L, 0xb.58f3775e06ab66353001fae9fca0p-92L, + 0x1.3dea64c12342235b41223ep0L, 0x1.3d773fba2cb82b8244267c54443fp-92L, + 0x1.3fa4504ac801ba0bf701aap0L, 0x4.1832fb8c1c8dbdff2c49909e6c60p-92L, + 0x1.4160a21f72e29f84325b8ep0L, 0x1.3db61fb352f0540e6ba05634413ep-88L, + 0x1.431f5d950a896dc7044394p0L, 0x1.0ccec81e24b0caff7581ef4127f7p-92L, + 0x1.44e086061892d03136f408p0L, 0x1.df019fbd4f3b48709b78591d5cb5p-88L, + 0x1.46a41ed1d005772512f458p0L, 0x1.229d97df404ff21f39c1b594d3a8p-88L, + 0x1.486a2b5c13cd013c1a3b68p0L, 0x1.062f03c3dd75ce8757f780e6ec99p-88L, + 0x1.4a32af0d7d3de672d8bcf4p0L, 0x6.f9586461db1d878b1d148bd3ccb8p-92L, + 0x1.4bfdad5362a271d4397afep0L, 0xc.42e20e0363ba2e159c579f82e4b0p-92L, + 0x1.4dcb299fddd0d63b36ef1ap0L, 0x9.e0cc484b25a5566d0bd5f58ad238p-92L, + 0x1.4f9b2769d2ca6ad33d8b68p0L, 0x1.aa073ee55e028497a329a7333dbap-88L, + 0x1.516daa2cf6641c112f52c8p0L, 0x4.d822190e718226177d7608d20038p-92L, + 0x1.5342b569d4f81df0a83c48p0L, 0x1.d86a63f4e672a3e429805b049465p-88L, + 0x1.551a4ca5d920ec52ec6202p0L, 0x4.34ca672645dc6c124d6619a87574p-92L, + 0x1.56f4736b527da66ecb0046p0L, 0x1.64eb3c00f2f5ab3d801d7cc7272dp-88L, + 0x1.58d12d497c7fd252bc2b72p0L, 0x1.43bcf2ec936a970d9cc266f0072fp-88L, + 0x1.5ab07dd48542958c930150p0L, 0x1.91eb345d88d7c81280e069fbdb63p-88L, + 0x1.5c9268a5946b701c4b1b80p0L, 0x1.6986a203d84e6a4a92f179e71889p-88L, + 0x1.5e76f15ad21486e9be4c20p0L, 0x3.99766a06548a05829e853bdb2b52p-92L, + 0x1.605e1b976dc08b076f592ap0L, 0x4.86e3b34ead1b4769df867b9c89ccp-92L, + 0x1.6247eb03a5584b1f0fa06ep0L, 0x1.d2da42bb1ceaf9f732275b8aef30p-88L, + 0x1.6434634ccc31fc76f8714cp0L, 0x4.ed9a4e41000307103a18cf7a6e08p-92L, + 0x1.66238825522249127d9e28p0L, 0x1.b8f314a337f4dc0a3adf1787ff74p-88L, + 0x1.68155d44ca973081c57226p0L, 0x1.b9f32706bfe4e627d809a85dcc66p-88L, + 0x1.6a09e667f3bcc908b2fb12p0L, 0x1.66ea957d3e3adec17512775099dap-88L, + 0x1.6c012750bdabeed76a9980p0L, 0xf.4f33fdeb8b0ecd831106f57b3d00p-96L, + 0x1.6dfb23c651a2ef220e2cbep0L, 0x1.bbaa834b3f11577ceefbe6c1c411p-92L, + 0x1.6ff7df9519483cf87e1b4ep0L, 0x1.3e213bff9b702d5aa477c12523cep-88L, + 0x1.71f75e8ec5f73dd2370f2ep0L, 0xf.0acd6cb434b562d9e8a20adda648p-92L, + 0x1.73f9a48a58173bd5c9a4e6p0L, 0x8.ab1182ae217f3a7681759553e840p-92L, + 0x1.75feb564267c8bf6e9aa32p0L, 0x1.a48b27071805e61a17b954a2dad8p-88L, + 0x1.780694fde5d3f619ae0280p0L, 0x8.58b2bb2bdcf86cd08e35fb04c0f0p-92L, + 0x1.7a11473eb0186d7d51023ep0L, 0x1.6cda1f5ef42b66977960531e821bp-88L, + 0x1.7c1ed0130c1327c4933444p0L, 0x1.937562b2dc933d44fc828efd4c9cp-88L, + 0x1.7e2f336cf4e62105d02ba0p0L, 0x1.5797e170a1427f8fcdf5f3906108p-88L, + 0x1.80427543e1a11b60de6764p0L, 0x9.a354ea706b8e4d8b718a672bf7c8p-92L, + 0x1.82589994cce128acf88afap0L, 0xb.34a010f6ad65cbbac0f532d39be0p-92L, + 0x1.8471a4623c7acce52f6b96p0L, 0x1.c64095370f51f48817914dd78665p-88L, + 0x1.868d99b4492ec80e41d90ap0L, 0xc.251707484d73f136fb5779656b70p-92L, + 0x1.88ac7d98a669966530bcdep0L, 0x1.2d4e9d61283ef385de170ab20f96p-88L, + 0x1.8ace5422aa0db5ba7c55a0p0L, 0x1.92c9bb3e6ed61f2733304a346d8fp-88L, + 0x1.8cf3216b5448bef2aa1cd0p0L, 0x1.61c55d84a9848f8c453b3ca8c946p-88L, + 0x1.8f1ae991577362b982745cp0L, 0x7.2ed804efc9b4ae1458ae946099d4p-92L, + 0x1.9145b0b91ffc588a61b468p0L, 0x1.f6b70e01c2a90229a4c4309ea719p-88L, + 0x1.93737b0cdc5e4f4501c3f2p0L, 0x5.40a22d2fc4af581b63e8326efe9cp-92L, + 0x1.95a44cbc8520ee9b483694p0L, 0x1.a0fc6f7c7d61b2b3a22a0eab2cadp-88L, + 0x1.97d829fde4e4f8b9e920f8p0L, 0x1.1e8bd7edb9d7144b6f6818084cc7p-88L, + 0x1.9a0f170ca07b9ba3109b8cp0L, 0x4.6737beb19e1eada6825d3c557428p-92L, + 0x1.9c49182a3f0901c7c46b06p0L, 0x1.1f2be58ddade50c217186c90b457p-88L, + 0x1.9e86319e323231824ca78ep0L, 0x6.4c6e010f92c082bbadfaf605cfd4p-92L, + 0x1.a0c667b5de564b29ada8b8p0L, 0xc.ab349aa0422a8da7d4512edac548p-92L, + 0x1.a309bec4a2d3358c171f76p0L, 0x1.0daad547fa22c26d168ea762d854p-88L, + 0x1.a5503b23e255c8b424491cp0L, 0xa.f87bc8050a405381703ef7caff50p-92L, + 0x1.a799e1330b3586f2dfb2b0p0L, 0x1.58f1a98796ce8908ae852236ca94p-88L, + 0x1.a9e6b5579fdbf43eb243bcp0L, 0x1.ff4c4c58b571cf465caf07b4b9f5p-88L, + 0x1.ac36bbfd3f379c0db966a2p0L, 0x1.1265fc73e480712d20f8597a8e7bp-88L, + 0x1.ae89f995ad3ad5e8734d16p0L, 0x1.73205a7fbc3ae675ea440b162d6cp-88L, + 0x1.b0e07298db66590842acdep0L, 0x1.c6f6ca0e5dcae2aafffa7a0554cbp-88L, + 0x1.b33a2b84f15faf6bfd0e7ap0L, 0x1.d947c2575781dbb49b1237c87b6ep-88L, + 0x1.b59728de559398e3881110p0L, 0x1.64873c7171fefc410416be0a6525p-88L, + 0x1.b7f76f2fb5e46eaa7b081ap0L, 0xb.53c5354c8903c356e4b625aacc28p-92L, + 0x1.ba5b030a10649840cb3c6ap0L, 0xf.5b47f297203757e1cc6eadc8bad0p-92L, + 0x1.bcc1e904bc1d2247ba0f44p0L, 0x1.b3d08cd0b20287092bd59be4ad98p-88L, + 0x1.bf2c25bd71e088408d7024p0L, 0x1.18e3449fa073b356766dfb568ff4p-88L, + 0x1.c199bdd85529c2220cb12ap0L, 0x9.1ba6679444964a36661240043970p-96L, + 0x1.c40ab5fffd07a6d14df820p0L, 0xf.1828a5366fd387a7bdd54cdf7300p-92L, + 0x1.c67f12e57d14b4a2137fd2p0L, 0xf.2b301dd9e6b151a6d1f9d5d5f520p-96L, + 0x1.c8f6d9406e7b511acbc488p0L, 0x5.c442ddb55820171f319d9e5076a8p-96L, + 0x1.cb720dcef90691503cbd1ep0L, 0x9.49db761d9559ac0cb6dd3ed599e0p-92L, + 0x1.cdf0b555dc3f9c44f8958ep0L, 0x1.ac51be515f8c58bdfb6f5740a3a4p-88L, + 0x1.d072d4a07897b8d0f22f20p0L, 0x1.a158e18fbbfc625f09f4cca40874p-88L, + 0x1.d2f87080d89f18ade12398p0L, 0x9.ea2025b4c56553f5cdee4c924728p-92L, + 0x1.d5818dcfba48725da05aeap0L, 0x1.66e0dca9f589f559c0876ff23830p-88L, + 0x1.d80e316c98397bb84f9d04p0L, 0x8.805f84bec614de269900ddf98d28p-92L, + 0x1.da9e603db3285708c01a5ap0L, 0x1.6d4c97f6246f0ec614ec95c99392p-88L, + 0x1.dd321f301b4604b695de3cp0L, 0x6.30a393215299e30d4fb73503c348p-96L, + 0x1.dfc97337b9b5eb968cac38p0L, 0x1.ed291b7225a944efd5bb5524b927p-88L, + 0x1.e264614f5a128a12761fa0p0L, 0x1.7ada6467e77f73bf65e04c95e29dp-88L, + 0x1.e502ee78b3ff6273d13014p0L, 0x1.3991e8f49659e1693be17ae1d2f9p-88L, + 0x1.e7a51fbc74c834b548b282p0L, 0x1.23786758a84f4956354634a416cep-88L, + 0x1.ea4afa2a490d9858f73a18p0L, 0xf.5db301f86dea20610ceee13eb7b8p-92L, + 0x1.ecf482d8e67f08db0312fap0L, 0x1.949cef462010bb4bc4ce72a900dfp-88L, + 0x1.efa1bee615a27771fd21a8p0L, 0x1.2dac1f6dd5d229ff68e46f27e3dfp-88L, + 0x1.f252b376bba974e8696fc2p0L, 0x1.6390d4c6ad5476b5162f40e1d9a9p-88L, + 0x1.f50765b6e4540674f84b76p0L, 0x2.862baff99000dfc4352ba29b8908p-92L, + 0x1.f7bfdad9cbe138913b4bfep0L, 0x7.2bd95c5ce7280fa4d2344a3f5618p-92L, + 0x1.fa7c1819e90d82e90a7e74p0L, 0xb.263c1dc060c36f7650b4c0f233a8p-92L, + 0x1.fd3c22b8f71f10975ba4b2p0L, 0x1.2bcf3a5e12d269d8ad7c1a4a8875p-88L +}; + +/* + * Kernel for expl(x). x must be finite and not tiny or huge. + * "tiny" is anything that would make us underflow (|A6*x^6| < ~LDBL_MIN). + * "huge" is anything that would make fn*L1 inexact (|x| > ~2**17*ln2). + */ +static inline void +__k_expl(long double x, long double *hip, long double *lop, int *kp) +{ + long double q, r, r1, t; + double dr, fn, r2; + int n, n2; + + /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */ + /* Use a specialized rint() to get fn. Assume round-to-nearest. */ + /* XXX assume no extra precision for the additions, as for trig fns. */ + /* XXX this set of comments is now quadruplicated. */ + /* XXX but see ../src/e_exp.c for a fix using double_t. */ + fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52; +#if defined(HAVE_EFFICIENT_IRINT) + n = irint(fn); +#else + n = (int)fn; +#endif + n2 = (unsigned)n % INTERVALS; + /* Depend on the sign bit being propagated: */ + *kp = n >> LOG2_INTERVALS; + r1 = x - fn * L1; + r2 = fn * -L2; + r = r1 + r2; + + /* Evaluate expl(endpoint[n2] + r1 + r2) = tbl[n2] * expl(r1 + r2). */ + dr = r; + q = r2 + r * r * (A2 + r * (A3 + r * (A4 + r * (A5 + r * (A6 + + dr * (A7 + dr * (A8 + dr * (A9 + dr * A10)))))))); + t = tbl[n2].lo + tbl[n2].hi; + *hip = tbl[n2].hi; + *lop = tbl[n2].lo + t * (q + r1); +} + +/* + * XXX: the rest of the functions are identical for ld80 and ld128. + * However, we should use scalbnl() for ld128, since long double + * multiplication is very slow on the only supported ld128 arch (sparc64). + */ + +static inline void +k_hexpl(long double x, long double *hip, long double *lop) +{ + float twopkm1; + int k; + + __k_expl(x, hip, lop, &k); + SET_FLOAT_WORD(twopkm1, 0x3f800000 + ((k - 1) << 23)); + *hip *= twopkm1; + *lop *= twopkm1; +} + +static inline long double +hexpl(long double x) +{ + long double hi, lo, twopkm2; + int k; + + twopkm2 = 1; + __k_expl(x, &hi, &lo, &k); + SET_LDBL_EXPSIGN(twopkm2, BIAS + k - 2); + return (lo + hi) * 2 * twopkm2; +} + +#ifdef _COMPLEX_H +/* + * See ../src/k_exp.c for details. + */ +static inline long double complex +__ldexp_cexpl(long double complex z, int expt) +{ + long double exp_x, hi, lo; + long double x, y, scale1, scale2; + int half_expt, k; + + x = creall(z); + y = cimagl(z); + __k_expl(x, &hi, &lo, &k); + + exp_x = (lo + hi) * 0x1p16382; + expt += k - 16382; + + scale1 = 1; + half_expt = expt / 2; + SET_LDBL_EXPSIGN(scale1, BIAS + half_expt); + scale2 = 1; + SET_LDBL_EXPSIGN(scale1, BIAS + expt - half_expt); + + return (cpackl(cos(y) * exp_x * scale1 * scale2, + sinl(y) * exp_x * scale1 * scale2)); +} +#endif /* _COMPLEX_H */ Copied: stable/10/lib/msun/ld128/s_erfl.c (from r268593, head/lib/msun/ld128/s_erfl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/ld128/s_erfl.c Thu Sep 18 15:10:22 2014 (r271779, copy of r268593, head/lib/msun/ld128/s_erfl.c) @@ -0,0 +1,329 @@ +/* @(#)s_erf.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * See s_erf.c for complete comments. + * + * Converted to long double by Steven G. Kargl. + */ +#include + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +/* XXX Prevent compilers from erroneously constant folding these: */ +static const volatile long double tiny = 0x1p-10000L; + +static const double +half= 0.5, +one = 1, +two = 2; +/* + * In the domain [0, 2**-40], only the first term in the power series + * expansion of erf(x) is used. The magnitude of the first neglected + * terms is less than 2**-120. + */ +static const long double +efx = 1.28379167095512573896158903121545167e-01L, /* 0xecbff6a7, 0x481dd788, 0xb64d21a8, 0xeb06fc3f */ +efx8 = 1.02703333676410059116927122497236133e+00L, /* 0xecbff6a7, 0x481dd788, 0xb64d21a8, 0xeb06ff3f */ +/* + * Domain [0, 0.84375], range ~[-1.919e-38, 1.919e-38]: + * |(erf(x) - x)/x - pp(x)/qq(x)| < 2**-125.29 + */ +pp0 = 1.28379167095512573896158903121545167e-01L, /* 0x3ffc06eb, 0xa8214db6, 0x88d71d48, 0xa7f6bfec */ +pp1 = -3.14931554396568573802046931159683404e-01L, /* 0xbffd427d, 0x6ada7263, 0x547eb096, 0x95f37463 */ +pp2 = -5.27514920282183487103576956956725309e-02L, /* 0xbffab023, 0xe5a271e3, 0xb0e79b01, 0x2f7ac962 */ +pp3 = -1.13202828509005281355609495523452713e-02L, /* 0xbff872f1, 0x6a5023a1, 0xe08b3884, 0x326af20f */ +pp4 = -9.18626155872522453865998391206048506e-04L, /* 0xbff4e19f, 0xea5fb024, 0x43247a37, 0xe430b06c */ +pp5 = -7.87518862406176274922506447157284230e-05L, /* 0xbff14a4f, 0x31a85fe0, 0x7fff2204, 0x09c49b37 */ +pp6 = -3.42357944472240436548115331090560881e-06L, /* 0xbfeccb81, 0x4b43c336, 0xcd2eb6c2, 0x903f2d87 */ +pp7 = -1.37317432573890412634717890726745428e-07L, /* 0xbfe826e3, 0x0e915eb6, 0x42aee414, 0xf7e36805 */ +pp8 = -2.71115170113861755855049008732113726e-09L, /* 0xbfe2749e, 0x2b94fd00, 0xecb4d166, 0x0efb91f8 */ +pp9 = -3.37925756196555959454018189718117864e-11L, /* 0xbfdc293e, 0x1d9060cb, 0xd043204a, 0x314cd7f0 */ +qq1 = 4.76672625471551170489978555182449450e-01L, /* 0x3ffde81c, 0xde6531f0, 0x76803bee, 0x526e29e9 */ +qq2 = 1.06713144672281502058807525850732240e-01L, /* 0x3ffbb518, 0xd7a6bb74, 0xcd9bdd33, 0x7601eee5 */ +qq3 = 1.47747613127513761102189201923147490e-02L, /* 0x3ff8e423, 0xae527e18, 0xf12cb447, 0x723b4749 */ +qq4 = 1.39939377672028671891148770908874816e-03L, /* 0x3ff56ed7, 0xba055d84, 0xc21b45c4, 0x388d1812 */ +qq5 = 9.44302939359455241271983309378738276e-05L, /* 0x3ff18c11, 0xc18c99a4, 0x86d0fe09, 0x46387b4c */ +qq6 = 4.56199342312522842161301671745365650e-06L, /* 0x3fed3226, 0x73421d05, 0x08875300, 0x32fa1432 */ +qq7 = 1.53019260483764773845294600092361197e-07L, /* 0x3fe8489b, 0x3a63f627, 0x2b9ad2ce, 0x26516e57 */ +qq8 = 3.25542691121324805094777901250005508e-09L, /* 0x3fe2bf6c, 0x26d93a29, 0x9142be7c, 0x9f1dd043 */ +qq9 = 3.37405581964478060434410167262684979e-11L; /* 0x3fdc28c8, 0xfb8fa1be, 0x10e57eec, 0xaa19e49f */ + +static const long double +erx = 8.42700792949714894142232424201210961e-01L, /* 0x3ffeaf76, 0x7a741088, 0xb0000000, 0x00000000 */ +/* + * Domain [0.84375, 1.25], range ~[-2.521e-36, 2.523e-36]: + * |(erf(x) - erx) - pa(x)/qa(x)| < 2**-120.15 + */ +pa0 = -2.48010117891186017024438233323795897e-17L, /* 0xbfc7c97f, 0x77812279, 0x6c877f22, 0xef4bfb2e */ +pa1 = 4.15107497420594680894327969504526489e-01L, /* 0x3ffda911, 0xf096fbc2, 0x55662005, 0x2337fa64 */ +pa2 = -3.94180628087084846724448515851892609e-02L, /* 0xbffa42e9, 0xab54528c, 0xad529da1, 0x6efc2af3 */ +pa3 = 4.48897599625192107295954790681677462e-02L, /* 0x3ffa6fbc, 0xa65edba1, 0x0e4cbcea, 0x73ef9a31 */ +pa4 = 8.02069252143016600110972019232995528e-02L, /* 0x3ffb4887, 0x0e8b548e, 0x3230b417, 0x11b553b3 */ +pa5 = -1.02729816533435279443621120242391295e-02L, /* 0xbff850a0, 0x041de3ee, 0xd5bca6c9, 0x4ef5f9f2 */ +pa6 = 5.70777694530755634864821094419982095e-03L, /* 0x3ff77610, 0x9b501e10, 0x4c978382, 0x742df68f */ +pa7 = 1.22635150233075521018231779267077071e-03L, /* 0x3ff5417b, 0x0e623682, 0x60327da0, 0x96b9219e */ +pa8 = 5.36100234820204569428412542856666503e-04L, /* 0x3ff41912, 0x27ceb4c1, 0x1d3298ec, 0x84ced627 */ +pa9 = -1.97753571846365167177187858667583165e-04L, /* 0xbff29eb8, 0x23f5bcf3, 0x15c83c46, 0xe4fda98b */ +pa10 = 6.19333039900846970674794789568415105e-05L, /* 0x3ff103c4, 0x60f88e46, 0xc0c9fb02, 0x13cc7fc1 */ +pa11 = -5.40531400436645861492290270311751349e-06L, /* 0xbfed6abe, 0x9665f8a8, 0xdd0ad3ba, 0xe5dc0ee3 */ +qa1 = 9.05041313265490487793231810291907851e-01L, /* 0x3ffecf61, 0x93340222, 0xe9930620, 0xc4e61168 */ +qa2 = 6.79848064708886864767240880834868092e-01L, /* 0x3ffe5c15, 0x0ba858dc, 0xf7900ae9, 0xfea1e09a */ +qa3 = 4.04720609926471677581066689316516445e-01L, /* 0x3ffd9e6f, 0x145e9b00, 0x6d8c1749, 0xd2928623 */ +qa4 = 1.69183273898369996364661075664302225e-01L, /* 0x3ffc5a7c, 0xc2a363c1, 0xd6c19097, 0xef9b4063 */ +qa5 = 7.44476185988067992342479750486764248e-02L, /* 0x3ffb30ef, 0xfc7259ef, 0x1bcbb089, 0x686dd62d */ +qa6 = 2.02981172725892407200420389604788573e-02L, /* 0x3ff94c90, 0x7976cb0e, 0x21e1d36b, 0x0f09ca2b */ +qa7 = 6.94281866271607668268269403102277234e-03L, /* 0x3ff7c701, 0x2b193250, 0xc5d46ecc, 0x374843d8 */ +qa8 = 1.12952275469171559611651594706820034e-03L, /* 0x3ff52818, 0xfd2a7c06, 0xd13e38fd, 0xda4b34f5 */ +qa9 = 3.13736683241992737197226578597710179e-04L, /* 0x3ff348fa, 0x0cb48d18, 0x051f849b, 0x135ccf74 */ +qa10 = 1.17037675204033225470121134087771410e-05L, /* 0x3fee88b6, 0x98f47704, 0xa5d8f8f2, 0xc6422e11 */ +qa11 = 4.61312518293853991439362806880973592e-06L, /* 0x3fed3594, 0xe31db94f, 0x3592b693, 0xed4386b4 */ +qa12 = -1.02158572037456893687737553657431771e-06L; /* 0xbfeb123a, 0xd60d9b1e, 0x1f6fdeb9, 0x7dc8410a */ +/* + * Domain [1.25,2.85715], range ~[-2.922e-37,2.922e-37]: + * |log(x*erfc(x)) + x**2 + 0.5625 - ra(x)/sa(x)| < 2**-121.36 + */ +static const long double +ra0 = -9.86494292470069009555706994426014461e-03L, /* 0xbff84341, 0x239e8709, 0xe941b06a, 0xcb4b6ec5 */ +ra1 = -1.13580436992565640457579040117568870e+00L, /* 0xbfff22c4, 0x133f7c0d, 0x72d5e231, 0x2eb1ee3f */ +ra2 = -4.89744330295291950661185707066921755e+01L, /* 0xc00487cb, 0xa38b4fc2, 0xc136695b, 0xc1df8047 */ +ra3 = -1.10766149300215937173768072715352140e+03L, /* 0xc00914ea, 0x55e6beb3, 0xabc50e07, 0xb6e5664d */ +ra4 = -1.49991031232170934967642795601952100e+04L, /* 0xc00cd4b8, 0xd33243e6, 0xffbf6545, 0x3c57ef6e */ +ra5 = -1.29805749738318462882524181556996692e+05L, /* 0xc00ffb0d, 0xbfeed9b6, 0x5b2a3ff4, 0xe245bd3c */ +ra6 = -7.42828497044940065828871976644647850e+05L, /* 0xc0126ab5, 0x8fe7caca, 0x473352d9, 0xcd4e0c90 */ +ra7 = -2.85637299581890734287995171242421106e+06L, /* 0xc0145cad, 0xa7f76fe7, 0x3e358051, 0x1799f927 */ +ra8 = -7.40674797129824999383748865571026084e+06L, /* 0xc015c412, 0x6fe29c02, 0x298ad158, 0x7d24e45c */ +ra9 = -1.28653420911930973914078724204151759e+07L, /* 0xc016889e, 0x7c2eb0dc, 0x95d5863b, 0x0aa34dc3 */ +ra10 = -1.47198163599330179552932489109452638e+07L, /* 0xc016c136, 0x90b84923, 0xf9bcb497, 0x19bbd0f5 */ +ra11 = -1.07812992258382800318665248311522624e+07L, /* 0xc0164904, 0xe673a113, 0x35d7f079, 0xe13701f3 */ +ra12 = -4.83545565681708642630419905537756076e+06L, /* 0xc0152721, 0xfea094a8, 0x869eb39d, 0x413d6f13 */ +ra13 = -1.23956521201673964822976917356685286e+06L, /* 0xc0132ea0, 0xd3646baa, 0x2fe62b0d, 0xbae5ce85 */ +ra14 = -1.62289333553652417591275333240371812e+05L, /* 0xc0103cf8, 0xaab1e2d6, 0x4c25e014, 0x248d76ab */ +ra15 = -8.82890392601176969729168894389833110e+03L, /* 0xc00c13e7, 0x3b3d8f94, 0x6fbda6f6, 0xe7049a82 */ +ra16 = -1.22591866337261720023681535568334619e+02L, /* 0xc005ea5e, 0x12358891, 0xcfa712c5, 0x77f050d4 */ +sa1 = 6.44508918884710829371852723353794047e+01L, /* 0x400501cd, 0xb69a6c0f, 0x5716de14, 0x47161af6 */ +sa2 = 1.76118475473171481523704824327358534e+03L, /* 0x4009b84b, 0xd305829f, 0xc4c771b0, 0xbf1f7f9b */ +sa3 = 2.69448346969488374857087646131950188e+04L, /* 0x400da503, 0x56bacc05, 0x4fdba68d, 0x2cca27e6 */ +sa4 = 2.56826633369941456778326497384543763e+05L, /* 0x4010f59d, 0x51124428, 0x69c41de6, 0xbd0d5753 */ +sa5 = 1.60647413092257206847700054645905859e+06L, /* 0x40138834, 0xa2184244, 0x557a1bed, 0x68c9d556 */ +sa6 = 6.76963075165099718574753447122393797e+06L, /* 0x40159d2f, 0x7b01b0cc, 0x8bac9e95, 0x5d35d56e */ +sa7 = 1.94295690905361884290986932493647741e+07L, /* 0x40172878, 0xc1172d61, 0x3068501e, 0x2f3c71da */ +sa8 = 3.79774781017759149060839255547073541e+07L, /* 0x401821be, 0xc30d06fe, 0x410563d7, 0x032111fd */ +sa9 = 5.00659831846029484248302236457727397e+07L, /* 0x40187df9, 0x1f97a111, 0xc51d6ac2, 0x4b389793 */ +sa10 = 4.36486287620506484276130525941972541e+07L, /* 0x40184d03, 0x3a618ae0, 0x2a723357, 0xfa45c60a */ +sa11 = 2.43779678791333894255510508253951934e+07L, /* 0x401773fa, 0x6fe10ee2, 0xc467850d, 0xc6b7ff30 */ +sa12 = 8.30732360384443202039372372212966542e+06L, /* 0x4015fb09, 0xee6a5631, 0xdd98de7e, 0x8b00461a */ +sa13 = 1.60160846942050515734192397495105693e+06L, /* 0x40138704, 0x8782bf13, 0x5b8fb315, 0xa898abe5 */ +sa14 = 1.54255505242533291014555153757001825e+05L, /* 0x40102d47, 0xc0abc98e, 0x843c9490, 0xb4352440 */ +sa15 = 5.87949220002375547561467275493888824e+03L, /* 0x400b6f77, 0xe00d21d1, 0xec4d41e8, 0x2f8e1673 */ +sa16 = 4.97272976346793193860385983372237710e+01L; /* 0x40048dd1, 0x816c1b3f, 0x24f540a6, 0x4cfe03cc */ +/* + * Domain [2.85715,9], range ~[-7.886e-37,7.918e-37]: + * |log(x*erfc(x)) + x**2 + 0.5625 - rb(x)/sb(x)| < 2**-120 + */ +static const long double +rb0 = -9.86494292470008707171371994479162369e-3L, /* 0xbff84341, 0x239e86f4, 0x2f57e561, 0xf4469360 */ +rb1 = -1.57047326624110727986326503729442830L, /* 0xbfff920a, 0x8935bf73, 0x8803b894, 0x4656482d */ +rb2 = -1.03228196364885474342132255440317065e2L, /* 0xc0059ce9, 0xac4ed0ff, 0x2cff0ff7, 0x5e70d1ab */ +rb3 = -3.74000570653418227179358710865224376e3L, /* 0xc00ad380, 0x2ebf7835, 0xf6b07ed2, 0x861242f7 */ +rb4 = -8.35435477739098044190860390632813956e4L, /* 0xc00f4657, 0x8c3ae934, 0x3647d7b3, 0x80e76fb7 */ +rb5 = -1.21398672055223642118716640216747152e6L, /* 0xc0132862, 0x2b8761c8, 0x27d18c0f, 0x137c9463 */ +rb6 = -1.17669175877248796101665344873273970e7L, /* 0xc0166719, 0x0b2cea46, 0x81f14174, 0x11602ea5 */ +rb7 = -7.66108006086998253606773064264599615e7L, /* 0xc019243f, 0x3c26f4f0, 0x1cc05241, 0x3b953728 */ +rb8 = -3.32547117558141845968704725353130804e8L, /* 0xc01b3d24, 0x42d8ee26, 0x24ef6f3b, 0x604a8c65 */ +rb9 = -9.41561252426350696802167711221739746e8L, /* 0xc01cc0f8, 0xad23692a, 0x8ddb2310, 0xe9937145 */ +rb10 = -1.67157110805390944549427329626281063e9L, /* 0xc01d8e88, 0x9a903734, 0x09a55fa3, 0xd205c903 */ +rb11 = -1.74339631004410841337645931421427373e9L, /* 0xc01d9fa8, 0x77582d2a, 0xc183b8ab, 0x7e00cb05 */ +rb12 = -9.57655233596934915727573141357471703e8L, /* 0xc01cc8a5, 0x460cc685, 0xd0271fa0, 0x6a70e3da */ +rb13 = -2.26320062731339353035254704082495066e8L, /* 0xc01aafab, 0xd7d76721, 0xc9720e11, 0x6a8bd489 */ +rb14 = -1.42777302996263256686002973851837039e7L, /* 0xc016b3b8, 0xc499689f, 0x2b88d965, 0xc32414f9 */ +sb1 = 1.08512869705594540211033733976348506e2L, /* 0x4005b20d, 0x2db7528d, 0x00d20dcb, 0x858f6191 */ +sb2 = 5.02757713761390460534494530537572834e3L, /* 0x400b3a39, 0x3bf4a690, 0x3025d28d, 0xfd40a891 */ +sb3 = 1.31019107205412870059331647078328430e5L, /* 0x400fffcb, 0x1b71d05e, 0x3b28361d, 0x2a3c3690 */ +sb4 = 2.13021555152296846166736757455018030e6L, /* 0x40140409, 0x3c6984df, 0xc4491d7c, 0xb04aa08d */ +sb5 = 2.26649105281820861953868568619768286e7L, /* 0x401759d6, 0xce8736f0, 0xf28ad037, 0x2a901e0c */ +sb6 = 1.61071939490875921812318684143076081e8L, /* 0x401a3338, 0x686fb541, 0x6bd27d06, 0x4f95c9ac */ +sb7 = 7.66895673844301852676056750497991966e8L, /* 0x401c6daf, 0x31cec121, 0x54699126, 0x4bd9bf9e */ +sb8 = 2.41884450436101936436023058196042526e9L, /* 0x401e2059, 0x46b0b8d7, 0x87b64cbf, 0x78bc296d */ +sb9 = 4.92403055884071695093305291535107666e9L, /* 0x401f257e, 0xbe5ed739, 0x39e17346, 0xcadd2e55 */ +sb10 = 6.18627786365587486459633615573786416e9L, /* 0x401f70bb, 0x1be7a7e7, 0x6a45b5ae, 0x607c70f0 */ +sb11 = 4.45898013426501378097430226324743199e9L, /* 0x401f09c6, 0xa32643d7, 0xf1724620, 0x9ea46c32 */ +sb12 = 1.63006115763329848117160344854224975e9L, /* 0x401d84a3, 0x0996887f, 0x65a4f43b, 0x978c1d74 */ +sb13 = 2.39216717012421697446304015847567721e8L, /* 0x401ac845, 0x09a065c2, 0x30095da7, 0x9d72d6ae */ +sb14 = 7.84837329009278694937250358810225609e6L; /* 0x4015df06, 0xd5290e15, 0x63031fac, 0x4d9c894c */ +/* + * Domain [9,108], range ~[-5.324e-38,5.340e-38]: + * |log(x*erfc(x)) + x**2 + 0.5625 - r(x)/s(x)| < 2**-124 + */ +static const long double +rc0 = -9.86494292470008707171367567652935673e-3L, /* 0xbff84341, 0x239e86f4, 0x2f57e55b, 0x1aa10fd3 */ +rc1 = -1.26229447747315096406518846411562266L, /* 0xbfff4325, 0xbb1aab28, 0xda395cd9, 0xfb861c15 */ +rc2 = -6.13742634438922591780742637728666162e1L, /* 0xc004eafe, 0x7dd51cd8, 0x3c7c5928, 0x751e50cf */ +rc3 = -1.50455835478908280402912854338421517e3L, /* 0xc0097823, 0xbc15b9ab, 0x3d60745c, 0x523e80a5 */ +rc4 = -2.04415631865861549920184039902945685e4L, /* 0xc00d3f66, 0x40b3fc04, 0x5388f2ec, 0xb009e1f0 */ +rc5 = -1.57625662981714582753490610560037638e5L, /* 0xc01033dc, 0xd4dc95b6, 0xfd4da93b, 0xf355b4a9 */ +rc6 = -6.73473451616752528402917538033283794e5L, /* 0xc01248d8, 0x2e73a4f9, 0xcded49c5, 0xfa3bfeb7 */ +rc7 = -1.47433165421387483167186683764364857e6L, /* 0xc01367f1, 0xba77a8f7, 0xcfdd0dbb, 0x25d554b3 */ +rc8 = -1.38811981807868828563794929997744139e6L, /* 0xc01352e5, 0x7d16d9ad, 0xbbdcbf38, 0x38fbc5ea */ +rc9 = -3.59659700530831825640766479698155060e5L, /* 0xc0115f3a, 0xecd57f45, 0x21f8ad6c, 0x910a5958 */ +sc1 = 7.72730753022908298637508998072635696e1L, /* 0x40053517, 0xa10d52bc, 0xdabb55b6, 0xbd0328cd */ +sc2 = 2.36825757341694050500333261769082182e3L, /* 0x400a2808, 0x3e0a9b42, 0x82977842, 0x9c5de29e */ +sc3 = 3.72210540173034735352888847134073099e4L, /* 0x400e22ca, 0x1ba827ef, 0xac8390d7, 0x1fc39a41 */ +sc4 = 3.24136032646418336712461033591393412e5L, /* 0x40113c8a, 0x0216e100, 0xc59d1e44, 0xf0e68d9d */ +sc5 = 1.57836135851134393802505823370009175e6L, /* 0x40138157, 0x95bc7664, 0x17575961, 0xdbe58eeb */ +sc6 = 4.12881981392063738026679089714182355e6L, /* 0x4014f801, 0x9e82e8d2, 0xb8b3a70e, 0xfd84185d */ +sc7 = 5.24438427289213488410596395361544142e6L, /* 0x40154017, 0x81177109, 0x2aa6c3b0, 0x1f106625 */ +sc8 = 2.59909544563616121735963429710382149e6L, /* 0x40143d45, 0xbb90a9b1, 0x12bf9390, 0xa827a700 */ +sc9 = 2.80930665169282501639651995082335693e5L; /* 0x40111258, 0xaa92222e, 0xa97e3216, 0xa237fa6c */ + +long double +erfl(long double x) +{ + long double ax,R,S,P,Q,s,y,z,r; + uint64_t lx, llx; + int32_t i; + uint16_t hx; + + EXTRACT_LDBL128_WORDS(hx, lx, llx, x); + + if((hx & 0x7fff) == 0x7fff) { /* erfl(nan)=nan */ + i = (hx>>15)<<1; + return (1-i)+one/x; /* erfl(+-inf)=+-1 */ + } + + ax = fabsl(x); + if(ax < 0.84375) { + if(ax < 0x1p-40L) { + if(ax < 0x1p-16373L) + return (8*x+efx8*x)/8; /* avoid spurious underflow */ + return x + efx*x; + } + z = x*x; + r = pp0+z*(pp1+z*(pp2+z*(pp3+z*(pp4+z*(pp5+z*(pp6+z*(pp7+ + z*(pp8+z*pp9)))))))); + s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*(qq5+z*(qq6+z*(qq7+ + z*(qq8+z*qq9)))))))); + y = r/s; + return x + x*y; + } + if(ax < 1.25) { + s = ax-one; + P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*(pa6+s*(pa7+ + s*(pa8+s*(pa9+s*(pa10+s*pa11)))))))))); + Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*(qa6+s*(qa7+ + s*(qa8+s*(qa9+s*(qa10+s*(qa11+s*qa12))))))))))); + if(x>=0) return (erx + P/Q); else return (-erx - P/Q); + } + if (ax >= 9) { /* inf>|x|>= 9 */ + if(x>=0) return (one-tiny); else return (tiny-one); + } + s = one/(ax*ax); + if(ax < 2.85715) { /* |x| < 2.85715 */ + R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*(ra7+ + s*(ra8+s*(ra9+s*(ra10+s*(ra11+s*(ra12+s*(ra13+s*(ra14+ + s*(ra15+s*ra16))))))))))))))); + S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+ + s*(sa8+s*(sa9+s*(sa10+s*(sa11+s*(sa12+s*(sa13+s*(sa14+ + s*(sa15+s*sa16))))))))))))))); + } else { /* |x| >= 2.85715 */ + R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*(rb6+s*(rb7+ + s*(rb8+s*(rb9+s*(rb10+s*(rb11+s*(rb12+s*(rb13+ + s*rb14))))))))))))); + S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*(sb7+ + s*(sb8+s*(sb9+s*(sb10+s*(sb11+s*(sb12+s*(sb13+ + s*sb14))))))))))))); + } + z = (float)ax; + r = expl(-z*z-0.5625)*expl((z-ax)*(z+ax)+R/S); + if(x>=0) return (one-r/ax); else return (r/ax-one); +} + +long double +erfcl(long double x) +{ + long double ax,R,S,P,Q,s,y,z,r; + uint64_t lx, llx; + uint16_t hx; + + EXTRACT_LDBL128_WORDS(hx, lx, llx, x); + + if((hx & 0x7fff) == 0x7fff) { /* erfcl(nan)=nan */ + /* erfcl(+-inf)=0,2 */ + return ((hx>>15)<<1)+one/x; + } + + ax = fabsl(x); + if(ax < 0.84375L) { + if(ax < 0x1p-34L) + return one-x; + z = x*x; + r = pp0+z*(pp1+z*(pp2+z*(pp3+z*(pp4+z*(pp5+z*(pp6+z*(pp7+ + z*(pp8+z*pp9)))))))); + s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*(qq5+z*(qq6+z*(qq7+ + z*(qq8+z*qq9)))))))); + y = r/s; + if(ax < 0.25L) { /* x<1/4 */ + return one-(x+x*y); + } else { + r = x*y; + r += (x-half); + return half - r; + } + } + if(ax < 1.25L) { + s = ax-one; + P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*(pa6+s*(pa7+ + s*(pa8+s*(pa9+s*(pa10+s*pa11)))))))))); + Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*(qa6+s*(qa7+ + s*(qa8+s*(qa9+s*(qa10+s*(qa11+s*qa12))))))))))); + if(x>=0) { + z = one-erx; return z - P/Q; + } else { + z = erx+P/Q; return one+z; + } + } + + if(ax < 108) { /* |x| < 108 */ + s = one/(ax*ax); + if(ax < 2.85715) { /* |x| < 2.85715 */ + R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*(ra7+ + s*(ra8+s*(ra9+s*(ra10+s*(ra11+s*(ra12+s*(ra13+s*(ra14+ + s*(ra15+s*ra16))))))))))))))); + S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+ + s*(sa8+s*(sa9+s*(sa10+s*(sa11+s*(sa12+s*(sa13+s*(sa14+ + s*(sa15+s*sa16))))))))))))))); + } else if(ax < 9) { + R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*(rb6+s*(rb7+ + s*(rb8+s*(rb9+s*(rb10+s*(rb11+s*(rb12+s*(rb13+ + s*rb14))))))))))))); + S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*(sb7+ + s*(sb8+s*(sb9+s*(sb10+s*(sb11+s*(sb12+s*(sb13+ + s*sb14))))))))))))); + } else { + if(x < -9) return two-tiny; /* x < -9 */ + R=rc0+s*(rc1+s*(rc2+s*(rc3+s*(rc4+s*(rc5+s*(rc6+s*(rc7+ + s*(rc8+s*rc9)))))))); + S=one+s*(sc1+s*(sc2+s*(sc3+s*(sc4+s*(sc5+s*(sc6+s*(sc7+ + s*(sc8+s*sc9)))))))); + } + z = (float)ax; + r = expl(-z*z-0.5625)*expl((z-ax)*(z+ax)+R/S); + if(x>0) return r/ax; else return two-r/ax; + } else { + if(x>0) return tiny*tiny; else return two-tiny; + } +} Modified: stable/10/lib/msun/ld128/s_expl.c ============================================================================== --- stable/10/lib/msun/ld128/s_expl.c Thu Sep 18 14:54:20 2014 (r271778) +++ stable/10/lib/msun/ld128/s_expl.c Thu Sep 18 15:10:22 2014 (r271779) @@ -38,16 +38,15 @@ __FBSDID("$FreeBSD$"); #include "fpmath.h" #include "math.h" #include "math_private.h" +#include "k_expl.h" -#define INTERVALS 128 -#define LOG2_INTERVALS 7 -#define BIAS (LDBL_MAX_EXP - 1) +/* XXX Prevent compilers from erroneously constant folding these: */ +static const volatile long double +huge = 0x1p10000L, +tiny = 0x1p-10000L; static const long double -huge = 0x1p10000L, twom10000 = 0x1p-10000L; -/* XXX Prevent gcc from erroneously constant folding this: */ -static volatile const long double tiny = 0x1p-10000L; static const long double /* log(2**16384 - 0.5) rounded towards zero: */ @@ -56,184 +55,16 @@ o_threshold = 11356.5234062941439494919 /* log(2**(-16381-64-1)) rounded towards zero: */ u_threshold = -11433.462743336297878837243843452621503L; -static const double -/* - * ln2/INTERVALS = L1+L2 (hi+lo decomposition for multiplication). L1 must - * have at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(INTERVALS)) lowest - * bits zero so that multiplication of it by n is exact. - */ -INV_L = 1.8466496523378731e+2, /* 0x171547652b82fe.0p-45 */ -L2 = -1.0253670638894731e-29; /* -0x1.9ff0342542fc3p-97 */ -static const long double -/* 0x1.62e42fefa39ef35793c768000000p-8 */ -L1 = 5.41521234812457272982212595914567508e-3L; - -static const long double -/* - * Domain [-0.002708, 0.002708], range ~[-2.4021e-38, 2.4234e-38]: - * |exp(x) - p(x)| < 2**-124.9 - * (0.002708 is ln2/(2*INTERVALS) rounded up a little). - */ -A2 = 0.5, -A3 = 1.66666666666666666666666666651085500e-1L, -A4 = 4.16666666666666666666666666425885320e-2L, -A5 = 8.33333333333333333334522877160175842e-3L, -A6 = 1.38888888888888888889971139751596836e-3L; - -static const double -A7 = 1.9841269841269471e-4, -A8 = 2.4801587301585284e-5, -A9 = 2.7557324277411234e-6, -A10 = 2.7557333722375072e-7; - -static const struct { - /* - * hi must be rounded to at most 106 bits so that multiplication - * by r1 in expm1l() is exact, but it is rounded to 88 bits due to - * historical accidents. - */ - long double hi; - long double lo; -} tbl[INTERVALS] = { - 0x1p0L, 0x0p0L, - 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L, - 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L, - 0x1.04315e86e7f84bd738f9a2p0L, 0xd.a47e6ed040bb4bfc05af6455e9b8p-96L, - 0x1.059b0d31585743ae7c548ep0L, 0xb.68ca417fe53e3495f7df4baf84a0p-92L, - 0x1.0706b29ddf6ddc6dc403a8p0L, 0x1.d87b27ed07cb8b092ac75e311753p-88L, - 0x1.0874518759bc808c35f25cp0L, 0x1.9427fa2b041b2d6829d8993a0d01p-88L, - 0x1.09e3ecac6f3834521e060cp0L, 0x5.84d6b74ba2e023da730e7fccb758p-92L, - 0x1.0b5586cf9890f6298b92b6p0L, 0x1.1842a98364291408b3ceb0a2a2bbp-88L, - 0x1.0cc922b7247f7407b705b8p0L, 0x9.3dc5e8aac564e6fe2ef1d431fd98p-92L, - 0x1.0e3ec32d3d1a2020742e4ep0L, 0x1.8af6a552ac4b358b1129e9f966a4p-88L, - 0x1.0fb66affed31af232091dcp0L, 0x1.8a1426514e0b627bda694a400a27p-88L, - 0x1.11301d0125b50a4ebbf1aep0L, 0xd.9318ceac5cc47ab166ee57427178p-92L, - 0x1.12abdc06c31cbfb92bad32p0L, 0x4.d68e2f7270bdf7cedf94eb1cb818p-92L, - 0x1.1429aaea92ddfb34101942p0L, 0x1.b2586d01844b389bea7aedd221d4p-88L, - 0x1.15a98c8a58e512480d573cp0L, 0x1.d5613bf92a2b618ee31b376c2689p-88L, - 0x1.172b83c7d517adcdf7c8c4p0L, 0x1.0eb14a792035509ff7d758693f24p-88L, - 0x1.18af9388c8de9bbbf70b9ap0L, 0x3.c2505c97c0102e5f1211941d2840p-92L, - 0x1.1a35beb6fcb753cb698f68p0L, 0x1.2d1c835a6c30724d5cfae31b84e5p-88L, - 0x1.1bbe084045cd39ab1e72b4p0L, 0x4.27e35f9acb57e473915519a1b448p-92L, - 0x1.1d4873168b9aa7805b8028p0L, 0x9.90f07a98b42206e46166cf051d70p-92L, - 0x1.1ed5022fcd91cb8819ff60p0L, 0x1.121d1e504d36c47474c9b7de6067p-88L, - 0x1.2063b88628cd63b8eeb028p0L, 0x1.50929d0fc487d21c2b84004264dep-88L, - 0x1.21f49917ddc962552fd292p0L, 0x9.4bdb4b61ea62477caa1dce823ba0p-92L, - 0x1.2387a6e75623866c1fadb0p0L, 0x1.c15cb593b0328566902df69e4de2p-88L, - 0x1.251ce4fb2a63f3582ab7dep0L, 0x9.e94811a9c8afdcf796934bc652d0p-92L, - 0x1.26b4565e27cdd257a67328p0L, 0x1.d3b249dce4e9186ddd5ff44e6b08p-92L, - 0x1.284dfe1f5638096cf15cf0p0L, 0x3.ca0967fdaa2e52d7c8106f2e262cp-92L, - 0x1.29e9df51fdee12c25d15f4p0L, 0x1.a24aa3bca890ac08d203fed80a07p-88L, - 0x1.2b87fd0dad98ffddea4652p0L, 0x1.8fcab88442fdc3cb6de4519165edp-88L, - 0x1.2d285a6e4030b40091d536p0L, 0xd.075384589c1cd1b3e4018a6b1348p-92L, - 0x1.2ecafa93e2f5611ca0f45cp0L, 0x1.523833af611bdcda253c554cf278p-88L, - 0x1.306fe0a31b7152de8d5a46p0L, 0x3.05c85edecbc27343629f502f1af2p-92L, - 0x1.32170fc4cd8313539cf1c2p0L, 0x1.008f86dde3220ae17a005b6412bep-88L, - 0x1.33c08b26416ff4c9c8610cp0L, 0x1.96696bf95d1593039539d94d662bp-88L, - 0x1.356c55f929ff0c94623476p0L, 0x3.73af38d6d8d6f9506c9bbc93cbc0p-92L, - 0x1.371a7373aa9caa7145502ep0L, 0x1.4547987e3e12516bf9c699be432fp-88L, - 0x1.38cae6d05d86585a9cb0d8p0L, 0x1.bed0c853bd30a02790931eb2e8f0p-88L, - 0x1.3a7db34e59ff6ea1bc9298p0L, 0x1.e0a1d336163fe2f852ceeb134067p-88L, - 0x1.3c32dc313a8e484001f228p0L, 0xb.58f3775e06ab66353001fae9fca0p-92L, - 0x1.3dea64c12342235b41223ep0L, 0x1.3d773fba2cb82b8244267c54443fp-92L, - 0x1.3fa4504ac801ba0bf701aap0L, 0x4.1832fb8c1c8dbdff2c49909e6c60p-92L, - 0x1.4160a21f72e29f84325b8ep0L, 0x1.3db61fb352f0540e6ba05634413ep-88L, - 0x1.431f5d950a896dc7044394p0L, 0x1.0ccec81e24b0caff7581ef4127f7p-92L, - 0x1.44e086061892d03136f408p0L, 0x1.df019fbd4f3b48709b78591d5cb5p-88L, - 0x1.46a41ed1d005772512f458p0L, 0x1.229d97df404ff21f39c1b594d3a8p-88L, - 0x1.486a2b5c13cd013c1a3b68p0L, 0x1.062f03c3dd75ce8757f780e6ec99p-88L, - 0x1.4a32af0d7d3de672d8bcf4p0L, 0x6.f9586461db1d878b1d148bd3ccb8p-92L, - 0x1.4bfdad5362a271d4397afep0L, 0xc.42e20e0363ba2e159c579f82e4b0p-92L, - 0x1.4dcb299fddd0d63b36ef1ap0L, 0x9.e0cc484b25a5566d0bd5f58ad238p-92L, - 0x1.4f9b2769d2ca6ad33d8b68p0L, 0x1.aa073ee55e028497a329a7333dbap-88L, - 0x1.516daa2cf6641c112f52c8p0L, 0x4.d822190e718226177d7608d20038p-92L, - 0x1.5342b569d4f81df0a83c48p0L, 0x1.d86a63f4e672a3e429805b049465p-88L, - 0x1.551a4ca5d920ec52ec6202p0L, 0x4.34ca672645dc6c124d6619a87574p-92L, - 0x1.56f4736b527da66ecb0046p0L, 0x1.64eb3c00f2f5ab3d801d7cc7272dp-88L, - 0x1.58d12d497c7fd252bc2b72p0L, 0x1.43bcf2ec936a970d9cc266f0072fp-88L, - 0x1.5ab07dd48542958c930150p0L, 0x1.91eb345d88d7c81280e069fbdb63p-88L, - 0x1.5c9268a5946b701c4b1b80p0L, 0x1.6986a203d84e6a4a92f179e71889p-88L, - 0x1.5e76f15ad21486e9be4c20p0L, 0x3.99766a06548a05829e853bdb2b52p-92L, - 0x1.605e1b976dc08b076f592ap0L, 0x4.86e3b34ead1b4769df867b9c89ccp-92L, - 0x1.6247eb03a5584b1f0fa06ep0L, 0x1.d2da42bb1ceaf9f732275b8aef30p-88L, - 0x1.6434634ccc31fc76f8714cp0L, 0x4.ed9a4e41000307103a18cf7a6e08p-92L, - 0x1.66238825522249127d9e28p0L, 0x1.b8f314a337f4dc0a3adf1787ff74p-88L, - 0x1.68155d44ca973081c57226p0L, 0x1.b9f32706bfe4e627d809a85dcc66p-88L, - 0x1.6a09e667f3bcc908b2fb12p0L, 0x1.66ea957d3e3adec17512775099dap-88L, - 0x1.6c012750bdabeed76a9980p0L, 0xf.4f33fdeb8b0ecd831106f57b3d00p-96L, - 0x1.6dfb23c651a2ef220e2cbep0L, 0x1.bbaa834b3f11577ceefbe6c1c411p-92L, - 0x1.6ff7df9519483cf87e1b4ep0L, 0x1.3e213bff9b702d5aa477c12523cep-88L, - 0x1.71f75e8ec5f73dd2370f2ep0L, 0xf.0acd6cb434b562d9e8a20adda648p-92L, - 0x1.73f9a48a58173bd5c9a4e6p0L, 0x8.ab1182ae217f3a7681759553e840p-92L, - 0x1.75feb564267c8bf6e9aa32p0L, 0x1.a48b27071805e61a17b954a2dad8p-88L, - 0x1.780694fde5d3f619ae0280p0L, 0x8.58b2bb2bdcf86cd08e35fb04c0f0p-92L, - 0x1.7a11473eb0186d7d51023ep0L, 0x1.6cda1f5ef42b66977960531e821bp-88L, - 0x1.7c1ed0130c1327c4933444p0L, 0x1.937562b2dc933d44fc828efd4c9cp-88L, - 0x1.7e2f336cf4e62105d02ba0p0L, 0x1.5797e170a1427f8fcdf5f3906108p-88L, - 0x1.80427543e1a11b60de6764p0L, 0x9.a354ea706b8e4d8b718a672bf7c8p-92L, - 0x1.82589994cce128acf88afap0L, 0xb.34a010f6ad65cbbac0f532d39be0p-92L, - 0x1.8471a4623c7acce52f6b96p0L, 0x1.c64095370f51f48817914dd78665p-88L, - 0x1.868d99b4492ec80e41d90ap0L, 0xc.251707484d73f136fb5779656b70p-92L, - 0x1.88ac7d98a669966530bcdep0L, 0x1.2d4e9d61283ef385de170ab20f96p-88L, - 0x1.8ace5422aa0db5ba7c55a0p0L, 0x1.92c9bb3e6ed61f2733304a346d8fp-88L, - 0x1.8cf3216b5448bef2aa1cd0p0L, 0x1.61c55d84a9848f8c453b3ca8c946p-88L, - 0x1.8f1ae991577362b982745cp0L, 0x7.2ed804efc9b4ae1458ae946099d4p-92L, - 0x1.9145b0b91ffc588a61b468p0L, 0x1.f6b70e01c2a90229a4c4309ea719p-88L, - 0x1.93737b0cdc5e4f4501c3f2p0L, 0x5.40a22d2fc4af581b63e8326efe9cp-92L, - 0x1.95a44cbc8520ee9b483694p0L, 0x1.a0fc6f7c7d61b2b3a22a0eab2cadp-88L, - 0x1.97d829fde4e4f8b9e920f8p0L, 0x1.1e8bd7edb9d7144b6f6818084cc7p-88L, - 0x1.9a0f170ca07b9ba3109b8cp0L, 0x4.6737beb19e1eada6825d3c557428p-92L, - 0x1.9c49182a3f0901c7c46b06p0L, 0x1.1f2be58ddade50c217186c90b457p-88L, - 0x1.9e86319e323231824ca78ep0L, 0x6.4c6e010f92c082bbadfaf605cfd4p-92L, - 0x1.a0c667b5de564b29ada8b8p0L, 0xc.ab349aa0422a8da7d4512edac548p-92L, - 0x1.a309bec4a2d3358c171f76p0L, 0x1.0daad547fa22c26d168ea762d854p-88L, - 0x1.a5503b23e255c8b424491cp0L, 0xa.f87bc8050a405381703ef7caff50p-92L, - 0x1.a799e1330b3586f2dfb2b0p0L, 0x1.58f1a98796ce8908ae852236ca94p-88L, - 0x1.a9e6b5579fdbf43eb243bcp0L, 0x1.ff4c4c58b571cf465caf07b4b9f5p-88L, - 0x1.ac36bbfd3f379c0db966a2p0L, 0x1.1265fc73e480712d20f8597a8e7bp-88L, - 0x1.ae89f995ad3ad5e8734d16p0L, 0x1.73205a7fbc3ae675ea440b162d6cp-88L, - 0x1.b0e07298db66590842acdep0L, 0x1.c6f6ca0e5dcae2aafffa7a0554cbp-88L, - 0x1.b33a2b84f15faf6bfd0e7ap0L, 0x1.d947c2575781dbb49b1237c87b6ep-88L, - 0x1.b59728de559398e3881110p0L, 0x1.64873c7171fefc410416be0a6525p-88L, - 0x1.b7f76f2fb5e46eaa7b081ap0L, 0xb.53c5354c8903c356e4b625aacc28p-92L, - 0x1.ba5b030a10649840cb3c6ap0L, 0xf.5b47f297203757e1cc6eadc8bad0p-92L, - 0x1.bcc1e904bc1d2247ba0f44p0L, 0x1.b3d08cd0b20287092bd59be4ad98p-88L, - 0x1.bf2c25bd71e088408d7024p0L, 0x1.18e3449fa073b356766dfb568ff4p-88L, - 0x1.c199bdd85529c2220cb12ap0L, 0x9.1ba6679444964a36661240043970p-96L, - 0x1.c40ab5fffd07a6d14df820p0L, 0xf.1828a5366fd387a7bdd54cdf7300p-92L, - 0x1.c67f12e57d14b4a2137fd2p0L, 0xf.2b301dd9e6b151a6d1f9d5d5f520p-96L, - 0x1.c8f6d9406e7b511acbc488p0L, 0x5.c442ddb55820171f319d9e5076a8p-96L, - 0x1.cb720dcef90691503cbd1ep0L, 0x9.49db761d9559ac0cb6dd3ed599e0p-92L, - 0x1.cdf0b555dc3f9c44f8958ep0L, 0x1.ac51be515f8c58bdfb6f5740a3a4p-88L, - 0x1.d072d4a07897b8d0f22f20p0L, 0x1.a158e18fbbfc625f09f4cca40874p-88L, - 0x1.d2f87080d89f18ade12398p0L, 0x9.ea2025b4c56553f5cdee4c924728p-92L, - 0x1.d5818dcfba48725da05aeap0L, 0x1.66e0dca9f589f559c0876ff23830p-88L, - 0x1.d80e316c98397bb84f9d04p0L, 0x8.805f84bec614de269900ddf98d28p-92L, - 0x1.da9e603db3285708c01a5ap0L, 0x1.6d4c97f6246f0ec614ec95c99392p-88L, - 0x1.dd321f301b4604b695de3cp0L, 0x6.30a393215299e30d4fb73503c348p-96L, - 0x1.dfc97337b9b5eb968cac38p0L, 0x1.ed291b7225a944efd5bb5524b927p-88L, - 0x1.e264614f5a128a12761fa0p0L, 0x1.7ada6467e77f73bf65e04c95e29dp-88L, - 0x1.e502ee78b3ff6273d13014p0L, 0x1.3991e8f49659e1693be17ae1d2f9p-88L, - 0x1.e7a51fbc74c834b548b282p0L, 0x1.23786758a84f4956354634a416cep-88L, - 0x1.ea4afa2a490d9858f73a18p0L, 0xf.5db301f86dea20610ceee13eb7b8p-92L, - 0x1.ecf482d8e67f08db0312fap0L, 0x1.949cef462010bb4bc4ce72a900dfp-88L, - 0x1.efa1bee615a27771fd21a8p0L, 0x1.2dac1f6dd5d229ff68e46f27e3dfp-88L, - 0x1.f252b376bba974e8696fc2p0L, 0x1.6390d4c6ad5476b5162f40e1d9a9p-88L, - 0x1.f50765b6e4540674f84b76p0L, 0x2.862baff99000dfc4352ba29b8908p-92L, - 0x1.f7bfdad9cbe138913b4bfep0L, 0x7.2bd95c5ce7280fa4d2344a3f5618p-92L, - 0x1.fa7c1819e90d82e90a7e74p0L, 0xb.263c1dc060c36f7650b4c0f233a8p-92L, - 0x1.fd3c22b8f71f10975ba4b2p0L, 0x1.2bcf3a5e12d269d8ad7c1a4a8875p-88L -}; - long double expl(long double x) { - union IEEEl2bits u, v; - long double q, r, r1, t, twopk, twopkp10000; - double dr, fn, r2; - int k, n, n2; + union IEEEl2bits u; + long double hi, lo, t, twopk; + int k; uint16_t hx, ix; + DOPRINT_START(&x); + /* Filter out exceptional cases. */ u.e = x; hx = u.xbits.expsign; @@ -241,60 +72,33 @@ expl(long double x) if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */ if (ix == BIAS + LDBL_MAX_EXP) { if (hx & 0x8000) /* x is -Inf or -NaN */ - return (-1 / x); - return (x + x); /* x is +Inf or +NaN */ + RETURNP(-1 / x); + RETURNP(x + x); /* x is +Inf or +NaN */ } if (x > o_threshold) - return (huge * huge); + RETURNP(huge * huge); if (x < u_threshold) - return (tiny * tiny); + RETURNP(tiny * tiny); } else if (ix < BIAS - 114) { /* |x| < 0x1p-114 */ - return (1 + x); /* 1 with inexact iff x != 0 */ + RETURN2P(1, x); /* 1 with inexact iff x != 0 */ } ENTERI(); - /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */ - /* Use a specialized rint() to get fn. Assume round-to-nearest. */ - /* XXX assume no extra precision for the additions, as for trig fns. */ - /* XXX this set of comments is now quadruplicated. */ - fn = (double)x * INV_L + 0x1.8p52 - 0x1.8p52; -#if defined(HAVE_EFFICIENT_IRINT) - n = irint(fn); -#else - n = (int)fn; -#endif - n2 = (unsigned)n % INTERVALS; - k = n >> LOG2_INTERVALS; - r1 = x - fn * L1; - r2 = fn * -L2; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 15:37:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3296C875; Thu, 18 Sep 2014 15:37:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D17F92B; Thu, 18 Sep 2014 15:37:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IFbrj8003719; Thu, 18 Sep 2014 15:37:53 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IFbrh3003718; Thu, 18 Sep 2014 15:37:53 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181537.s8IFbrh3003718@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 15:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271781 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 15:37:54 -0000 Author: will Date: Thu Sep 18 15:37:53 2014 New Revision: 271781 URL: http://svnweb.freebsd.org/changeset/base/271781 Log: bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. If bpobj_space() returned non-zero here, the sublist would have been left open, along with the bonus buffer hold it requires. This call does not invoke any calls to bpobj_close() itself. This bug doesn't have any known vector, but was found on inspection. MFC after: 1 week Sponsored by: Spectra Logic Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc) MFSpectraBSD: r1050998 on 2014/03/26 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Thu Sep 18 15:26:12 2014 (r271780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Thu Sep 18 15:37:53 2014 (r271781) @@ -301,8 +301,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i if (free) { err = bpobj_space(&sublist, &used_before, &comp_before, &uncomp_before); - if (err) + if (err != 0) { + bpobj_close(&sublist); break; + } } err = bpobj_iterate_impl(&sublist, func, arg, tx, free); if (free) { From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 15:41:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAEC0BDA; Thu, 18 Sep 2014 15:41:35 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AECB8ABF; Thu, 18 Sep 2014 15:41:34 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id z12so1086587wgg.28 for ; Thu, 18 Sep 2014 08:41: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:date:message-id :subject:from:to:cc:content-type; bh=8PrbGgbHMhuBjeveJk0onvdw9Nb6fyNACrzolmkQYIU=; b=IoDR8rH5WULthtECGOkdlBpjf3Qvhcz432g0TGooaWrYWXYVDW9ikQ4KCLSd4IgnJD 2tbdoyxkPlKvjdVUn6ZnbxkKFCw1BR/uqLZFrv63tPxMNRjggpM2rxSl5OYf7CQtXxnJ +r11y4cb9HndJ2OViNT/J8rMF7PdYdoQd7YytCuMNexSz/A521InccwDcLF0S26GDqx3 57CcXUDd0f5ne3XsJVNrGs0cRW+un/Z+fdJyFtLHRZulKKXbDxFIG1r8vovFgDUq04t3 Bq9/Pq/7q5Gqkf/0jxdyC7+XC41o4fY0d7t+f0bQx/wMQDdYkdQdnZsdrozQWHrFMq9p toFw== MIME-Version: 1.0 X-Received: by 10.180.189.18 with SMTP id ge18mr858wic.37.1411054892958; Thu, 18 Sep 2014 08:41:32 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Thu, 18 Sep 2014 08:41:32 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: References: <201409180309.s8I39Zmh045601@svn.freebsd.org> <20140918051834.GD89442@FreeBSD.org> <20140918060435.GA5856@ns.kevlo.org> <1411024874.128099.168895241.4A95DCA1@webmail.messagingengine.com> Date: Thu, 18 Sep 2014 23:41:32 +0800 Message-ID: Subject: Re: svn commit: r271735 - head/sys/net From: Marcelo Araujo To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Bruce Simpson , Gleb Smirnoff , "svn-src-head@freebsd.org" , Kevin Lo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 15:41:36 -0000 Hello Adrian, I have a patch, but it is a hack on PF and some very ugly code. Not generic at all. As my hands are dirty now with it, if you don't have too much time, I can take a look on pfsense implementation. Best Regards, 2014-09-18 22:32 GMT+08:00 Adrian Chadd : > There is in pfsense. > > Let me see about twisting some arms again... :) > > > -a > > > On 18 September 2014 00:21, Bruce Simpson wrote: > > On Thu, 18 Sep 2014, at 07:04, Kevin Lo wrote: > >> Sorry, I overlooked that. Marcelo has a patch with 802.1p tagging > >> support, > >> I thought the patch was committed. > > > > I agree the comment change should be reverted. I changed if_ethersubr.c > > many years ago to decode 802.1p tags into the mbuf packet header if they > > are present. > > > > However, to my knowledge, there is no support (e.g. in the form of a > > DiffServ / IntServ mapping) further up in the stack. If someone plans to > > add this, great -- that would be needed for any form of tangible 802.1p > > support. > > > > -- > > BMS (sent via webmail) > > > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 15:56:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 925053BF; Thu, 18 Sep 2014 15:56:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C713D7D; Thu, 18 Sep 2014 15:56:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IFuGD1013403; Thu, 18 Sep 2014 15:56:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IFuEK1013392; Thu, 18 Sep 2014 15:56:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181556.s8IFuEK1013392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 15:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271782 - in head/sys/dev: bge bxe e1000 fxp nfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 15:56:16 -0000 Author: glebius Date: Thu Sep 18 15:56:14 2014 New Revision: 271782 URL: http://svnweb.freebsd.org/changeset/base/271782 Log: - Use if_inc_counter() to increment various counters. - Do not ever set a counter to a value. For those counters that we don't increment, but return directly from hardware create cases in if_get_counter() method. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_lem.c head/sys/dev/fxp/if_fxp.c head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/bge/if_bge.c Thu Sep 18 15:56:14 2014 (r271782) @@ -434,6 +434,7 @@ static int bge_shutdown(device_t); static int bge_ifmedia_upd_locked(if_t); static int bge_ifmedia_upd(if_t); static void bge_ifmedia_sts(if_t, struct ifmediareq *); +static uint64_t bge_get_counter(if_t, ift_counter); static uint8_t bge_nvram_getbyte(struct bge_softc *, int, uint8_t *); static int bge_read_nvram(struct bge_softc *, caddr_t, int, int); @@ -3738,6 +3739,7 @@ bge_attach(device_t dev) if_setioctlfn(ifp, bge_ioctl); if_setstartfn(ifp, bge_start); if_setinitfn(ifp, bge_init); + if_setgetcounterfn(ifp, bge_get_counter); if_setsendqlen(ifp, BGE_TX_RING_CNT - 1); if_setsendqready(ifp); if_sethwassist(ifp, sc->bge_csum_features); @@ -4364,7 +4366,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t } if (bge_newbuf_jumbo(sc, rxidx) != 0) { bge_rxreuse_jumbo(sc, rxidx); - if_inciqdrops(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); continue; } BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); @@ -4377,13 +4379,13 @@ bge_rxeof(struct bge_softc *sc, uint16_t } if (bge_newbuf_std(sc, rxidx) != 0) { bge_rxreuse_std(sc, rxidx); - if_inciqdrops(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); continue; } BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); } - if_incipackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); #ifndef __NO_STRICT_ALIGNMENT /* * For architectures with strict alignment we must make sure @@ -4512,7 +4514,7 @@ bge_txeof(struct bge_softc *sc, uint16_t idx = sc->bge_tx_saved_considx; cur_tx = &sc->bge_ldata.bge_tx_ring[idx]; if (cur_tx->bge_flags & BGE_TXBDFLAG_END) - if_incopackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (sc->bge_cdata.bge_tx_chain[idx] != NULL) { bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[idx], @@ -4917,10 +4919,6 @@ bge_stats_update_regs(struct bge_softc * stats->RecvThresholdHit += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_RXTHRESH_HIT); - if_setcollisions(ifp, (u_long)stats->etherStatsCollisions); - if_setierrors(ifp, (u_long)(stats->NoMoreRxBDs + stats->InputDiscards + - stats->InputErrors)); - if (sc->bge_flags & BGE_FLAG_RDMA_BUG) { /* * If controller transmitted more than BGE_NUM_RDMA_CHANNELS @@ -4997,21 +4995,21 @@ bge_stats_update(struct bge_softc *sc) CSR_READ_4(sc, stats + offsetof(struct bge_stats, stat)) cnt = READ_STAT(sc, stats, txstats.etherStatsCollisions.bge_addr_lo); - if_inccollisions(ifp, (uint32_t)(cnt - sc->bge_tx_collisions)); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, cnt - sc->bge_tx_collisions); sc->bge_tx_collisions = cnt; cnt = READ_STAT(sc, stats, nicNoMoreRxBDs.bge_addr_lo); - if_incierrors(ifp, (uint32_t)(cnt - sc->bge_rx_nobds)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, cnt - sc->bge_rx_nobds); sc->bge_rx_nobds = cnt; cnt = READ_STAT(sc, stats, ifInErrors.bge_addr_lo); - if_incierrors(ifp, (uint32_t)(cnt - sc->bge_rx_inerrs)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, cnt - sc->bge_rx_inerrs); sc->bge_rx_inerrs = cnt; cnt = READ_STAT(sc, stats, ifInDiscards.bge_addr_lo); - if_incierrors(ifp, (uint32_t)(cnt - sc->bge_rx_discards)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, cnt - sc->bge_rx_discards); sc->bge_rx_discards = cnt; cnt = READ_STAT(sc, stats, txstats.ifOutDiscards.bge_addr_lo); - if_incoerrors(ifp, (uint32_t)(cnt - sc->bge_tx_discards)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, cnt - sc->bge_tx_discards); sc->bge_tx_discards = cnt; #undef READ_STAT @@ -5950,7 +5948,7 @@ bge_watchdog(struct bge_softc *sc) if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); bge_init_locked(sc); - if_incoerrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } static void @@ -6770,3 +6768,25 @@ bge_get_eaddr(struct bge_softc *sc, uint } return (*func == NULL ? ENXIO : 0); } + +static uint64_t +bge_get_counter(if_t ifp, ift_counter cnt) +{ + struct bge_softc *sc; + struct bge_mac_stats *stats; + + sc = if_getsoftc(ifp); + if (!BGE_IS_5705_PLUS(sc)) + return (if_get_counter_default(ifp, cnt)); + stats = &sc->bge_mac_stats; + + switch (cnt) { + case IFCOUNTER_IERRORS: + return (stats->NoMoreRxBDs + stats->InputDiscards + + stats->InputErrors); + case IFCOUNTER_COLLISIONS: + return (stats->etherStatsCollisions); + default: + return (if_get_counter_default(ifp, cnt)); + } +} Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/bxe/bxe.c Thu Sep 18 15:56:14 2014 (r271782) @@ -3222,7 +3222,7 @@ bxe_tpa_stop(struct bxe_softc * m->m_flags |= M_FLOWID; #endif - if_incipackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); fp->eth_q_stats.rx_tpa_pkts++; /* pass the frame to the stack */ @@ -3465,7 +3465,7 @@ next_rx: /* pass the frame to the stack */ if (__predict_true(m != NULL)) { - if_incipackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); rx_pkts++; if_input(ifp, m); } @@ -13279,6 +13279,7 @@ bxe_init_ifnet(struct bxe_softc *sc) if_setflags(ifp, (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST)); if_setioctlfn(ifp, bxe_ioctl); if_setstartfn(ifp, bxe_tx_start); + if_setgetcounterfn(ifp, bxe_get_counter); #if __FreeBSD_version >= 800000 if_settransmitfn(ifp, bxe_tx_mq_start); if_setqflushfn(ifp, bxe_mq_flush); Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/bxe/bxe_stats.c Thu Sep 18 15:56:14 2014 (r271782) @@ -1164,50 +1164,54 @@ bxe_storm_stats_update(struct bxe_softc static void bxe_net_stats_update(struct bxe_softc *sc) { - struct bxe_eth_stats *estats = &sc->eth_stats; - if_t ifnet = sc->ifp; - int i; - - if_setipackets(ifnet, - bxe_hilo(&estats->total_unicast_packets_received_hi) + - bxe_hilo(&estats->total_multicast_packets_received_hi) + - bxe_hilo(&estats->total_broadcast_packets_received_hi)); - - if_setopackets(ifnet, - bxe_hilo(&estats->total_unicast_packets_transmitted_hi) + - bxe_hilo(&estats->total_multicast_packets_transmitted_hi) + - bxe_hilo(&estats->total_broadcast_packets_transmitted_hi)); - - if_setibytes(ifnet, bxe_hilo(&estats->total_bytes_received_hi)); - if_setobytes(ifnet, bxe_hilo(&estats->total_bytes_transmitted_hi)); - - for (i = 0; i < sc->num_queues; i++) { - struct tstorm_per_queue_stats *old_tclient = - &sc->fp[i].old_tclient; - if_inciqdrops(ifnet, le32toh(old_tclient->checksum_discard)); - } - - if_setierrors(ifnet, - bxe_hilo(&estats->rx_stat_etherstatsundersizepkts_hi) + - bxe_hilo(&estats->etherstatsoverrsizepkts_hi) + - bxe_hilo(&estats->brb_drop_hi) + - bxe_hilo(&estats->brb_truncate_hi) + - bxe_hilo(&estats->rx_stat_dot3statsfcserrors_hi) + - bxe_hilo(&estats->rx_stat_dot3statsalignmenterrors_hi) + - bxe_hilo(&estats->no_buff_discard_hi)); - - if_setoerrors(ifnet, - bxe_hilo(&estats->rx_stat_dot3statscarriersenseerrors_hi) + - bxe_hilo(&estats->tx_stat_dot3statsinternalmactransmiterrors_hi)); - - if_setimcasts(ifnet, - bxe_hilo(&estats->total_multicast_packets_received_hi)); - - if_setcollisions(ifnet, - bxe_hilo(&estats->tx_stat_etherstatscollisions_hi) + - bxe_hilo(&estats->tx_stat_dot3statslatecollisions_hi) + - bxe_hilo(&estats->tx_stat_dot3statsexcessivecollisions_hi)); + for (int i = 0; i < sc->num_queues; i++) + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, + le32toh(sc->fp[i].old_tclient.checksum_discard)); +} + +uint64_t +bxe_get_counter(if_t ifp, ift_counter cnt) +{ + struct bxe_softc *sc; + struct bxe_eth_stats *estats; + + sc = if_getsoftc(ifp); + estats = &sc->eth_stats; + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (bxe_hilo(&estats->total_unicast_packets_received_hi) + + bxe_hilo(&estats->total_multicast_packets_received_hi) + + bxe_hilo(&estats->total_broadcast_packets_received_hi)); + case IFCOUNTER_OPACKETS: + return (bxe_hilo(&estats->total_unicast_packets_transmitted_hi) + + bxe_hilo(&estats->total_multicast_packets_transmitted_hi) + + bxe_hilo(&estats->total_broadcast_packets_transmitted_hi)); + case IFCOUNTER_IBYTES: + return (bxe_hilo(&estats->total_bytes_received_hi)); + case IFCOUNTER_OBYTES: + return (bxe_hilo(&estats->total_bytes_transmitted_hi)); + case IFCOUNTER_IERRORS: + return (bxe_hilo(&estats->rx_stat_etherstatsundersizepkts_hi) + + bxe_hilo(&estats->etherstatsoverrsizepkts_hi) + + bxe_hilo(&estats->brb_drop_hi) + + bxe_hilo(&estats->brb_truncate_hi) + + bxe_hilo(&estats->rx_stat_dot3statsfcserrors_hi) + + bxe_hilo(&estats->rx_stat_dot3statsalignmenterrors_hi) + + bxe_hilo(&estats->no_buff_discard_hi)); + case IFCOUNTER_OERRORS: + return (bxe_hilo(&estats->rx_stat_dot3statscarriersenseerrors_hi) + + bxe_hilo(&estats->tx_stat_dot3statsinternalmactransmiterrors_hi)); + case IFCOUNTER_IMCASTS: + return (bxe_hilo(&estats->total_multicast_packets_received_hi)); + case IFCOUNTER_COLLISIONS: + return (bxe_hilo(&estats->tx_stat_etherstatscollisions_hi) + + bxe_hilo(&estats->tx_stat_dot3statslatecollisions_hi) + + bxe_hilo(&estats->tx_stat_dot3statsexcessivecollisions_hi)); + default: + return (if_get_counter_default(ifp, cnt)); + } } static void @@ -1669,15 +1673,6 @@ bxe_stats_init(struct bxe_softc *sc) /* prepare statistics ramrod data */ bxe_prep_fw_stats_req(sc); - if_setipackets(sc->ifp, 0); - if_setopackets(sc->ifp, 0); - if_setibytes(sc->ifp, 0); - if_setobytes(sc->ifp, 0); - if_setierrors(sc->ifp, 0); - if_setoerrors(sc->ifp, 0); - if_setimcasts(sc->ifp, 0); - if_setcollisions(sc->ifp, 0); - if (sc->stats_init) { memset(&sc->net_stats_old, 0, sizeof(sc->net_stats_old)); memset(&sc->fw_stats_old, 0, sizeof(sc->fw_stats_old)); @@ -1731,9 +1726,6 @@ bxe_save_statistics(struct bxe_softc *sc UPDATE_QSTAT_OLD(total_tpa_bytes_lo); } - /* save net_device_stats statistics */ - sc->net_stats_old.rx_dropped = if_getiqdrops(sc->ifp); - /* store port firmware statistics */ if (sc->port.pmf) { struct bxe_eth_stats *estats = &sc->eth_stats; Modified: head/sys/dev/bxe/bxe_stats.h ============================================================================== --- head/sys/dev/bxe/bxe_stats.h Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/bxe/bxe_stats.h Thu Sep 18 15:56:14 2014 (r271782) @@ -675,6 +675,7 @@ void bxe_stats_init(struct bxe_softc *sc void bxe_stats_handle(struct bxe_softc *sc, enum bxe_stats_event event); void bxe_save_statistics(struct bxe_softc *sc); void bxe_afex_collect_stats(struct bxe_softc *sc, void *void_afex_stats, uint32_t stats_type); +uint64_t bxe_get_counter(if_t, ift_counter); #endif /* BXE_STATS_H */ Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/e1000/if_em.c Thu Sep 18 15:56:14 2014 (r271782) @@ -215,6 +215,7 @@ static void em_start(if_t); static void em_start_locked(if_t, struct tx_ring *); #endif static int em_ioctl(if_t, u_long, caddr_t); +static uint64_t em_get_counter(if_t, ift_counter); static void em_init(void *); static void em_init_locked(struct adapter *); static void em_stop(void *); @@ -934,9 +935,9 @@ em_mq_start_locked(if_t ifp, struct tx_r } drbr_advance(ifp, txr->br); enq++; - if_incobytes(ifp, next->m_pkthdr.len); + if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len); if (next->m_flags & M_MCAST) - if_incomcasts(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); if_etherbpfmtap(ifp, next); if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) break; @@ -2940,6 +2941,7 @@ em_setup_interface(device_t dev, struct if_setsoftc(ifp, adapter); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_setioctlfn(ifp, em_ioctl); + if_setgetcounterfn(ifp, em_get_counter); #ifdef EM_MULTIQUEUE /* Multiqueue stack interface */ if_settransmitfn(ifp, em_mq_start); @@ -3850,7 +3852,7 @@ em_txeof(struct tx_ring *txr) tx_buffer = &txr->tx_buffers[first]; tx_desc = &txr->tx_base[first]; } - if_incopackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* See if we can continue to the next packet */ last = tx_buffer->next_eop; if (last != -1) { @@ -4450,7 +4452,7 @@ em_rxeof(struct rx_ring *rxr, int count, --count; sendmp = rxr->fmp; if_setrcvif(sendmp, ifp); - if_incipackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); em_receive_checksum(cur, sendmp); #ifndef __NO_STRICT_ALIGNMENT if (adapter->hw.mac.max_frame_size > @@ -5107,7 +5109,6 @@ em_disable_aspm(struct adapter *adapter) static void em_update_stats_counters(struct adapter *adapter) { - if_t ifp; if(adapter->hw.phy.media_type == e1000_media_type_copper || (E1000_READ_REG(&adapter->hw, E1000_STATUS) & E1000_STATUS_LU)) { @@ -5199,19 +5200,29 @@ em_update_stats_counters(struct adapter adapter->stats.tsctfc += E1000_READ_REG(&adapter->hw, E1000_TSCTFC); } - ifp = adapter->ifp; +} + +static uint64_t +em_get_counter(if_t ifp, ift_counter cnt) +{ + struct adapter *adapter; - if_setcollisions(ifp, adapter->stats.colc); + adapter = if_getsoftc(ifp); - /* Rx Errors */ - if_setierrors(ifp, adapter->dropped_pkts + adapter->stats.rxerrc + - adapter->stats.crcerrs + adapter->stats.algnerrc + - adapter->stats.ruc + adapter->stats.roc + - adapter->stats.mpc + adapter->stats.cexterr); - - /* Tx Errors */ - if_setoerrors(ifp, adapter->stats.ecol + adapter->stats.latecol + - adapter->watchdog_events); + switch (cnt) { + case IFCOUNTER_COLLISIONS: + return (adapter->stats.colc); + case IFCOUNTER_IERRORS: + return (adapter->dropped_pkts + adapter->stats.rxerrc + + adapter->stats.crcerrs + adapter->stats.algnerrc + + adapter->stats.ruc + adapter->stats.roc + + adapter->stats.mpc + adapter->stats.cexterr); + case IFCOUNTER_OERRORS: + return (adapter->stats.ecol + adapter->stats.latecol + + adapter->watchdog_events); + default: + return (if_get_counter_default(ifp, cnt)); + } } /* Export a single 32-bit register via a read-only sysctl. */ Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/e1000/if_lem.c Thu Sep 18 15:56:14 2014 (r271782) @@ -180,6 +180,7 @@ static int lem_resume(device_t); static void lem_start(if_t); static void lem_start_locked(if_t ifp); static int lem_ioctl(if_t, u_long, caddr_t); +static uint64_t lem_get_counter(if_t, ift_counter); static void lem_init(void *); static void lem_init_locked(struct adapter *); static void lem_stop(void *); @@ -2464,6 +2465,7 @@ lem_setup_interface(device_t dev, struct if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_setioctlfn(ifp, lem_ioctl); if_setstartfn(ifp, lem_start); + if_setgetcounterfn(ifp, lem_get_counter); if_setsendqlen(ifp, adapter->num_tx_desc - 1); if_setsendqready(ifp); @@ -3122,7 +3124,7 @@ lem_txeof(struct adapter *adapter) ++num_avail; if (tx_buffer->m_head) { - if_incopackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); bus_dmamap_sync(adapter->txtag, tx_buffer->map, BUS_DMASYNC_POSTWRITE); @@ -3681,7 +3683,7 @@ lem_rxeof(struct adapter *adapter, int c if (accept_frame) { if (lem_get_buf(adapter, i) != 0) { - if_inciqdrops(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto discard; } @@ -3712,7 +3714,7 @@ lem_rxeof(struct adapter *adapter, int c if (eop) { if_setrcvif(adapter->fmp, ifp); - if_incipackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); lem_receive_checksum(adapter, current_desc, adapter->fmp); #ifndef __NO_STRICT_ALIGNMENT @@ -4397,7 +4399,6 @@ lem_fill_descriptors (bus_addr_t address static void lem_update_stats_counters(struct adapter *adapter) { - if_t ifp; if(adapter->hw.phy.media_type == e1000_media_type_copper || (E1000_READ_REG(&adapter->hw, E1000_STATUS) & E1000_STATUS_LU)) { @@ -4472,19 +4473,29 @@ lem_update_stats_counters(struct adapter adapter->stats.tsctfc += E1000_READ_REG(&adapter->hw, E1000_TSCTFC); } - ifp = adapter->ifp; +} + +static uint64_t +lem_get_counter(if_t ifp, ift_counter cnt) +{ + struct adapter *adapter; - if_setcollisions(ifp, adapter->stats.colc); + adapter = if_getsoftc(ifp); - /* Rx Errors */ - if_setierrors(ifp, adapter->dropped_pkts + adapter->stats.rxerrc + - adapter->stats.crcerrs + adapter->stats.algnerrc + - adapter->stats.ruc + adapter->stats.roc + - adapter->stats.mpc + adapter->stats.cexterr); - - /* Tx Errors */ - if_setoerrors(ifp, adapter->stats.ecol + adapter->stats.latecol + - adapter->watchdog_events); + switch (cnt) { + case IFCOUNTER_COLLISIONS: + return (adapter->stats.colc); + case IFCOUNTER_IERRORS: + return (adapter->dropped_pkts + adapter->stats.rxerrc + + adapter->stats.crcerrs + adapter->stats.algnerrc + + adapter->stats.ruc + adapter->stats.roc + + adapter->stats.mpc + adapter->stats.cexterr); + case IFCOUNTER_OERRORS: + return (adapter->stats.ecol + adapter->stats.latecol + + adapter->watchdog_events); + default: + return (if_get_counter_default(ifp, cnt)); + } } /* Export a single 32-bit register via a read-only sysctl. */ Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/fxp/if_fxp.c Thu Sep 18 15:56:14 2014 (r271782) @@ -2012,7 +2012,7 @@ fxp_intr_body(struct fxp_softc *sc, if_t return (rx_npkts); } else { /* Reuse RFA and loaded DMA map. */ - if_inciqdrops(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); fxp_discard_rfabuf(sc, rxp); } fxp_add_rfabuf(sc, rxp); @@ -2070,10 +2070,12 @@ fxp_update_stats(struct fxp_softc *sc) hsp->tx_tco += le16toh(sp->tx_tco); hsp->rx_tco += le16toh(sp->rx_tco); - if_incopackets(ifp, le32toh(sp->tx_good)); - if_inccollisions(ifp, le32toh(sp->tx_total_collisions)); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, le32toh(sp->tx_good)); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + le32toh(sp->tx_total_collisions)); if (sp->rx_good) { - if_incipackets(ifp, le32toh(sp->rx_good)); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, + le32toh(sp->rx_good)); sc->rx_idle_secs = 0; } else if (sc->flags & FXP_FLAG_RXBUG) { /* @@ -2081,7 +2083,7 @@ fxp_update_stats(struct fxp_softc *sc) */ sc->rx_idle_secs++; } - if_incierrors(ifp, + if_inc_counter(ifp, IFCOUNTER_IERRORS, le32toh(sp->rx_crc_errors) + le32toh(sp->rx_alignment_errors) + le32toh(sp->rx_rnr_errors) + @@ -2091,7 +2093,8 @@ fxp_update_stats(struct fxp_softc *sc) * threshold by another 512 bytes (64 * 8). */ if (sp->tx_underruns) { - if_incoerrors(ifp, le32toh(sp->tx_underruns)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, + le32toh(sp->tx_underruns)); if (tx_threshold < 192) tx_threshold += 64; } @@ -2244,7 +2247,7 @@ fxp_watchdog(struct fxp_softc *sc) return; device_printf(sc->dev, "device timeout\n"); - if_incoerrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 1); Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Thu Sep 18 15:37:53 2014 (r271781) +++ head/sys/dev/nfe/if_nfe.c Thu Sep 18 15:56:14 2014 (r271782) @@ -2149,7 +2149,7 @@ nfe_rxeof(struct nfe_softc *sc, int coun prog++; if ((sc->nfe_flags & (NFE_JUMBO_SUP | NFE_40BIT_ADDR)) == 0) { if (!(flags & NFE_RX_VALID_V1)) { - if_incierrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); nfe_discard_rxbuf(sc, sc->rxq.cur); continue; } @@ -2159,7 +2159,7 @@ nfe_rxeof(struct nfe_softc *sc, int coun } } else { if (!(flags & NFE_RX_VALID_V2)) { - if_incierrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); nfe_discard_rxbuf(sc, sc->rxq.cur); continue; } @@ -2171,14 +2171,14 @@ nfe_rxeof(struct nfe_softc *sc, int coun } if (flags & NFE_RX_ERROR) { - if_incierrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); nfe_discard_rxbuf(sc, sc->rxq.cur); continue; } m = data->m; if (nfe_newbuf(sc, sc->rxq.cur) != 0) { - if_inciqdrops(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); nfe_discard_rxbuf(sc, sc->rxq.cur); continue; } @@ -2205,7 +2205,7 @@ nfe_rxeof(struct nfe_softc *sc, int coun } } - if_incipackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); NFE_UNLOCK(sc); if_input(ifp, m); @@ -2265,7 +2265,7 @@ nfe_jrxeof(struct nfe_softc *sc, int cou prog++; if ((sc->nfe_flags & (NFE_JUMBO_SUP | NFE_40BIT_ADDR)) == 0) { if (!(flags & NFE_RX_VALID_V1)) { - if_incierrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); nfe_discard_jrxbuf(sc, sc->jrxq.jcur); continue; } @@ -2275,7 +2275,7 @@ nfe_jrxeof(struct nfe_softc *sc, int cou } } else { if (!(flags & NFE_RX_VALID_V2)) { - if_incierrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); nfe_discard_jrxbuf(sc, sc->jrxq.jcur); continue; } @@ -2287,14 +2287,14 @@ nfe_jrxeof(struct nfe_softc *sc, int cou } if (flags & NFE_RX_ERROR) { - if_incierrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); nfe_discard_jrxbuf(sc, sc->jrxq.jcur); continue; } m = data->m; if (nfe_jnewbuf(sc, sc->jrxq.jcur) != 0) { - if_inciqdrops(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); nfe_discard_jrxbuf(sc, sc->jrxq.jcur); continue; } @@ -2321,7 +2321,7 @@ nfe_jrxeof(struct nfe_softc *sc, int cou } } - if_incipackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); NFE_UNLOCK(sc); if_input(ifp, m); @@ -2379,18 +2379,18 @@ nfe_txeof(struct nfe_softc *sc) device_printf(sc->nfe_dev, "tx v1 error 0x%4b\n", flags, NFE_V1_TXERR); - if_incoerrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else - if_incopackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } else { if ((flags & NFE_TX_LASTFRAG_V2) == 0) continue; if ((flags & NFE_TX_ERROR_V2) != 0) { device_printf(sc->nfe_dev, "tx v2 error 0x%4b\n", flags, NFE_V2_TXERR); - if_incoerrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else - if_incopackets(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } /* last fragment of the mbuf chain transmitted */ @@ -2723,7 +2723,7 @@ nfe_watchdog(if_t ifp) if_printf(ifp, "watchdog timeout\n"); if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); - if_incoerrors(ifp, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); nfe_init_locked(sc); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 16:17:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A86C99A7; Thu, 18 Sep 2014 16:17:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93C68F86; Thu, 18 Sep 2014 16:17:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IGHLAk023607; Thu, 18 Sep 2014 16:17:21 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IGHLWr023605; Thu, 18 Sep 2014 16:17:21 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181617.s8IGHLWr023605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 16:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271783 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 16:17:21 -0000 Author: glebius Date: Thu Sep 18 16:17:20 2014 New Revision: 271783 URL: http://svnweb.freebsd.org/changeset/base/271783 Log: Remove a bunch of methods that are superseded by if_inc_counter(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Sep 18 15:56:14 2014 (r271782) +++ head/sys/net/if.c Thu Sep 18 16:17:20 2014 (r271783) @@ -3773,139 +3773,12 @@ if_getvtag(struct mbuf *m) return (m->m_pkthdr.ether_vtag); } -/* Statistics */ -int -if_incipackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_ipackets += pkts; - return (0); -} - -int -if_incopackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_opackets += pkts; - return (0); -} - -int -if_incierrors(if_t ifp, int ierrors) -{ - ((struct ifnet *)ifp)->if_ierrors += ierrors; - return (0); -} - - -int -if_setierrors(if_t ifp, int ierrors) -{ - ((struct ifnet *)ifp)->if_ierrors = ierrors; - return (0); -} - -int -if_setoerrors(if_t ifp, int oerrors) -{ - ((struct ifnet *)ifp)->if_oerrors = oerrors; - return (0); -} - -int if_incoerrors(if_t ifp, int oerrors) -{ - ((struct ifnet *)ifp)->if_oerrors += oerrors; - return (0); -} - -int if_inciqdrops(if_t ifp, int val) -{ - ((struct ifnet *)ifp)->if_iqdrops += val; - return (0); -} - -int -if_setcollisions(if_t ifp, int collisions) -{ - ((struct ifnet *)ifp)->if_collisions = collisions; - return (0); -} - -int -if_inccollisions(if_t ifp, int collisions) -{ - ((struct ifnet *)ifp)->if_collisions += collisions; - return (0); -} - -int -if_setipackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_ipackets = pkts; - return (0); -} - -int -if_setopackets(if_t ifp, int pkts) -{ - ((struct ifnet *)ifp)->if_opackets = pkts; - return (0); -} - -int -if_incobytes(if_t ifp, int bytes) -{ - ((struct ifnet *)ifp)->if_obytes += bytes; - return (0); -} - -int -if_setibytes(if_t ifp, int bytes) -{ - ((struct ifnet *)ifp)->if_ibytes = bytes; - return (0); -} - -int -if_setobytes(if_t ifp, int bytes) -{ - ((struct ifnet *)ifp)->if_obytes = bytes; - return (0); -} - - int if_sendq_empty(if_t ifp) { return IFQ_DRV_IS_EMPTY(&((struct ifnet *)ifp)->if_snd); } -int if_getiqdrops(if_t ifp) -{ - return ((struct ifnet *)ifp)->if_iqdrops; -} - -int -if_incimcasts(if_t ifp, int mcast) -{ - ((struct ifnet *)ifp)->if_imcasts += mcast; - return (0); -} - - -int -if_incomcasts(if_t ifp, int mcast) -{ - ((struct ifnet *)ifp)->if_omcasts += mcast; - return (0); -} - -int -if_setimcasts(if_t ifp, int mcast) -{ - ((struct ifnet *)ifp)->if_imcasts = mcast; - return (0); -} - - struct ifaddr * if_getifaddr(if_t ifp) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Sep 18 15:56:14 2014 (r271782) +++ head/sys/net/if_var.h Thu Sep 18 16:17:20 2014 (r271783) @@ -582,27 +582,6 @@ int if_multiaddr_count(if_t ifp, int max int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); -/* Statistics */ - -int if_incipackets(if_t ifp, int pkt); -int if_incopackets(if_t ifp, int pkts); -int if_incierrors(if_t ifp, int ierrors); -int if_incoerrors(if_t ifp, int oerrors); -int if_inciqdrops(if_t ifp, int val); -int if_setierrors(if_t ifp, int ierrors); -int if_setoerrors(if_t ifp, int oerrors); -int if_setcollisions(if_t ifp, int collisions); -int if_inccollisions(if_t ifp, int collisions); -int if_incobytes(if_t ifp, int bytes); -int if_getiqdrops(if_t ifp); -int if_incimcasts(if_t ifp, int imcasts); -int if_incomcasts(if_t ifp, int imcasts); -int if_setipackets(if_t ifp, int pkts); -int if_setopackets(if_t ifp, int pkts); -int if_setibytes(if_t ifp, int bytes); -int if_setobytes(if_t ifp, int bytes); -int if_setimcasts(if_t ifp, int pkts); - /* Functions */ void if_setinitfn(if_t ifp, void (*)(void *)); void if_setioctlfn(if_t ifp, int (*)(if_t, u_long, caddr_t)); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 16:20:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C9A0C3F; Thu, 18 Sep 2014 16:20:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2FECC; Thu, 18 Sep 2014 16:20:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IGKIcK024084; Thu, 18 Sep 2014 16:20:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IGKI4o024082; Thu, 18 Sep 2014 16:20:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409181620.s8IGKI4o024082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 18 Sep 2014 16:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271784 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 16:20:18 -0000 Author: adrian Date: Thu Sep 18 16:20:17 2014 New Revision: 271784 URL: http://svnweb.freebsd.org/changeset/base/271784 Log: Fix the handling of EOP in status descriptors for if_igb(4) and don't double-free mbufs. Like ixgbe(4) chipsets, EOP is only set on the final descriptor in a chain of descriptors. So, to free the whole list of descriptors, we should free the current slot _and_ the assembled list of descriptors that make up the fragment list. The existing code was setting discard once it saw EOP + an error status; it then freed all the subsequent descriptors until the next EOP. That's totally the wrong order. Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Sep 18 16:17:20 2014 (r271783) +++ head/sys/dev/e1000/if_igb.c Thu Sep 18 16:20:17 2014 (r271784) @@ -4495,7 +4495,6 @@ skip_head: rxr->fmp = NULL; rxr->lmp = NULL; - rxr->discard = FALSE; bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -5039,15 +5038,16 @@ igb_rxeof(struct igb_queue *que, int cou pkt_info = le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info); eop = ((staterr & E1000_RXD_STAT_EOP) == E1000_RXD_STAT_EOP); - /* Make sure all segments of a bad packet are discarded */ - if (((staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) != 0) || - (rxr->discard)) { + /* + * Free the frame (all segments) if we're at EOP and + * it's an error. + * + * The datasheet states that EOP + status is only valid for + * the final segment in a multi-segment frame. + */ + if (eop && ((staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) != 0)) { adapter->dropped_pkts++; ++rxr->rx_discarded; - if (!eop) /* Catch subsequent segs */ - rxr->discard = TRUE; - else - rxr->discard = FALSE; igb_rx_discard(rxr, i); goto next_desc; } Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Thu Sep 18 16:17:20 2014 (r271783) +++ head/sys/dev/e1000/if_igb.h Thu Sep 18 16:20:17 2014 (r271784) @@ -336,7 +336,6 @@ struct rx_ring { struct lro_ctrl lro; bool lro_enabled; bool hdr_split; - bool discard; struct mtx rx_mtx; char mtx_name[16]; u32 next_to_refresh; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 16:38:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21E8941F; Thu, 18 Sep 2014 16:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D387237; Thu, 18 Sep 2014 16:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IGc3uj033217; Thu, 18 Sep 2014 16:38:03 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IGc369033216; Thu, 18 Sep 2014 16:38:03 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181638.s8IGc369033216@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 16:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271785 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 16:38:04 -0000 Author: will Date: Thu Sep 18 16:38:03 2014 New Revision: 271785 URL: http://svnweb.freebsd.org/changeset/base/271785 Log: Reorder sysctls for spa.c global tunables; add sysctl for ccw_retry_interval. MFC after: 1 month Sponsored by: Spectra Logic Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Sep 18 16:20:17 2014 (r271784) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Sep 18 16:38:03 2014 (r271785) @@ -83,16 +83,20 @@ /* Check hostid on import? */ static int check_hostid = 1; -SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RWTUN, &check_hostid, 0, - "Check hostid on import?"); - /* * The interval, in seconds, at which failed configuration cache file writes * should be retried. */ static int zfs_ccw_retry_interval = 300; +SYSCTL_DECL(_vfs_zfs); +SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RWTUN, &check_hostid, 0, + "Check hostid on import?"); +TUNABLE_INT("vfs.zfs.ccw_retry_interval", &zfs_ccw_retry_interval); +SYSCTL_INT(_vfs_zfs, OID_AUTO, ccw_retry_interval, CTLFLAG_RW, + &zfs_ccw_retry_interval, 0, + "Configuration cache file write, retry after failure, interval (seconds)"); + typedef enum zti_modes { ZTI_MODE_FIXED, /* value is # of threads (min 1) */ ZTI_MODE_BATCH, /* cpu-intensive; value is ignored */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 16:44:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AE00B86; Thu, 18 Sep 2014 16:44:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D077633E; Thu, 18 Sep 2014 16:44:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IGiSu3038126; Thu, 18 Sep 2014 16:44:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IGiSXC038125; Thu, 18 Sep 2014 16:44:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181644.s8IGiSXC038125@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 16:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271786 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 16:44:29 -0000 Author: glebius Date: Thu Sep 18 16:44:28 2014 New Revision: 271786 URL: http://svnweb.freebsd.org/changeset/base/271786 Log: - Use if_get_counter() to fetch ifnet statistics. - Report IFCOUNTER_OQDROPS to linprocfs. Wasn't there before. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu Sep 18 16:38:03 2014 (r271785) +++ head/sys/compat/linprocfs/linprocfs.c Thu Sep 18 16:44:28 2014 (r271786) @@ -1139,26 +1139,26 @@ linprocfs_donetdev(PFS_FILL_ARGS) linux_ifname(ifp, ifname, sizeof ifname); sbuf_printf(sb, "%6.6s: ", ifname); sbuf_printf(sb, "%7ju %7ju %4ju %4ju %4lu %5lu %10lu %9ju ", - (uintmax_t )ifp->if_ibytes, /* rx_bytes */ - (uintmax_t )ifp->if_ipackets, /* rx_packets */ - (uintmax_t )ifp->if_ierrors, /* rx_errors */ - (uintmax_t )ifp->if_iqdrops, /* rx_dropped + - * rx_missed_errors */ + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IBYTES), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IERRORS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IQDROPS), + /* rx_missed_errors */ 0UL, /* rx_fifo_errors */ 0UL, /* rx_length_errors + * rx_over_errors + * rx_crc_errors + * rx_frame_errors */ 0UL, /* rx_compressed */ - (uintmax_t )ifp->if_imcasts); /* multicast, - * XXX-BZ rx only? */ + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IMCASTS)); + /* XXX-BZ rx only? */ sbuf_printf(sb, "%8ju %7ju %4ju %4lu %4lu %5ju %7lu %10lu\n", - (uintmax_t )ifp->if_obytes, /* tx_bytes */ - (uintmax_t )ifp->if_opackets, /* tx_packets */ - (uintmax_t )ifp->if_oerrors, /* tx_errors */ - 0UL, /* tx_dropped */ + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OBYTES), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OERRORS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OQDROPS), 0UL, /* tx_fifo_errors */ - (uintmax_t )ifp->if_collisions, /* collisions */ + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_COLLISIONS), 0UL, /* tx_carrier_errors + * tx_aborted_errors + * tx_window_errors + From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 16:53:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E90EDA2; Thu, 18 Sep 2014 16:53:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC02613; Thu, 18 Sep 2014 16:53:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IGrin3042652; Thu, 18 Sep 2014 16:53:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IGris8042650; Thu, 18 Sep 2014 16:53:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409181653.s8IGris8042650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 18 Sep 2014 16:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271787 - head/release/picobsd/tinyware/simple_httpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 16:53:45 -0000 Author: pfg Date: Thu Sep 18 16:53:44 2014 New Revision: 271787 URL: http://svnweb.freebsd.org/changeset/base/271787 Log: simple_httpd: cosmetic cleanups. Many tab vs space cleanups. Use setpgid() instead of setpgrp() which is more portable, MFC after: 5 weeks Modified: head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Modified: head/release/picobsd/tinyware/simple_httpd/simple_httpd.c ============================================================================== --- head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Thu Sep 18 16:44:28 2014 (r271786) +++ head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Thu Sep 18 16:53:44 2014 (r271787) @@ -160,8 +160,8 @@ http_date(void) void http_output(const char *html) { - write(con_sock, html, strlen(html)); - write(con_sock, "\r\n", 2); + write(con_sock, html, strlen(html)); + write(con_sock, "\r\n", 2); } @@ -172,30 +172,30 @@ http_output(const char *html) void log_line(char *req) { - char log_buff[256]; - char msg[1024]; - char env_host[80], env_addr[80]; - long addr; - FILE *log; + char log_buff[256]; + char msg[1024]; + char env_host[80], env_addr[80]; + long addr; + FILE *log; strcpy(log_buff,inet_ntoa(source.sin_addr)); sprintf(env_addr, "REMOTE_ADDR=%s",log_buff); - addr=inet_addr(log_buff); - - strcpy(msg,adate()); - strcat(msg," "); - hst=gethostbyaddr((char*) &addr, 4, AF_INET); + addr=inet_addr(log_buff); + + strcpy(msg,adate()); + strcat(msg," "); + hst=gethostbyaddr((char*) &addr, 4, AF_INET); /* If DNS hostname exists */ - if (hst) { + if (hst) { strcat(msg,hst->h_name); sprintf(env_host, "REMOTE_HOST=%s",hst->h_name); } - strcat(msg," ("); - strcat(msg,log_buff); - strcat(msg,") "); - strcat(msg,req); + strcat(msg," ("); + strcat(msg,log_buff); + strcat(msg,") "); + strcat(msg,req); if (daemonize) { log=fopen(logfile,"a"); @@ -226,8 +226,8 @@ http_request(void) lg = read(con_sock, req, 1024); - if ((p=strstr(req,"\n"))) *p=0; - if ((p=strstr(req,"\r"))) *p=0; + if ((p=strstr(req,"\n"))) *p=0; + if ((p=strstr(req,"\r"))) *p=0; log_line(req); @@ -253,40 +253,40 @@ http_request(void) filename = strtok(NULL, " "); c = strtok(NULL, " "); - if (fetch_mode != NULL) filename=fetch_mode; - if (filename == NULL || - strlen(filename)==1) filename="/index.html"; + if (fetch_mode != NULL) filename=fetch_mode; + if (filename == NULL || + strlen(filename)==1) filename="/index.html"; - while (filename[0]== '/') filename++; + while (filename[0]== '/') filename++; - /* CGI handling. Untested */ - if (!strncmp(filename,"cgi-bin/",8)) - { - par=0; - if ((par=strstr(filename,"?"))) - { - *par=0; - par++; - } - if (access(filename,X_OK)) goto conti; - stat (filename,&file_status); - if (setuid(file_status.st_uid)) return; - if (seteuid(file_status.st_uid)) return; - if (!fork()) - { - close(1); - dup(con_sock); - /*printf("HTTP/1.0 200 OK\nContent-type: text/html\n\n\n");*/ + /* CGI handling. Untested */ + if (!strncmp(filename,"cgi-bin/",8)) + { + par=0; + if ((par=strstr(filename,"?"))) + { + *par=0; + par++; + } + if (access(filename,X_OK)) goto conti; + stat (filename,&file_status); + if (setuid(file_status.st_uid)) return; + if (seteuid(file_status.st_uid)) return; + if (!fork()) + { + close(1); + dup(con_sock); + /*printf("HTTP/1.0 200 OK\nContent-type: text/html\n\n\n");*/ printf("HTTP/1.0 200 OK\r\n"); - /* Plug in environment variable, others in log_line */ + /* Plug in environment variable, others in log_line */ setenv("SERVER_SOFTWARE", "FreeBSD/PicoBSD", 1); execlp (filename,filename,par,(char *)0); - } - wait(&i); - return; - } - conti: + } + wait(&i); + return; + } + conti: if (filename == NULL) { http_output(http_405[0]); http_output(http_405[1]); @@ -307,8 +307,8 @@ http_request(void) /* Open filename */ fd = open(filename, O_RDONLY); if (fd < 0) { - http_output(http_404[0]); - http_output(http_404[1]); + http_output(http_404[0]); + http_output(http_404[1]); goto end_request; } @@ -325,7 +325,7 @@ http_request(void) http_output(http_404[1]); goto end_request2; } - + /* Past this point we are serving either a GET or HEAD */ /* Print all the header info */ http_output(http_200); @@ -371,14 +371,14 @@ end_request: int main(int argc, char *argv[]) { - int ch, ld; - int httpd_group = 65534; - pid_t server_pid; - + int ch, ld; + pid_t httpd_group = 65534; + pid_t server_pid; + /* Default for html directory */ strcpy (homedir,getenv("HOME")); - if (!geteuid()) strcpy (homedir,"/httphome"); - else strcat (homedir,"/httphome"); + if (!geteuid()) strcpy (homedir,"/httphome"); + else strcat (homedir,"/httphome"); /* Defaults for log file */ if (geteuid()) { @@ -420,10 +420,10 @@ main(int argc, char *argv[]) printf("usage: simple_httpd [[-d directory][-g grpid][-l logfile][-p port][-vD]]\n"); exit(1); /* NOTREACHED */ - } + } /* Not running as root and no port supplied, assume 1080 */ - if ((http_port == 80) && geteuid()) { + if ((http_port == 80) && geteuid()) { http_port = 1080; } @@ -437,15 +437,15 @@ main(int argc, char *argv[]) } /* Create log file if it doesn't exit */ - if ((access(logfile,W_OK)) && daemonize) { - ld = open (logfile,O_WRONLY); + if ((access(logfile,W_OK)) && daemonize) { + ld = open (logfile,O_WRONLY); chmod (logfile,00600); close(ld); } - init_servconnection(); + init_servconnection(); - if (verbose) { + if (verbose) { printf("Server started with options \n"); printf("port: %d\n",http_port); if (fetch_mode == NULL) printf("html home: %s\n",homedir); @@ -453,7 +453,7 @@ main(int argc, char *argv[]) } /* httpd is spawned */ - if (daemonize) { + if (daemonize) { if ((server_pid = fork()) != 0) { wait3(0,WNOHANG,0); if (verbose) printf("pid: %d\n",server_pid); @@ -462,16 +462,17 @@ main(int argc, char *argv[]) wait3(0,WNOHANG,0); } - if (fetch_mode == NULL) setpgrp(0,httpd_group); + if (fetch_mode == NULL) + setpgrp((pid_t)0, httpd_group); /* How many connections do you want? * Keep this lower than the available number of processes */ - if (listen(http_sock,15) < 0) exit(1); + if (listen(http_sock,15) < 0) exit(1); - label: + label: wait_connection(); - + if (fork()) { wait3(0,WNOHANG,0); close(con_sock); @@ -488,13 +489,13 @@ main(int argc, char *argv[]) char * adate(void) { - static char out[50]; - time_t now; - struct tm *t; - time(&now); - t = localtime(&now); - sprintf(out, "%02d:%02d:%02d %02d/%02d/%02d", - t->tm_hour, t->tm_min, t->tm_sec, - t->tm_mday, t->tm_mon+1, t->tm_year ); - return out; + static char out[50]; + time_t now; + struct tm *t; + time(&now); + t = localtime(&now); + sprintf(out, "%02d:%02d:%02d %02d/%02d/%02d", + t->tm_hour, t->tm_min, t->tm_sec, + t->tm_mday, t->tm_mon+1, t->tm_year ); + return out; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 16:55:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0C28F0F; Thu, 18 Sep 2014 16:55:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71F2D62F; Thu, 18 Sep 2014 16:55:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IGtgnX042985; Thu, 18 Sep 2014 16:55:42 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IGtgft042984; Thu, 18 Sep 2014 16:55:42 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181655.s8IGtgft042984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 16:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 16:55:42 -0000 Author: will Date: Thu Sep 18 16:55:41 2014 New Revision: 271788 URL: http://svnweb.freebsd.org/changeset/base/271788 Log: Enable ZFS debug flags to be modified via vfs.zfs.debug_flags. This is primarily only of interest to ZFS developers, but it makes it easier to get additional debugging. Submitted by: gibbs MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:53:44 2014 (r271787) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:55:41 2014 (r271788) @@ -259,6 +259,33 @@ SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, "Try to recover from otherwise-fatal errors."); +static int +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) +{ + int err, val; + + val = zfs_flags; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + /* + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all + * arc buffers in the system have the necessary additional + * checksum data. However, it is safe to disable at any + * time. + */ + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) + val &= ~ZFS_DEBUG_MODIFY; + zfs_flags = val; + + return (0); +} +TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); + /* * If destroy encounters an EIO while reading metadata (e.g. indirect * blocks), space referenced by the missing metadata can not be freed. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:01:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A34015D; Thu, 18 Sep 2014 17:01:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75CC074F; Thu, 18 Sep 2014 17:01:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IH1kGE045384; Thu, 18 Sep 2014 17:01:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IH1kfv045383; Thu, 18 Sep 2014 17:01:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409181701.s8IH1kfv045383@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 18 Sep 2014 17:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271789 - head/usr.sbin/lpr/lpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:01:46 -0000 Author: pfg Date: Thu Sep 18 17:01:45 2014 New Revision: 271789 URL: http://svnweb.freebsd.org/changeset/base/271789 Log: lpr: replace setpgrp(2) with setpgid(2). setpgid(2) is more portable than setpgrp(2). The BSD variant of setpgrp is a wrapper for setpgid(2) anyways. MFC after: 5 weeks Modified: head/usr.sbin/lpr/lpd/printjob.c Modified: head/usr.sbin/lpr/lpd/printjob.c ============================================================================== --- head/usr.sbin/lpr/lpd/printjob.c Thu Sep 18 16:55:41 2014 (r271788) +++ head/usr.sbin/lpr/lpd/printjob.c Thu Sep 18 17:01:45 2014 (r271789) @@ -176,7 +176,7 @@ printjob(struct printer *pp) } if(setgid(getegid()) != 0) err(1, "setgid() failed"); printpid = getpid(); /* for use with lprm */ - setpgrp(0, printpid); + setpgid((pid_t)0, printpid); /* * At initial lpd startup, printjob may be called with various From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:03:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29B4F2CC; Thu, 18 Sep 2014 17:03:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1446F762; Thu, 18 Sep 2014 17:03:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IH3qKD047503; Thu, 18 Sep 2014 17:03:52 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IH3qfU047502; Thu, 18 Sep 2014 17:03:52 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409181703.s8IH3qfU047502@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 18 Sep 2014 17:03: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: r271790 - stable/10/usr.sbin/bsdinstall/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:03:53 -0000 Author: allanjude (doc committer) Date: Thu Sep 18 17:03:52 2014 New Revision: 271790 URL: http://svnweb.freebsd.org/changeset/base/271790 Log: MFC r271563: Make the root-on-zfs part of the installer warn a user who booted the installer via UEFI that we do not support booting ZFS via UEFI yet PR: 193595 Approved by: re (gjb), nwhitehorn Sponsored by: ScaleEngine Inc. Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Sep 18 17:01:45 2014 (r271789) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Thu Sep 18 17:03:52 2014 (r271790) @@ -293,6 +293,7 @@ msg_swap_mirror_help="Mirror swap partit msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." @@ -687,6 +688,48 @@ dialog_menu_layout() return $DIALOG_OK } +# dialog_uefi_prompt +# +# Confirm that the user wants to continue with the installation on a BIOS +# system when they have booted with UEFI +# +dialog_uefi_prompt() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt # Calculated below + local hline="$hline_arrows_tab_enter" + + local height=8 width=50 prefix=" " + local plen=${#prefix} list= line= + local max_width=$(( $width - 3 - $plen )) + + local yes no defaultno extra_args format + if [ "$USE_XDIALOG" ]; then + yes=ok no=cancel defaultno=default-no + extra_args="--wrap --left" + format="$msg_uefi_not_supported" + else + yes=yes no=no defaultno=defaultno + extra_args="--cr-wrap" + format="$msg_uefi_not_supported" + fi + + # Add height for Xdialog(1) + [ "$USE_XDIALOG" ] && height=$(( $height + $height / 5 + 3 )) + + prompt=$( printf "$format" ) + f_dprintf "%s: UEFI prompt" "$0" + $DIALOG \ + --title "$title" \ + --backtitle "$btitle" \ + --hline "$hline" \ + --$yes-label "$msg_yes" \ + --$no-label "$msg_no" \ + $extra_args \ + --yesno "$prompt" $height $width +} + # zfs_create_diskpart $disk $index # # For each block device to be used in the zpool, rather than just create the @@ -1383,6 +1426,21 @@ f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSD f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # +# If the system was booted with UEFI, warn the user that FreeBSD can't do +# ZFS with UEFI yet +# +if f_interactive; then + bootmethod=$(sysctl -n machdep.bootmethod) + f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" + if [ "$bootmethod" != "BIOS" ]; then + dialog_uefi_prompt + retval=$? + f_dprintf "uefi_prompt=[%s]" "$retval" + [ $retval -eq $DIALOG_OK ] || f_die + fi +fi + +# # Loop over the main menu until we've accomplished what we came here to do # while :; do From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:04:44 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B291410; Thu, 18 Sep 2014 17:04:44 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D002376F; Thu, 18 Sep 2014 17:04:42 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA23536; Thu, 18 Sep 2014 20:04:34 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XUf8E-000Dy5-0b; Thu, 18 Sep 2014 20:04:34 +0300 Message-ID: <541B1069.1030704@FreeBSD.org> Date: Thu, 18 Sep 2014 20:03:37 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Will Andrews , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201409181655.s8IGtgft042984@svn.freebsd.org> In-Reply-To: <201409181655.s8IGtgft042984@svn.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:04:44 -0000 On 18/09/2014 19:55, Will Andrews wrote: > Author: will > Date: Thu Sep 18 16:55:41 2014 > New Revision: 271788 > URL: http://svnweb.freebsd.org/changeset/base/271788 > > Log: > Enable ZFS debug flags to be modified via vfs.zfs.debug_flags. > > This is primarily only of interest to ZFS developers, but it makes it > easier to get additional debugging. > > Submitted by: gibbs > MFC after: 1 month > Sponsored by: Spectra Logic > MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs) zfs_flags was already accessible via debug.zfs_flags sysctl and tunable. That should probably be removed now? > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:53:44 2014 (r271787) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:55:41 2014 (r271788) > @@ -259,6 +259,33 @@ SYSCTL_DECL(_vfs_zfs); > SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, > "Try to recover from otherwise-fatal errors."); > > +static int > +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) > +{ > + int err, val; > + > + val = zfs_flags; > + err = sysctl_handle_int(oidp, &val, 0, req); > + if (err != 0 || req->newptr == NULL) > + return (err); > + > + /* > + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all > + * arc buffers in the system have the necessary additional > + * checksum data. However, it is safe to disable at any > + * time. > + */ > + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) > + val &= ~ZFS_DEBUG_MODIFY; > + zfs_flags = val; > + > + return (0); > +} > +TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); > +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, > + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), > + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); > + > /* > * If destroy encounters an EIO while reading metadata (e.g. indirect > * blocks), space referenced by the missing metadata can not be freed. > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:05:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E2646CB for ; Thu, 18 Sep 2014 17:05:56 +0000 (UTC) Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D05E79A for ; Thu, 18 Sep 2014 17:05:55 +0000 (UTC) Received: by mail-qg0-f43.google.com with SMTP id a108so1485083qge.30 for ; Thu, 18 Sep 2014 10:05:49 -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:date :message-id:subject:from:to:cc:content-type; bh=4RjKTjIz/WFgqfllyFvR272HXSYFx2sVFBYlqgzqqy4=; b=EHVGnd3KcFfvvyEDOhRcw2gXnYlewitf6s6q5A3wACQ9SYLmVbQlCNWRkwYZxyZ2M4 aeJj+wgIDhtXyt/RdmCMVa7Agfxz6m6EuufuK5RlZYFBkCsWG6ShC/coKVLogI3dk6/Q YLwKHAl5nivItUNF3SnSsOPZ8ssglsc6KHsKYqGCIJKbrnz53VijJKeWtKdlG1XtJFEu E0XCmNUOQcMbSgoW26mq+xDUIbV+rSzaNQQ6I1tFTcfmv6oEm6p8gRnssQduFxubG/Qp eJL98vmLRE8aZ4PwiVin1LRrwzcQYvBS/Rpc/JT04HGJw7lGZ1R8XWdXUbsW7N5eQxk2 Wuxg== X-Gm-Message-State: ALoCoQlGFcG7vLy4BHXcyuV1UcPV10WmqKoUtQ8Co/BKq0oVpFrPgvscwgwrMuo2KKEIbRdayNlg MIME-Version: 1.0 X-Received: by 10.224.165.134 with SMTP id i6mr11337250qay.4.1411059949523; Thu, 18 Sep 2014 10:05:49 -0700 (PDT) Received: by 10.140.16.183 with HTTP; Thu, 18 Sep 2014 10:05:49 -0700 (PDT) In-Reply-To: <541B1069.1030704@FreeBSD.org> References: <201409181655.s8IGtgft042984@svn.freebsd.org> <541B1069.1030704@FreeBSD.org> Date: Thu, 18 Sep 2014 11:05:49 -0600 Message-ID: Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Will Andrews To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:05:56 -0000 Which one is more idiomatic? Sorry, I never noticed that one. Thanks, --Will. On Thu, Sep 18, 2014 at 11:03 AM, Andriy Gapon wrote: > On 18/09/2014 19:55, Will Andrews wrote: >> Author: will >> Date: Thu Sep 18 16:55:41 2014 >> New Revision: 271788 >> URL: http://svnweb.freebsd.org/changeset/base/271788 >> >> Log: >> Enable ZFS debug flags to be modified via vfs.zfs.debug_flags. >> >> This is primarily only of interest to ZFS developers, but it makes it >> easier to get additional debugging. >> >> Submitted by: gibbs >> MFC after: 1 month >> Sponsored by: Spectra Logic >> MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs) > > zfs_flags was already accessible via debug.zfs_flags sysctl and tunable. > That should probably be removed now? > >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:53:44 2014 (r271787) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:55:41 2014 (r271788) >> @@ -259,6 +259,33 @@ SYSCTL_DECL(_vfs_zfs); >> SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, >> "Try to recover from otherwise-fatal errors."); >> >> +static int >> +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) >> +{ >> + int err, val; >> + >> + val = zfs_flags; >> + err = sysctl_handle_int(oidp, &val, 0, req); >> + if (err != 0 || req->newptr == NULL) >> + return (err); >> + >> + /* >> + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all >> + * arc buffers in the system have the necessary additional >> + * checksum data. However, it is safe to disable at any >> + * time. >> + */ >> + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) >> + val &= ~ZFS_DEBUG_MODIFY; >> + zfs_flags = val; >> + >> + return (0); >> +} >> +TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); >> +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, >> + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), >> + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); >> + >> /* >> * If destroy encounters an EIO while reading metadata (e.g. indirect >> * blocks), space referenced by the missing metadata can not be freed. >> > > > -- > Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:15:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1632B90A; Thu, 18 Sep 2014 17:15:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00E0C88A; Thu, 18 Sep 2014 17:15:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHFdEx052571; Thu, 18 Sep 2014 17:15:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHFc09052565; Thu, 18 Sep 2014 17:15:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409181715.s8IHFc09052565@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 18 Sep 2014 17:15: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: r271791 - stable/10/release/arm 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:15:40 -0000 Author: gjb Date: Thu Sep 18 17:15:38 2014 New Revision: 271791 URL: http://svnweb.freebsd.org/changeset/base/271791 Log: MFC r271676, r271677, r271678: r271676: Catch up with Crochet changes to fix the BEAGLEBONE build. r271677: Catch up with Crochet changes to fix the WANDBOARD-QUAD build. r271678: Set a static revision of the Crochet checkout to avoid surprise build failures. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf stable/10/release/arm/WANDBOARD-QUAD.conf stable/10/release/arm/ZEDBOARD.conf stable/10/release/arm/release.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/10/release/arm/BEAGLEBONE.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/BEAGLEBONE.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,6 +25,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="BEAGLEBONE" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/PANDABOARD.conf ============================================================================== --- stable/10/release/arm/PANDABOARD.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/PANDABOARD.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,6 +25,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="PANDABOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/RPI-B.conf ============================================================================== --- stable/10/release/arm/RPI-B.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/RPI-B.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,7 +25,7 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="RPI-B" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" UBOOTSRC="https://github.com/gonzoua/u-boot-pi" UBOOTBRANCH="trunk" UBOOTDIR="/tmp/crochet/u-boot-rpi" Modified: stable/10/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- stable/10/release/arm/WANDBOARD-QUAD.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/WANDBOARD-QUAD.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -25,6 +25,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="WANDBOARD-QUAD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/ZEDBOARD.conf ============================================================================== --- stable/10/release/arm/ZEDBOARD.conf Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/ZEDBOARD.conf Thu Sep 18 17:15:38 2014 (r271791) @@ -24,6 +24,6 @@ XDEV_ARCH="armv6" XDEV_FLAGS="WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1" KERNEL="ZEDBOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" +CROCHETBRANCH="trunk@r744" set +a Modified: stable/10/release/arm/release.sh ============================================================================== --- stable/10/release/arm/release.sh Thu Sep 18 17:03:52 2014 (r271790) +++ stable/10/release/arm/release.sh Thu Sep 18 17:15:38 2014 (r271791) @@ -44,8 +44,8 @@ before_build() { case ${KERNEL} in BEAGLEBONE) WANT_UBOOT=1 - KNOWNHASH="4150e5a4480707c55a8d5b4570262e43af68d8ed3bdc0a433d8e7df47989a69e" - UBOOT_VERSION="u-boot-2013.04" + KNOWNHASH="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31" + UBOOT_VERSION="u-boot-2014.04" ;; PANDABOARD) WANT_UBOOT=1 @@ -54,8 +54,8 @@ before_build() { ;; WANDBOARD-QUAD) WANT_UBOOT=1 - KNOWNHASH="0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55" - UBOOT_VERSION="u-boot-2013.10" + KNOWNHASH="b4f83b8db325c21671a997198ec3a373e2e00dde2fcf17be9b9afd7cfd727f56" + UBOOT_VERSION="u-boot-2014.07" ;; *) # Fallthrough. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:18:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5835BA7C; Thu, 18 Sep 2014 17:18:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 447FB8AF; Thu, 18 Sep 2014 17:18:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHIhOx052970; Thu, 18 Sep 2014 17:18:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHIhNL052969; Thu, 18 Sep 2014 17:18:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409181718.s8IHIhNL052969@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 18 Sep 2014 17:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271792 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:18:43 -0000 Author: pfg Date: Thu Sep 18 17:18:42 2014 New Revision: 271792 URL: http://svnweb.freebsd.org/changeset/base/271792 Log: unistd: move setpgrp(2) to the __BSD_VISIBLE section Our setpgrp(2) differs from the specified by POSIX, which only has one argument, and is only meant for compatibility with BSD. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/setpgrp.html Pointed-out in: openbsd-tech (2014-09-16) MFC after: 6 weeks Modified: head/include/unistd.h Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Thu Sep 18 17:15:38 2014 (r271791) +++ head/include/unistd.h Thu Sep 18 17:18:42 2014 (r271792) @@ -453,7 +453,6 @@ int encrypt(char *, int); long gethostid(void); int lockf(int, int, off_t); int nice(int); -int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ int setregid(gid_t, gid_t); int setreuid(uid_t, uid_t); @@ -567,6 +566,7 @@ int setkey(const char *); int setlogin(const char *); int setloginclass(const char *); void *setmode(const char *); +int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ void setproctitle(const char *_fmt, ...) __printf0like(1, 2); int setresgid(gid_t, gid_t, gid_t); int setresuid(uid_t, uid_t, uid_t); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:22:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D976D73; Thu, 18 Sep 2014 17:22:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E42196D; Thu, 18 Sep 2014 17:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHMhoU056973; Thu, 18 Sep 2014 17:22:43 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHMgj2056971; Thu, 18 Sep 2014 17:22:42 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181722.s8IHMgj2056971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 17:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271793 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:22:43 -0000 Author: will Date: Thu Sep 18 17:22:42 2014 New Revision: 271793 URL: http://svnweb.freebsd.org/changeset/base/271793 Log: Silence noisy firewire logging. MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 974594 on 2013/08/02 Modified: head/sys/dev/firewire/firewire.c head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Thu Sep 18 17:18:42 2014 (r271792) +++ head/sys/dev/firewire/firewire.c Thu Sep 18 17:22:42 2014 (r271793) @@ -1560,8 +1560,6 @@ fw_explore_node(struct fw_device *dfwdev /* First quad */ err = fw_explore_read_quads(dfwdev, CSRROMOFF, &csr[0], 1); if (err) { - device_printf(fc->bdev, "%s: node%d: explore_read_quads failure\n", - __func__, node); dfwdev->status = FWDEVINVAL; return (-1); } @@ -1577,15 +1575,11 @@ fw_explore_node(struct fw_device *dfwdev /* bus info */ err = fw_explore_read_quads(dfwdev, CSRROMOFF + 0x04, &csr[1], 4); if (err) { - device_printf(fc->bdev, "%s: node%d: error reading 0x04\n", - __func__, node); dfwdev->status = FWDEVINVAL; return (-1); } binfo = (struct bus_info *)&csr[1]; if (binfo->bus_name != CSR_BUS_NAME_IEEE1394) { - device_printf(fc->bdev, "%s: node%d: invalid bus name 0x%08x\n", - __func__, node, binfo->bus_name); dfwdev->status = FWDEVINVAL; return (-1); } @@ -1668,10 +1662,6 @@ fw_explore_node(struct fw_device *dfwdev STAILQ_INSERT_HEAD(&fc->devices, fwdev, link); else STAILQ_INSERT_AFTER(&fc->devices, pfwdev, fwdev, link); - - device_printf(fc->bdev, "New %s device ID:%08x%08x\n", - linkspeed[fwdev->speed], - fwdev->eui.hi, fwdev->eui.lo); } else { fwdev->dst = node; fwdev->status = FWDEVINIT; @@ -1828,9 +1818,6 @@ fw_attach_dev(struct firewire_comm *fc) * Remove devices which have not been seen * for a while. */ - device_printf(fc->bdev, "%s:" - "Removing missing device ID:%08x%08x\n", - __func__, fwdev->eui.hi, fwdev->eui.lo); STAILQ_REMOVE(&fc->devices, fwdev, fw_device, link); free(fwdev, M_FW); Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Thu Sep 18 17:18:42 2014 (r271792) +++ head/sys/dev/firewire/fwohci.c Thu Sep 18 17:22:42 2014 (r271793) @@ -1126,12 +1126,10 @@ fwohci_txd(struct fwohci_softc *sc, stru case FWOHCIEV_ACKBSA: case FWOHCIEV_ACKBSB: case FWOHCIEV_ACKBSX: - device_printf(sc->fc.dev, "txd err=%2x %s\n", stat, fwohcicode[stat]); err = EBUSY; break; case FWOHCIEV_FLUSHED: case FWOHCIEV_ACKTARD: - device_printf(sc->fc.dev, "txd err=%2x %s\n", stat, fwohcicode[stat]); err = EAGAIN; break; case FWOHCIEV_MISSACK: @@ -1145,8 +1143,6 @@ fwohci_txd(struct fwohci_softc *sc, stru case FWOHCIEV_ACKDERR: case FWOHCIEV_ACKTERR: default: - device_printf(sc->fc.dev, "txd err=%2x %s\n", - stat, fwohcicode[stat]); err = EINVAL; break; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:22:46 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFA29E93; Thu, 18 Sep 2014 17:22:46 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 769C996E; Thu, 18 Sep 2014 17:22:45 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA23731; Thu, 18 Sep 2014 20:22:43 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XUfPn-000Dze-Kp; Thu, 18 Sep 2014 20:22:43 +0300 Message-ID: <541B14AB.3060004@FreeBSD.org> Date: Thu, 18 Sep 2014 20:21:47 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Will Andrews Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201409181655.s8IGtgft042984@svn.freebsd.org> <541B1069.1030704@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "src-committers@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:22:46 -0000 On 18/09/2014 20:05, Will Andrews wrote: > Which one is more idiomatic? Sorry, I never noticed that one. I prefer your commit. > > On Thu, Sep 18, 2014 at 11:03 AM, Andriy Gapon wrote: >> On 18/09/2014 19:55, Will Andrews wrote: >>> Author: will >>> Date: Thu Sep 18 16:55:41 2014 >>> New Revision: 271788 >>> URL: http://svnweb.freebsd.org/changeset/base/271788 >>> >>> Log: >>> Enable ZFS debug flags to be modified via vfs.zfs.debug_flags. >>> >>> This is primarily only of interest to ZFS developers, but it makes it >>> easier to get additional debugging. >>> >>> Submitted by: gibbs >>> MFC after: 1 month >>> Sponsored by: Spectra Logic >>> MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs) >> >> zfs_flags was already accessible via debug.zfs_flags sysctl and tunable. >> That should probably be removed now? >> >>> Modified: >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c >>> >>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c >>> ============================================================================== >>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:53:44 2014 (r271787) >>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:55:41 2014 (r271788) >>> @@ -259,6 +259,33 @@ SYSCTL_DECL(_vfs_zfs); >>> SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, >>> "Try to recover from otherwise-fatal errors."); >>> >>> +static int >>> +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) >>> +{ >>> + int err, val; >>> + >>> + val = zfs_flags; >>> + err = sysctl_handle_int(oidp, &val, 0, req); >>> + if (err != 0 || req->newptr == NULL) >>> + return (err); >>> + >>> + /* >>> + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all >>> + * arc buffers in the system have the necessary additional >>> + * checksum data. However, it is safe to disable at any >>> + * time. >>> + */ >>> + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) >>> + val &= ~ZFS_DEBUG_MODIFY; >>> + zfs_flags = val; >>> + >>> + return (0); >>> +} >>> +TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); >>> +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, >>> + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), >>> + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); >>> + >>> /* >>> * If destroy encounters an EIO while reading metadata (e.g. indirect >>> * blocks), space referenced by the missing metadata can not be freed. >>> >> >> >> -- >> Andriy Gapon -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:25:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A533FD0; Thu, 18 Sep 2014 17:25:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90B61998; Thu, 18 Sep 2014 17:25:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHPKl1057352; Thu, 18 Sep 2014 17:25:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHPKjW057351; Thu, 18 Sep 2014 17:25:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409181725.s8IHPKjW057351@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 17:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271794 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:25:20 -0000 Author: mav Date: Thu Sep 18 17:25:20 2014 New Revision: 271794 URL: http://svnweb.freebsd.org/changeset/base/271794 Log: When updating device media size use cached cdevsw pointer. Using pointer from the cdev directly is dangerous since we have no reference on it, and it may change any time. That caused panic if device has gone. While there, report capacity change only if it really changed. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Sep 18 17:22:42 2014 (r271793) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Sep 18 17:25:20 2014 (r271794) @@ -2278,7 +2278,9 @@ ctl_be_block_modify_file(struct ctl_be_b if (params->lun_size_bytes != 0) { be_lun->size_bytes = params->lun_size_bytes; } else { + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + VOP_UNLOCK(be_lun->vn, 0); if (error != 0) { snprintf(req->error_str, sizeof(req->error_str), "error calling VOP_GETATTR() for file %s", @@ -2296,24 +2298,22 @@ static int ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) { - struct cdev *dev; - struct cdevsw *devsw; + struct ctl_be_block_devdata *dev_data; int error; struct ctl_lun_modify_params *params; uint64_t size_bytes; params = &req->reqdata.modify; - dev = be_lun->vn->v_rdev; - devsw = dev->si_devsw; - if (!devsw->d_ioctl) { + dev_data = &be_lun->backend.dev; + if (!dev_data->csw->d_ioctl) { snprintf(req->error_str, sizeof(req->error_str), "%s: no d_ioctl for device %s!", __func__, be_lun->dev_path); return (ENODEV); } - error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, + error = dev_data->csw->d_ioctl(dev_data->cdev, DIOCGMEDIASIZE, (caddr_t)&size_bytes, FREAD, curthread); if (error) { @@ -2346,6 +2346,7 @@ ctl_be_block_modify(struct ctl_be_block_ { struct ctl_lun_modify_params *params; struct ctl_be_block_lun *be_lun; + uint64_t oldsize; int error; params = &req->reqdata.modify; @@ -2376,28 +2377,27 @@ ctl_be_block_modify(struct ctl_be_block_ } } - vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); - + oldsize = be_lun->size_bytes; if (be_lun->vn->v_type == VREG) error = ctl_be_block_modify_file(be_lun, req); else error = ctl_be_block_modify_dev(be_lun, req); - - VOP_UNLOCK(be_lun->vn, 0); - if (error != 0) goto bailout_error; - be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; + if (be_lun->size_bytes != oldsize) { + be_lun->size_blocks = be_lun->size_bytes >> + be_lun->blocksize_shift; - /* - * The maximum LBA is the size - 1. - * - * XXX: Note that this field is being updated without locking, - * which might cause problems on 32-bit architectures. - */ - be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; - ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + } /* Tell the user the exact size we ended up using */ params->lun_size_bytes = be_lun->size_bytes; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:28:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DE86258; Thu, 18 Sep 2014 17:28:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DCC09BE; Thu, 18 Sep 2014 17:28:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHSOeM057761; Thu, 18 Sep 2014 17:28:24 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHSLju057744; Thu, 18 Sep 2014 17:28:21 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181728.s8IHSLju057744@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 17:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271795 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:28:24 -0000 Author: will Date: Thu Sep 18 17:28:21 2014 New Revision: 271795 URL: http://svnweb.freebsd.org/changeset/base/271795 Log: Start the process of cleaning up FreeBSD's firewire driver. sys/dev/firewire/firewire.c: sys/dev/firewire/firewire.h: sys/dev/firewire/firewirereg.h: sys/dev/firewire/fwcrom.c: sys/dev/firewire/fwdev.c: sys/dev/firewire/fwdma.c: sys/dev/firewire/fwmem.c: sys/dev/firewire/fwohci.c: sys/dev/firewire/fwohci_pci.c: sys/dev/firewire/fwohcivar.h: sys/dev/firewire/if_fwe.c: sys/dev/firewire/if_fwip.c: sys/dev/firewire/sbp.c: sys/dev/firewire/sbp_targ.c: Unifdef the code, removing support for DragonflyBSD and FreeBSD prior to version 5. Submitted by: gibbs MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 1081188 on 2014/08/01 Modified: head/sys/dev/firewire/firewire.c head/sys/dev/firewire/firewire.h head/sys/dev/firewire/firewirereg.h head/sys/dev/firewire/fwcrom.c head/sys/dev/firewire/fwdev.c head/sys/dev/firewire/fwdma.c head/sys/dev/firewire/fwmem.c head/sys/dev/firewire/fwohci.c head/sys/dev/firewire/fwohci_pci.c head/sys/dev/firewire/fwohcivar.h head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c head/sys/dev/firewire/sbp.c head/sys/dev/firewire/sbp_targ.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/firewire.c Thu Sep 18 17:28:21 2014 (r271795) @@ -49,26 +49,14 @@ __FBSDID("$FreeBSD$"); #include -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -#include /* for DELAY() */ -#endif - #include /* used by smbus and newbus */ #include -#ifdef __DragonFly__ -#include "firewire.h" -#include "firewirereg.h" -#include "fwmem.h" -#include "iec13213.h" -#include "iec68113.h" -#else #include #include #include #include #include -#endif struct crom_src_buf { struct crom_src src; @@ -99,9 +87,6 @@ static int firewire_attach (device_ static int firewire_detach (device_t); static int firewire_resume (device_t); static void firewire_xfer_timeout(void *, int); -#if 0 -static int firewire_shutdown (device_t); -#endif static device_t firewire_add_child(device_t, u_int, const char *, int); static void fw_try_bmr (void *); static void fw_try_bmr_callback (struct fw_xfer *); @@ -563,14 +548,6 @@ firewire_detach(device_t dev) mtx_destroy(&fc->wait_lock); return(0); } -#if 0 -static int -firewire_shutdown( device_t dev ) -{ - return 0; -} -#endif - static void fw_xferq_drain(struct fw_xferq *xferq) @@ -1052,7 +1029,7 @@ fw_tl_free(struct firewire_comm *fc, str mtx_unlock(&fc->tlabel_lock); return; } -#if 1 /* make sure the label is allocated */ + /* make sure the label is allocated */ STAILQ_FOREACH(txfer, &fc->tlabels[xfer->tl], tlabel) if(txfer == xfer) break; @@ -1067,7 +1044,6 @@ fw_tl_free(struct firewire_comm *fc, str splx(s); return; } -#endif STAILQ_REMOVE(&fc->tlabels[xfer->tl], xfer, fw_xfer, tlabel); xfer->tl = -1; Modified: head/sys/dev/firewire/firewire.h ============================================================================== --- head/sys/dev/firewire/firewire.h Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/firewire.h Thu Sep 18 17:28:21 2014 (r271795) @@ -454,11 +454,6 @@ struct fw_crom_buf { #define FWMAXNDMA 0x100 /* 8 bits DMA channel id. in device No. */ -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -#define dev2unit(x) ((minor(x) & 0xff) | (minor(x) >> 8)) -#define unit2minor(x) (((x) & 0xff) | (((x) << 8) & ~0xffff)) -#endif - #define MAKEMINOR(f, u, s) \ ((f) | (((u) & 0xff) << 8) | (s & 0xff)) #define DEV2UNIT(x) ((dev2unit(x) & 0xff00) >> 8) Modified: head/sys/dev/firewire/firewirereg.h ============================================================================== --- head/sys/dev/firewire/firewirereg.h Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/firewirereg.h Thu Sep 18 17:28:21 2014 (r271795) @@ -75,9 +75,7 @@ struct fw_device{ }; struct firewire_softc { -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 struct cdev *dev; -#endif struct firewire_comm *fc; }; @@ -303,36 +301,9 @@ extern int firewire_debug; extern devclass_t firewire_devclass; extern int firewire_phydma_enable; -#ifdef __DragonFly__ -#define FWPRI PCATCH -#else #define FWPRI ((PZERO+8)|PCATCH) -#endif -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -#define CALLOUT_INIT(x) callout_init(x) -#else #define CALLOUT_INIT(x) callout_init(x, 1 /* mpsafe */) -#endif - -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -/* compatibility shim for 4.X */ -#define bio buf -#define bio_bcount b_bcount -#define bio_cmd b_flags -#define bio_count b_count -#define bio_data b_data -#define bio_dev b_dev -#define bio_error b_error -#define bio_flags b_flags -#define bio_offset b_offset -#define bio_resid b_resid -#define BIO_ERROR B_ERROR -#define BIO_READ B_READ -#define BIO_WRITE B_WRITE -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif MALLOC_DECLARE(M_FW); MALLOC_DECLARE(M_FWXFER); Modified: head/sys/dev/firewire/fwcrom.c ============================================================================== --- head/sys/dev/firewire/fwcrom.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/fwcrom.c Thu Sep 18 17:28:21 2014 (r271795) @@ -453,11 +453,7 @@ crom_add_simple_text(struct crom_src *sr len = strlen(buf); if (len > MAX_TEXT) { -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - printf("text(%d) trancated to %d.\n", len, MAX_TEXT); -#else printf("text(%d) trancated to %td.\n", len, MAX_TEXT); -#endif len = MAX_TEXT; } Modified: head/sys/dev/firewire/fwdev.c ============================================================================== --- head/sys/dev/firewire/fwdev.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/fwdev.c Thu Sep 18 17:28:21 2014 (r271795) @@ -39,11 +39,7 @@ #include #include #include -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -#include -#else #include -#endif #include #include @@ -208,7 +204,6 @@ fw_open (struct cdev *dev, int flags, in if (dev->si_drv1 == NULL) return (ENOMEM); -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 if ((dev->si_flags & SI_NAMED) == 0) { int unit = DEV2UNIT(dev); int sub = DEV2SUB(dev); @@ -217,7 +212,6 @@ fw_open (struct cdev *dev, int flags, in UID_ROOT, GID_OPERATOR, 0660, "fw%d.%d", unit, sub); } -#endif d = (struct fw_drv1 *)dev->si_drv1; d->fc = sc->fc; STAILQ_INIT(&d->binds); @@ -881,20 +875,12 @@ fw_poll(struct cdev *dev, int events, fw } static int -#if defined(__DragonFly__) || __FreeBSD_version < 500102 -fw_mmap (struct cdev *dev, vm_offset_t offset, int nproto) -#else fw_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nproto, vm_memattr_t *memattr) -#endif { if (DEV_FWMEM(dev)) -#if defined(__DragonFly__) || __FreeBSD_version < 500102 - return fwmem_mmap(dev, offset, nproto); -#else return fwmem_mmap(dev, offset, paddr, nproto, memattr); -#endif return EINVAL; } @@ -921,9 +907,6 @@ fwdev_makedev(struct firewire_softc *sc) { int err = 0; -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - cdevsw_add(&firewire_cdevsw); -#else struct cdev *d; int unit; @@ -938,7 +921,6 @@ fwdev_makedev(struct firewire_softc *sc) dev_depends(sc->dev, d); make_dev_alias(sc->dev, "fw%d", unit); make_dev_alias(d, "fwmem%d", unit); -#endif return (err); } @@ -948,15 +930,10 @@ fwdev_destroydev(struct firewire_softc * { int err = 0; -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - cdevsw_remove(&firewire_cdevsw); -#else destroy_dev(sc->dev); -#endif return (err); } -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 #define NDEVTYPE 2 void fwdev_clone(void *arg, struct ucred *cred, char *name, int namelen, @@ -998,4 +975,3 @@ found: dev_depends(sc->dev, *dev); return; } -#endif Modified: head/sys/dev/firewire/fwdma.c ============================================================================== --- head/sys/dev/firewire/fwdma.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/fwdma.c Thu Sep 18 17:28:21 2014 (r271795) @@ -43,23 +43,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__FreeBSD__) && __FreeBSD_version >= 501102 #include #include -#endif #include #include -#ifdef __DragonFly__ -#include -#include -#include -#else #include #include #include -#endif static void fwdma_map_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) @@ -90,10 +82,8 @@ fwdma_malloc(struct firewire_comm *fc, i /*nsegments*/ 1, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ BUS_DMA_ALLOCNOW, -#if defined(__FreeBSD__) && __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, /*lockarg*/FW_GMTX(fc), -#endif &dma->dma_tag); if (err) { printf("fwdma_malloc: failed(1)\n"); @@ -188,23 +178,14 @@ fwdma_malloc_multiseg(struct firewire_co /*nsegments*/ 1, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ BUS_DMA_ALLOCNOW, -#if defined(__FreeBSD__) && __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, /*lockarg*/FW_GMTX(fc), -#endif &am->dma_tag)) { printf("fwdma_malloc_multiseg: tag_create failed\n"); free(am, M_FW); return(NULL); } -#if 0 -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - printf("malloc_multi: ssize=%d nseg=%d\n", ssize, nseg); -#else - printf("malloc_multi: ssize=%td nseg=%d\n", ssize, nseg); -#endif -#endif for (seg = &am->seg[0]; nseg --; seg ++) { seg->v_addr = fwdma_malloc_size(am->dma_tag, &seg->dma_map, ssize, &seg->bus_addr, flag); Modified: head/sys/dev/firewire/fwmem.c ============================================================================== --- head/sys/dev/firewire/fwmem.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/fwmem.c Thu Sep 18 17:28:21 2014 (r271795) @@ -46,11 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -#include -#else #include -#endif #include #include @@ -60,15 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef __DragonFly__ -#include "firewire.h" -#include "firewirereg.h" -#include "fwmem.h" -#else #include #include #include -#endif static int fwmem_speed=2, fwmem_debug=0; static struct fw_eui64 fwmem_eui64; @@ -442,12 +432,8 @@ fwmem_poll (struct cdev *dev, int events return EINVAL; } int -#if defined(__DragonFly__) || __FreeBSD_version < 500102 -fwmem_mmap (struct cdev *dev, vm_offset_t offset, int nproto) -#else fwmem_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nproto, vm_memattr_t *memattr) -#endif { return EINVAL; } Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/fwohci.c Thu Sep 18 17:28:21 2014 (r271795) @@ -56,25 +56,12 @@ #include -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -#include /* for DELAY() */ -#endif - -#ifdef __DragonFly__ -#include "firewire.h" -#include "firewirereg.h" -#include "fwdma.h" -#include "fwohcireg.h" -#include "fwohcivar.h" -#include "firewire_phy.h" -#else #include #include #include #include #include #include -#endif #undef OHCI_DEBUG Modified: head/sys/dev/firewire/fwohci_pci.c ============================================================================== --- head/sys/dev/firewire/fwohci_pci.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/fwohci_pci.c Thu Sep 18 17:28:21 2014 (r271795) @@ -46,34 +46,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__FreeBSD__) && __FreeBSD_version >= 501102 #include #include -#endif #include -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -#include /* for DELAY() */ -#endif - -#ifdef __DragonFly__ -#include -#include - -#include "firewire.h" -#include "firewirereg.h" - -#include "fwdma.h" -#include "fwohcireg.h" -#include "fwohcivar.h" -#else -#if __FreeBSD_version < 500000 -#include -#include -#else #include #include -#endif #include #include @@ -81,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#endif static int fwohci_pci_attach(device_t self); static int fwohci_pci_detach(device_t self); @@ -92,7 +69,6 @@ static int fwohci_pci_detach(device_t se static int fwohci_pci_probe( device_t dev ) { -#if 1 uint32_t id; id = pci_get_devid(dev); @@ -213,7 +189,6 @@ fwohci_pci_probe( device_t dev ) device_set_desc(dev, "Sun PCIO-2"); return BUS_PROBE_DEFAULT; } -#endif if (pci_get_class(dev) == PCIC_SERIALBUS && pci_get_subclass(dev) == PCIS_SERIALBUS_FW && pci_get_progif(dev) == PCI_INTERFACE_OHCI) { @@ -227,14 +202,6 @@ fwohci_pci_probe( device_t dev ) return ENXIO; } -#if defined(__DragonFly__) || __FreeBSD_version < 500000 -static void -fwohci_dummy_intr(void *arg) -{ - /* XXX do nothing */ -} -#endif - static int fwohci_pci_init(device_t self) { @@ -286,17 +253,6 @@ fwohci_pci_attach(device_t self) fwohci_softc_t *sc = device_get_softc(self); int err; int rid; -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - int intr; - /* For the moment, put in a message stating what is wrong */ - intr = pci_read_config(self, PCIR_INTLINE, 1); - if (intr == 0 || intr == 255) { - device_printf(self, "Invalid irq %d\n", intr); -#ifdef __i386__ - device_printf(self, "Please switch PNP-OS to 'No' in BIOS\n"); -#endif - } -#endif #if 0 if (bootverbose) @@ -307,12 +263,7 @@ fwohci_pci_attach(device_t self) fwohci_pci_init(self); rid = PCI_CBMEM; -#if __FreeBSD_version >= 502109 sc->bsr = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); -#else - sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); -#endif if (!sc->bsr) { device_printf(self, "Could not map memory\n"); return ENXIO; @@ -322,13 +273,8 @@ fwohci_pci_attach(device_t self) sc->bsh = rman_get_bushandle(sc->bsr); rid = 0; -#if __FreeBSD_version >= 502109 sc->irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); -#else - sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); -#endif if (sc->irq_res == NULL) { device_printf(self, "Could not allocate irq\n"); fwohci_pci_detach(self); @@ -340,14 +286,6 @@ fwohci_pci_attach(device_t self) NULL, (driver_intr_t *) fwohci_intr, sc, &sc->ih); -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - /* XXX splcam() should mask this irq for sbp.c*/ - err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_CAM, - (driver_intr_t *) fwohci_dummy_intr, sc, &sc->ih_cam); - /* XXX splbio() should mask this irq for physio()/fwmem_strategy() */ - err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, - (driver_intr_t *) fwohci_dummy_intr, sc, &sc->ih_bio); -#endif if (err) { device_printf(self, "Could not setup irq, %d\n", err); fwohci_pci_detach(self); @@ -355,11 +293,7 @@ fwohci_pci_attach(device_t self) } err = bus_dma_tag_create( -#if defined(__FreeBSD__) && __FreeBSD_version >= 700020 /*parent*/bus_get_dma_tag(self), -#else - /*parent*/NULL, -#endif /*alignment*/1, /*boundary*/0, #if BOUNCE_BUFFER_TEST @@ -373,10 +307,8 @@ fwohci_pci_attach(device_t self) /*nsegments*/0x20, /*maxsegsz*/0x8000, /*flags*/BUS_DMA_ALLOCNOW, -#if defined(__FreeBSD__) && __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, /*lockarg*/FW_GMTX(&sc->fc), -#endif &sc->fc.dmat); if (err != 0) { printf("fwohci_pci_attach: Could not allocate DMA tag " @@ -429,10 +361,6 @@ fwohci_pci_detach(device_t self) if (err) device_printf(self, "Could not tear down irq, %d\n", err); -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - bus_teardown_intr(self, sc->irq_res, sc->ih_cam); - bus_teardown_intr(self, sc->irq_res, sc->ih_bio); -#endif sc->ih = NULL; } bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res); Modified: head/sys/dev/firewire/fwohcivar.h ============================================================================== --- head/sys/dev/firewire/fwohcivar.h Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/fwohcivar.h Thu Sep 18 17:28:21 2014 (r271795) @@ -42,10 +42,6 @@ typedef struct fwohci_softc { bus_space_tag_t bst; bus_space_handle_t bsh; void *ih; -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - void *ih_cam; - void *ih_bio; -#endif struct resource *bsr; struct resource *irq_res; struct fwohci_dbch{ Modified: head/sys/dev/firewire/if_fwe.c ============================================================================== --- head/sys/dev/firewire/if_fwe.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/if_fwe.c Thu Sep 18 17:28:21 2014 (r271795) @@ -57,18 +57,11 @@ #include #include #include -#ifdef __DragonFly__ -#include -#include -#include -#include "if_fwevar.h" -#else #include #include #include #include -#endif #define FWEDEBUG if (fwedebug) if_printf #define TX_MAX_QUEUE (FWMAXQUEUE - 1) @@ -144,11 +137,7 @@ fwe_attach(device_t dev) struct fwe_softc *fwe; struct ifnet *ifp; int unit, s; -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - u_char *eaddr; -#else u_char eaddr[6]; -#endif struct fw_eui64 *eui; fwe = ((struct fwe_softc *)device_get_softc(dev)); @@ -175,10 +164,6 @@ fwe_attach(device_t dev) /* generate fake MAC address: first and last 3bytes from eui64 */ #define LOCAL (0x02) #define GROUP (0x01) -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - eaddr = &IFP2ENADDR(fwe->eth_softc.ifp)[0]; -#endif - eui = &fwe->fd.fc->eui; eaddr[0] = (FW_EUI64_BYTE(eui, 0) | LOCAL) & ~GROUP; @@ -199,36 +184,21 @@ fwe_attach(device_t dev) } ifp->if_softc = &fwe->eth_softc; -#if __FreeBSD_version >= 501113 || defined(__DragonFly__) if_initname(ifp, device_get_name(dev), unit); -#else - ifp->if_unit = unit; - ifp->if_name = "fwe"; -#endif ifp->if_init = fwe_init; -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - ifp->if_output = ether_output; -#endif ifp->if_start = fwe_start; ifp->if_ioctl = fwe_ioctl; ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST); ifp->if_snd.ifq_maxlen = TX_MAX_QUEUE; s = splimp(); -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - ether_ifattach(ifp, 1); -#else ether_ifattach(ifp, eaddr); -#endif splx(s); /* Tell the upper layer(s) we support long frames. */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_POLLING; ifp->if_capenable |= IFCAP_VLAN_MTU; -#endif - FWEDEBUG(ifp, "interface created\n"); return 0; @@ -270,11 +240,7 @@ fwe_stop(struct fwe_softc *fwe) fwe->dma_ch = -1; } -#if defined(__FreeBSD__) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); -#else - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); -#endif } static int @@ -294,12 +260,8 @@ fwe_detach(device_t dev) s = splimp(); fwe_stop(fwe); -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - ether_ifdetach(ifp, 1); -#else ether_ifdetach(ifp); if_free(ifp); -#endif splx(s); mtx_destroy(&fwe->mtx); @@ -379,13 +341,8 @@ fwe_init(void *arg) if ((xferq->flag & FWXFERQ_RUNNING) == 0) fc->irx_enable(fc, fwe->dma_ch); -#if defined(__FreeBSD__) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; -#else - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; -#endif #if 0 /* attempt to start output */ @@ -405,18 +362,10 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, case SIOCSIFFLAGS: s = splimp(); if (ifp->if_flags & IFF_UP) { -#if defined(__FreeBSD__) if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) -#else - if (!(ifp->if_flags & IFF_RUNNING)) -#endif fwe_init(&fwe->eth_softc); } else { -#if defined(__FreeBSD__) if (ifp->if_drv_flags & IFF_DRV_RUNNING) -#else - if (ifp->if_flags & IFF_RUNNING) -#endif fwe_stop(fwe); } /* XXX keep promiscoud mode */ @@ -463,21 +412,11 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, } #endif /* DEVICE_POLLING */ break; -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 default: -#else - case SIOCSIFADDR: - case SIOCGIFADDR: - case SIOCSIFMTU: -#endif s = splimp(); error = ether_ioctl(ifp, cmd, data); splx(s); return (error); -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - default: - return (EINVAL); -#endif } return (0); @@ -537,20 +476,12 @@ fwe_start(struct ifnet *ifp) } s = splimp(); -#if defined(__FreeBSD__) ifp->if_drv_flags |= IFF_DRV_OACTIVE; -#else - ifp->if_flags |= IFF_OACTIVE; -#endif if (ifp->if_snd.ifq_len != 0) fwe_as_output(fwe, ifp); -#if defined(__FreeBSD__) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; -#else - ifp->if_flags &= ~IFF_OACTIVE; -#endif splx(s); } @@ -591,12 +522,7 @@ fwe_as_output(struct fwe_softc *fwe, str FWE_UNLOCK(fwe); break; } -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - if (ifp->if_bpf != NULL) - bpf_mtap(ifp, m); -#else BPF_MTAP(ifp, m); -#endif /* keep ip packet alignment for alpha */ M_PREPEND(m, ETHER_ALIGN, M_NOWAIT); @@ -634,9 +560,6 @@ fwe_as_input(struct fw_xferq *xferq) struct fw_bulkxfer *sxfer; struct fw_pkt *fp; u_char *c; -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - struct ether_header *eh; -#endif fwe = (struct fwe_softc *)xferq->sc; ifp = fwe->eth_softc.ifp; @@ -666,14 +589,7 @@ fwe_as_input(struct fw_xferq *xferq) m->m_data += HDR_LEN + ETHER_ALIGN; c = mtod(m, u_char *); -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - eh = (struct ether_header *)c; - m->m_data += sizeof(struct ether_header); - m->m_len = m->m_pkthdr.len = fp->mode.stream.len - ETHER_ALIGN - - sizeof(struct ether_header); -#else m->m_len = m->m_pkthdr.len = fp->mode.stream.len - ETHER_ALIGN; -#endif m->m_pkthdr.rcvif = ifp; #if 0 FWEDEBUG(ifp, "%02x %02x %02x %02x %02x %02x\n" @@ -690,11 +606,7 @@ fwe_as_input(struct fw_xferq *xferq) c[20], c[21], c[22], c[23] ); #endif -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - ether_input(ifp, eh, m); -#else (*ifp->if_input)(ifp, m); -#endif ifp->if_ipackets ++; } if (STAILQ_FIRST(&xferq->stfree) != NULL) @@ -720,9 +632,6 @@ static driver_t fwe_driver = { }; -#ifdef __DragonFly__ -DECLARE_DUMMY_MODULE(fwe); -#endif DRIVER_MODULE(fwe, firewire, fwe_driver, fwe_devclass, 0, 0); MODULE_VERSION(fwe, 1); MODULE_DEPEND(fwe, firewire, 1, 1, 1); Modified: head/sys/dev/firewire/if_fwip.c ============================================================================== --- head/sys/dev/firewire/if_fwip.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/if_fwip.c Thu Sep 18 17:28:21 2014 (r271795) @@ -189,12 +189,7 @@ fwip_attach(device_t dev) /* fill the rest and attach interface */ ifp->if_softc = &fwip->fw_softc; -#if __FreeBSD_version >= 501113 || defined(__DragonFly__) if_initname(ifp, device_get_name(dev), unit); -#else - ifp->if_unit = unit; - ifp->if_name = "fwip"; -#endif ifp->if_init = fwip_init; ifp->if_start = fwip_start; ifp->if_ioctl = fwip_ioctl; @@ -255,11 +250,7 @@ fwip_stop(struct fwip_softc *fwip) fwip->dma_ch = -1; } -#if defined(__FreeBSD__) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); -#else - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); -#endif } static int @@ -380,13 +371,8 @@ fwip_init(void *arg) if ((xferq->flag & FWXFERQ_RUNNING) == 0) fc->irx_enable(fc, fwip->dma_ch); -#if defined(__FreeBSD__) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; -#else - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; -#endif #if 0 /* attempt to start output */ @@ -404,18 +390,10 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd case SIOCSIFFLAGS: s = splimp(); if (ifp->if_flags & IFF_UP) { -#if defined(__FreeBSD__) if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) -#else - if (!(ifp->if_flags & IFF_RUNNING)) -#endif fwip_init(&fwip->fw_softc); } else { -#if defined(__FreeBSD__) if (ifp->if_drv_flags & IFF_DRV_RUNNING) -#else - if (ifp->if_flags & IFF_RUNNING) -#endif fwip_stop(fwip); } splx(s); @@ -453,21 +431,11 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd } #endif /* DEVICE_POLLING */ break; -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 default: -#else - case SIOCSIFADDR: - case SIOCGIFADDR: - case SIOCSIFMTU: -#endif s = splimp(); error = firewire_ioctl(ifp, cmd, data); splx(s); return (error); -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - default: - return (EINVAL); -#endif } return (0); @@ -559,20 +527,12 @@ fwip_start(struct ifnet *ifp) } s = splimp(); -#if defined(__FreeBSD__) ifp->if_drv_flags |= IFF_DRV_OACTIVE; -#else - ifp->if_flags |= IFF_OACTIVE; -#endif if (ifp->if_snd.ifq_len != 0) fwip_async_output(fwip, ifp); -#if defined(__FreeBSD__) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; -#else - ifp->if_flags &= ~IFF_OACTIVE; -#endif splx(s); } Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Thu Sep 18 17:25:20 2014 (r271794) +++ head/sys/dev/firewire/sbp.c Thu Sep 18 17:28:21 2014 (r271795) @@ -43,30 +43,9 @@ #include #include #include -#if defined(__FreeBSD__) && __FreeBSD_version >= 501102 #include #include -#endif - -#if defined(__DragonFly__) || __FreeBSD_version < 500106 -#include /* for struct devstat */ -#endif -#ifdef __DragonFly__ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include "sbp.h" -#else #include #include #include @@ -80,7 +59,6 @@ #include #include #include -#endif #define ccb_sdev_ptr spriv_ptr0 #define ccb_sbp_ptr spriv_ptr1 @@ -1677,11 +1655,7 @@ END_DEBUG ocb = sbp_dequeue_ocb(sdev, sbp_status); if (ocb == NULL) { device_printf(sdev->target->sbp->fd.dev, -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - "%s:%s No ocb(%lx) on the queue\n", -#else "%s:%s No ocb(%x) on the queue\n", -#endif __func__,sdev->bustgtlun, ntohl(sbp_status->orb_lo)); } @@ -1708,11 +1682,7 @@ END_DEBUG SBP_DEBUG(0) device_printf(sdev->target->sbp->fd.dev, "%s:%s ORB status src:%x resp:%x dead:%x" -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - " len:%x stat:%x orb:%x%08lx\n", -#else " len:%x stat:%x orb:%x%08x\n", -#endif __func__, sdev->bustgtlun, sbp_status->src, sbp_status->resp, sbp_status->dead, sbp_status->len, sbp_status->status, @@ -1949,10 +1919,8 @@ END_DEBUG /*maxsize*/0x100000, /*nsegments*/SBP_IND_MAX, /*maxsegsz*/SBP_SEG_MAX, /*flags*/BUS_DMA_ALLOCNOW, -#if defined(__FreeBSD__) && __FreeBSD_version >= 501102 /*lockfunc*/busdma_lock_mutex, /*lockarg*/&sbp->mtx, -#endif &sbp->dmat); if (error != 0) { printf("sbp_attach: Could not allocate DMA tag " @@ -2463,11 +2431,6 @@ printf("ORB %08x %08x %08x %08x\n", ntoh case XPT_CALC_GEOMETRY: { struct ccb_calc_geometry *ccg; -#if defined(__DragonFly__) || __FreeBSD_version < 501100 - uint32_t size_mb; - uint32_t secs_per_cylinder; - int extended = 1; -#endif ccg = &ccb->ccg; if (ccg->block_size == 0) { @@ -2478,37 +2441,14 @@ printf("ORB %08x %08x %08x %08x\n", ntoh } SBP_DEBUG(1) printf("%s:%d:%d:%jx:XPT_CALC_GEOMETRY: " -#if defined(__DragonFly__) || __FreeBSD_version < 500000 - "Volume size = %d\n", -#else "Volume size = %jd\n", -#endif device_get_nameunit(sbp->fd.dev), cam_sim_path(sbp->sim), ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun, -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 - (uintmax_t) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:37:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 504965A5; Thu, 18 Sep 2014 17:37:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C017A9A; Thu, 18 Sep 2014 17:37:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHbKsQ062251; Thu, 18 Sep 2014 17:37:20 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHbKR5062250; Thu, 18 Sep 2014 17:37:20 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181737.s8IHbKR5062250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 17:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271796 - head/tools/regression/pjdfstest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:37:20 -0000 Author: will Date: Thu Sep 18 17:37:19 2014 New Revision: 271796 URL: http://svnweb.freebsd.org/changeset/base/271796 Log: Use 'cc' for the C compiler instead of 'gcc'. MFC after: 1 week Sponsored by: Spectra Logic MFSpectraBSD: 1079507 on 2014/07/24 Modified: head/tools/regression/pjdfstest/Makefile Modified: head/tools/regression/pjdfstest/Makefile ============================================================================== --- head/tools/regression/pjdfstest/Makefile Thu Sep 18 17:28:21 2014 (r271795) +++ head/tools/regression/pjdfstest/Makefile Thu Sep 18 17:37:19 2014 (r271796) @@ -18,7 +18,7 @@ ${PROG}: ${PROG}.c echo "Unsupported operating system: ${OSTYPE}."; \ exit 1; \ fi; \ - cmd="gcc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ + cmd="cc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ echo $$cmd; \ $$cmd From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:37:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 919B46E3; Thu, 18 Sep 2014 17:37:34 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 54593A9E; Thu, 18 Sep 2014 17:37:33 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id E362120E7088D; Thu, 18 Sep 2014 17:37:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 4148620E70886; Thu, 18 Sep 2014 17:37:29 +0000 (UTC) Message-ID: <5783417ED470465B9C816FCA02B3690D@multiplay.co.uk> From: "Steven Hartland" To: "Will Andrews" , , , References: <201409181655.s8IGtgft042984@svn.freebsd.org> Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Thu, 18 Sep 2014 18:37:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:37:34 -0000 You don't need a seperate TUNABLE_INT declations any more since the excellent SYSCTL refactor. Regards Steve ----- Original Message ----- From: "Will Andrews" To: ; ; Sent: Thursday, September 18, 2014 5:55 PM Subject: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs > Author: will > Date: Thu Sep 18 16:55:41 2014 > New Revision: 271788 > URL: http://svnweb.freebsd.org/changeset/base/271788 > > Log: > Enable ZFS debug flags to be modified via vfs.zfs.debug_flags. > > This is primarily only of interest to ZFS developers, but it makes it > easier to get additional debugging. > > Submitted by: gibbs > MFC after: 1 month > Sponsored by: Spectra Logic > MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs) > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:53:44 2014 (r271787) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:55:41 2014 (r271788) > @@ -259,6 +259,33 @@ SYSCTL_DECL(_vfs_zfs); > SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, > "Try to recover from otherwise-fatal errors."); > > +static int > +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) > +{ > + int err, val; > + > + val = zfs_flags; > + err = sysctl_handle_int(oidp, &val, 0, req); > + if (err != 0 || req->newptr == NULL) > + return (err); > + > + /* > + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all > + * arc buffers in the system have the necessary additional > + * checksum data. However, it is safe to disable at any > + * time. > + */ > + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) > + val &= ~ZFS_DEBUG_MODIFY; > + zfs_flags = val; > + > + return (0); > +} > +TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); > +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, > + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), > + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); > + > /* > * If destroy encounters an EIO while reading metadata (e.g. indirect > * blocks), space referenced by the missing metadata can not be freed. > > From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:39:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3C9A93C; Thu, 18 Sep 2014 17:39:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F8ABABA; Thu, 18 Sep 2014 17:39:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IHd4CM062654; Thu, 18 Sep 2014 17:39:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IHd44p062653; Thu, 18 Sep 2014 17:39:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409181739.s8IHd44p062653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 17:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271797 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 17:39:04 -0000 Author: mav Date: Thu Sep 18 17:39:04 2014 New Revision: 271797 URL: http://svnweb.freebsd.org/changeset/base/271797 Log: Make kernel to update LUN size from the backing storage on configuration reload also if that size was not specified in the new configuration. Previously it happened only if size was explicitly changed in config. MFC after: 3 days Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Thu Sep 18 17:37:19 2014 (r271796) +++ head/usr.sbin/ctld/ctld.c Thu Sep 18 17:39:04 2014 (r271797) @@ -1413,7 +1413,8 @@ conf_apply(struct conf *oldconf, struct if (oldtarg != NULL) { oldlun = lun_find(oldtarg, newlun->l_lun); if (oldlun != NULL) { - if (newlun->l_size != oldlun->l_size) { + if (newlun->l_size != oldlun->l_size || + newlun->l_size == 0) { log_debugx("resizing lun %d, " "target %s, CTL lun %d", newlun->l_lun, From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 18:46:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A39CC8EC; Thu, 18 Sep 2014 18:46:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E526216; Thu, 18 Sep 2014 18:46:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IIkcMR094899; Thu, 18 Sep 2014 18:46:38 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IIkcHo094897; Thu, 18 Sep 2014 18:46:38 GMT (envelope-from will@FreeBSD.org) Message-Id: <201409181846.s8IIkcHo094897@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 18 Sep 2014 18:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271798 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 18:46:38 -0000 Author: will Date: Thu Sep 18 18:46:38 2014 New Revision: 271798 URL: http://svnweb.freebsd.org/changeset/base/271798 Log: Remove debug.zfs_flags in favor of the new vfs.zfs.debug_flags. Replace TUNABLE_INT with CTLFLAG_RWTUN. Submitted by: avg (debug.zfs_flags removal), smh (TUNABLE_INT replacement) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 17:39:04 2014 (r271797) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 18:46:38 2014 (r271798) @@ -243,9 +243,6 @@ int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZF #else int zfs_flags = 0; #endif -SYSCTL_DECL(_debug); -SYSCTL_INT(_debug, OID_AUTO, zfs_flags, CTLFLAG_RWTUN, &zfs_flags, 0, - "ZFS debug flags."); /* * zfs_recover can be set to nonzero to attempt to recover from @@ -281,9 +278,8 @@ sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLE return (0); } -TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, - CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int), sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 19:11:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADD7AA0; Thu, 18 Sep 2014 19:11:23 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F785754; Thu, 18 Sep 2014 19:11:22 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8IJBJHs002505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Sep 2014 23:11:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8IJBJF9002504; Thu, 18 Sep 2014 23:11:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 18 Sep 2014 23:11:19 +0400 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271782 - in head/sys/dev: bge bxe e1000 fxp nfe Message-ID: <20140918191119.GA884@FreeBSD.org> References: <201409181556.s8IFuEK1013392@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409181556.s8IFuEK1013392@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 19:11:23 -0000 On Thu, Sep 18, 2014 at 03:56:14PM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Thu Sep 18 15:56:14 2014 T> New Revision: 271782 T> URL: http://svnweb.freebsd.org/changeset/base/271782 T> T> Log: T> - Use if_inc_counter() to increment various counters. T> - Do not ever set a counter to a value. For those counters T> that we don't increment, but return directly from hardware T> create cases in if_get_counter() method. Note that this patch was done mechanically. However, with new API all statistics handling in all drivers can be improved. It is no longer required to poll hardware counters and write down their values into ifnet. Hardware counters now can (and should!) be read on demand at the time when either sysctl(2) or network stack asks for a counter. Of course such change to drivers can't be committed without testing on hardware, that's why I decided to be conservative. I'll convert several drivers as an example soon. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 19:15:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB6B32A5; Thu, 18 Sep 2014 19:15:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C61F778D; Thu, 18 Sep 2014 19:15:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IJFevd008903; Thu, 18 Sep 2014 19:15:40 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IJFedR008902; Thu, 18 Sep 2014 19:15:40 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181915.s8IJFedR008902@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 19:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271799 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 19:15:41 -0000 Author: glebius Date: Thu Sep 18 19:15:40 2014 New Revision: 271799 URL: http://svnweb.freebsd.org/changeset/base/271799 Log: - Provide if_get_counter() method for vtnet(4). - Do not accumulate statistics on every tick. - Accumulate statistics in vtnet_setup_stat_sysctl() and in vtnet_get_counter(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Sep 18 18:46:38 2014 (r271798) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Sep 18 19:15:40 2014 (r271799) @@ -107,6 +107,7 @@ static int vtnet_alloc_virtqueues(struct static int vtnet_setup_interface(struct vtnet_softc *); static int vtnet_change_mtu(struct vtnet_softc *, int); static int vtnet_ioctl(struct ifnet *, u_long, caddr_t); +static uint64_t vtnet_get_counter(struct ifnet *, ift_counter); static int vtnet_rxq_populate(struct vtnet_rxq *); static void vtnet_rxq_free_mbufs(struct vtnet_rxq *); @@ -160,11 +161,8 @@ static void vtnet_qflush(struct ifnet *) #endif static int vtnet_watchdog(struct vtnet_txq *); -static void vtnet_rxq_accum_stats(struct vtnet_rxq *, - struct vtnet_rxq_stats *); -static void vtnet_txq_accum_stats(struct vtnet_txq *, - struct vtnet_txq_stats *); -static void vtnet_accumulate_stats(struct vtnet_softc *); +static void vtnet_accum_stats(struct vtnet_softc *, + struct vtnet_rxq_stats *, struct vtnet_txq_stats *); static void vtnet_tick(void *); static void vtnet_start_taskqueues(struct vtnet_softc *); @@ -921,7 +919,7 @@ vtnet_setup_interface(struct vtnet_softc ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vtnet_init; ifp->if_ioctl = vtnet_ioctl; - + ifp->if_get_counter = vtnet_get_counter; #ifndef VTNET_LEGACY_TX ifp->if_transmit = vtnet_txq_mq_start; ifp->if_qflush = vtnet_qflush; @@ -2573,74 +2571,62 @@ vtnet_watchdog(struct vtnet_txq *txq) } static void -vtnet_rxq_accum_stats(struct vtnet_rxq *rxq, struct vtnet_rxq_stats *accum) +vtnet_accum_stats(struct vtnet_softc *sc, struct vtnet_rxq_stats *rxacc, + struct vtnet_txq_stats *txacc) { - struct vtnet_rxq_stats *st; - - st = &rxq->vtnrx_stats; - accum->vrxs_ipackets += st->vrxs_ipackets; - accum->vrxs_ibytes += st->vrxs_ibytes; - accum->vrxs_iqdrops += st->vrxs_iqdrops; - accum->vrxs_csum += st->vrxs_csum; - accum->vrxs_csum_failed += st->vrxs_csum_failed; - accum->vrxs_rescheduled += st->vrxs_rescheduled; -} + bzero(rxacc, sizeof(struct vtnet_rxq_stats)); + bzero(txacc, sizeof(struct vtnet_txq_stats)); -static void -vtnet_txq_accum_stats(struct vtnet_txq *txq, struct vtnet_txq_stats *accum) -{ - struct vtnet_txq_stats *st; + for (int i = 0; i < sc->vtnet_max_vq_pairs; i++) { + struct vtnet_rxq_stats *rxst; + struct vtnet_txq_stats *txst; - st = &txq->vtntx_stats; + rxst = &sc->vtnet_rxqs[i].vtnrx_stats; + rxacc->vrxs_ipackets += rxst->vrxs_ipackets; + rxacc->vrxs_ibytes += rxst->vrxs_ibytes; + rxacc->vrxs_iqdrops += rxst->vrxs_iqdrops; + rxacc->vrxs_csum += rxst->vrxs_csum; + rxacc->vrxs_csum_failed += rxst->vrxs_csum_failed; + rxacc->vrxs_rescheduled += rxst->vrxs_rescheduled; - accum->vtxs_opackets += st->vtxs_opackets; - accum->vtxs_obytes += st->vtxs_obytes; - accum->vtxs_csum += st->vtxs_csum; - accum->vtxs_tso += st->vtxs_tso; - accum->vtxs_rescheduled += st->vtxs_rescheduled; + txst = &sc->vtnet_txqs[i].vtntx_stats; + txacc->vtxs_opackets += txst->vtxs_opackets; + txacc->vtxs_obytes += txst->vtxs_obytes; + txacc->vtxs_csum += txst->vtxs_csum; + txacc->vtxs_tso += txst->vtxs_tso; + txacc->vtxs_rescheduled += txst->vtxs_rescheduled; + } } -static void -vtnet_accumulate_stats(struct vtnet_softc *sc) +static uint64_t +vtnet_get_counter(if_t ifp, ift_counter cnt) { - struct ifnet *ifp; - struct vtnet_statistics *st; + struct vtnet_softc *sc; struct vtnet_rxq_stats rxaccum; struct vtnet_txq_stats txaccum; - int i; - ifp = sc->vtnet_ifp; - st = &sc->vtnet_stats; - bzero(&rxaccum, sizeof(struct vtnet_rxq_stats)); - bzero(&txaccum, sizeof(struct vtnet_txq_stats)); + sc = if_getsoftc(ifp); + vtnet_accum_stats(sc, &rxaccum, &txaccum); - for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { - vtnet_rxq_accum_stats(&sc->vtnet_rxqs[i], &rxaccum); - vtnet_txq_accum_stats(&sc->vtnet_txqs[i], &txaccum); - } - - st->rx_csum_offloaded = rxaccum.vrxs_csum; - st->rx_csum_failed = rxaccum.vrxs_csum_failed; - st->rx_task_rescheduled = rxaccum.vrxs_rescheduled; - st->tx_csum_offloaded = txaccum.vtxs_csum; - st->tx_tso_offloaded = txaccum.vtxs_tso; - st->tx_task_rescheduled = txaccum.vtxs_rescheduled; - - /* - * With the exception of if_ierrors, these ifnet statistics are - * only updated in the driver, so just set them to our accumulated - * values. if_ierrors is updated in ether_input() for malformed - * frames that we should have already discarded. - */ - ifp->if_ipackets = rxaccum.vrxs_ipackets; - ifp->if_iqdrops = rxaccum.vrxs_iqdrops; - ifp->if_ierrors = rxaccum.vrxs_ierrors; - ifp->if_opackets = txaccum.vtxs_opackets; + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (rxaccum.vrxs_ipackets); + case IFCOUNTER_IQDROPS: + return (rxaccum.vrxs_iqdrops); + case IFCOUNTER_IERRORS: + return (rxaccum.vrxs_ierrors); + case IFCOUNTER_OPACKETS: + return (txaccum.vtxs_opackets); #ifndef VTNET_LEGACY_TX - ifp->if_obytes = txaccum.vtxs_obytes; - ifp->if_omcasts = txaccum.vtxs_omcasts; + case IFCOUNTER_OBYTES: + return (txaccum.vtxs_obytes); + case IFCOUNTER_OMCASTS: + return (txaccum.vtxs_omcasts); #endif + default: + return (if_get_counter_default(ifp, cnt)); + } } static void @@ -2655,7 +2641,6 @@ vtnet_tick(void *xsc) timedout = 0; VTNET_CORE_LOCK_ASSERT(sc); - vtnet_accumulate_stats(sc); for (i = 0; i < sc->vtnet_act_vq_pairs; i++) timedout |= vtnet_watchdog(&sc->vtnet_txqs[i]); @@ -3762,8 +3747,18 @@ vtnet_setup_stat_sysctl(struct sysctl_ct struct sysctl_oid_list *child, struct vtnet_softc *sc) { struct vtnet_statistics *stats; + struct vtnet_rxq_stats rxaccum; + struct vtnet_txq_stats txaccum; + + vtnet_accum_stats(sc, &rxaccum, &txaccum); stats = &sc->vtnet_stats; + stats->rx_csum_offloaded = rxaccum.vrxs_csum; + stats->rx_csum_failed = rxaccum.vrxs_csum_failed; + stats->rx_task_rescheduled = rxaccum.vrxs_rescheduled; + stats->tx_csum_offloaded = txaccum.vtxs_csum; + stats->tx_tso_offloaded = txaccum.vtxs_tso; + stats->tx_task_rescheduled = txaccum.vtxs_rescheduled; SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "mbuf_alloc_failed", CTLFLAG_RD, &stats->mbuf_alloc_failed, From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 19:18:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7624B45A; Thu, 18 Sep 2014 19:18:27 +0000 (UTC) Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98FEE7BD; Thu, 18 Sep 2014 19:18:26 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id q59so1418922wes.11 for ; Thu, 18 Sep 2014 12:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8rDfWTxltmAE0YUWXOpXOyF8EqMBuw+nvAYoGWCn1ME=; b=bwg/KsJ6M0xYfahBJ6yO/sq7QcfZxxXG608vTaXzzHo7Di835NjUw96wZD+Rb3u5rh b0xapTsBkxl5nLS9KnIBTuWIR52hubJ7jJpA4cQcxFkjb6YjD2mawgPE1KQQCJf3FZj1 K0fH187ZK8Ha5nDo+GS933i+xzIsRmW3QofhJ6k5sATUvKQsFc1ipz6O6AiP+BCB/1+C vy3NugFmlJtnUsqlBXzzDgmkBOBf8q3oXIeQDYuSPp0XI9EzllRFi0pz+r0mTQT0/bZK tWLv4kHZWGnRHij1mjiToQAeUIx6wtJ7/Nmhg7CPhSbUC3EA8z5sSqwUHym5/jv9gfcS squQ== MIME-Version: 1.0 X-Received: by 10.194.157.230 with SMTP id wp6mr7135353wjb.15.1411067904743; Thu, 18 Sep 2014 12:18:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.199 with HTTP; Thu, 18 Sep 2014 12:18:24 -0700 (PDT) In-Reply-To: <20140918191119.GA884@FreeBSD.org> References: <201409181556.s8IFuEK1013392@svn.freebsd.org> <20140918191119.GA884@FreeBSD.org> Date: Thu, 18 Sep 2014 12:18:24 -0700 X-Google-Sender-Auth: orWYMpERKqITDWfmw97WooxvtkU Message-ID: Subject: Re: svn commit: r271782 - in head/sys/dev: bge bxe e1000 fxp nfe From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 19:18:27 -0000 On 18 September 2014 12:11, Gleb Smirnoff wrote: > On Thu, Sep 18, 2014 at 03:56:14PM +0000, Gleb Smirnoff wrote: > T> Author: glebius > T> Date: Thu Sep 18 15:56:14 2014 > T> New Revision: 271782 > T> URL: http://svnweb.freebsd.org/changeset/base/271782 > T> > T> Log: > T> - Use if_inc_counter() to increment various counters. > T> - Do not ever set a counter to a value. For those counters > T> that we don't increment, but return directly from hardware > T> create cases in if_get_counter() method. > > Note that this patch was done mechanically. However, with new API > all statistics handling in all drivers can be improved. It is no > longer required to poll hardware counters and write down their > values into ifnet. Hardware counters now can (and should!) be read > on demand at the time when either sysctl(2) or network stack > asks for a counter. > > Of course such change to drivers can't be committed without > testing on hardware, that's why I decided to be conservative. > > I'll convert several drivers as an example soon. Something that recently popped up at home with my RSS testing is that the hardware counters may actually reflect the packets that the MAC has seen, rather than the packets the driver side has actually seen. It looks like with flow control disabled, the counters used for ixgbe(4) reflect the per-queue and global MAC RX counters, before a saturated receive thread drops some frames. Before, the interface counters reflected what the driver managed to see, not necessarily what was received by the NIC. What should we do about that? -a From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 19:20:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2996654; Thu, 18 Sep 2014 19:19:59 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4EB7DD; Thu, 18 Sep 2014 19:19:58 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8IJJu16002574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Sep 2014 23:19:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8IJJunu002573; Thu, 18 Sep 2014 23:19:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 18 Sep 2014 23:19:56 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r271782 - in head/sys/dev: bge bxe e1000 fxp nfe Message-ID: <20140918191956.GC884@FreeBSD.org> References: <201409181556.s8IFuEK1013392@svn.freebsd.org> <20140918191119.GA884@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 19:20:00 -0000 On Thu, Sep 18, 2014 at 12:18:24PM -0700, Adrian Chadd wrote: A> On 18 September 2014 12:11, Gleb Smirnoff wrote: A> > On Thu, Sep 18, 2014 at 03:56:14PM +0000, Gleb Smirnoff wrote: A> > T> Author: glebius A> > T> Date: Thu Sep 18 15:56:14 2014 A> > T> New Revision: 271782 A> > T> URL: http://svnweb.freebsd.org/changeset/base/271782 A> > T> A> > T> Log: A> > T> - Use if_inc_counter() to increment various counters. A> > T> - Do not ever set a counter to a value. For those counters A> > T> that we don't increment, but return directly from hardware A> > T> create cases in if_get_counter() method. A> > A> > Note that this patch was done mechanically. However, with new API A> > all statistics handling in all drivers can be improved. It is no A> > longer required to poll hardware counters and write down their A> > values into ifnet. Hardware counters now can (and should!) be read A> > on demand at the time when either sysctl(2) or network stack A> > asks for a counter. A> > A> > Of course such change to drivers can't be committed without A> > testing on hardware, that's why I decided to be conservative. A> > A> > I'll convert several drivers as an example soon. A> A> Something that recently popped up at home with my RSS testing is that A> the hardware counters may actually reflect the packets that the MAC A> has seen, rather than the packets the driver side has actually seen. A> A> It looks like with flow control disabled, the counters used for A> ixgbe(4) reflect the per-queue and global MAC RX counters, before a A> saturated receive thread drops some frames. Before, the interface A> counters reflected what the driver managed to see, not necessarily A> what was received by the NIC. A> A> What should we do about that? Of course we should report that as ierrors, being silent on them is a disaster for a sysadmin. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 19:20:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43CEB799; Thu, 18 Sep 2014 19:20:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E00A7E0; Thu, 18 Sep 2014 19:20:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IJK9iL009559; Thu, 18 Sep 2014 19:20:09 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IJK90l009558; Thu, 18 Sep 2014 19:20:09 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409181920.s8IJK90l009558@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 18 Sep 2014 19:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271800 - stable/10/sys/dev/nmdm 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 19:20:09 -0000 Author: grehan Date: Thu Sep 18 19:20:08 2014 New Revision: 271800 URL: http://svnweb.freebsd.org/changeset/base/271800 Log: MFC nmdm driver changes, r259550 and r271350 r259550 (glebius): Make nmdm(4) destroy devices when both sides of a pair are disconnected. This makes it possible to kldunload nmdm.ko when there are no users of it. r271350: Fix issue with nmdm and leading zeros in device name. The nmdm code enforces a number between the 'nmdm' and 'A|B' portions of the device name. This is then used as a unit number, and sprintf'd back into the tty name. If leading zeros were used in the name, the created device name is different than the string used for the clone-open (e.g. /dev/nmdm0001A will result in /dev/nmdm1A). Since unit numbers are no longer required with the updated tty code, there seems to be no reason to force the string to be a number. The fix is to allow an arbitrary string between 'nmdm' and 'A|B', within the constraints of devfs names. This allows all existing user of numeric strings to continue to work, and also allows more meaningful names to be used, such as bhyve VM names. PR: 192281 Approved by: re (glebius) Modified: stable/10/sys/dev/nmdm/nmdm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nmdm/nmdm.c ============================================================================== --- stable/10/sys/dev/nmdm/nmdm.c Thu Sep 18 19:15:40 2014 (r271799) +++ stable/10/sys/dev/nmdm/nmdm.c Thu Sep 18 19:20:08 2014 (r271800) @@ -58,6 +58,8 @@ static tsw_inwakeup_t nmdm_outwakeup; static tsw_outwakeup_t nmdm_inwakeup; static tsw_param_t nmdm_param; static tsw_modem_t nmdm_modem; +static tsw_close_t nmdm_close; +static tsw_free_t nmdm_free; static struct ttydevsw nmdm_class = { .tsw_flags = TF_NOPREFIX, @@ -65,6 +67,8 @@ static struct ttydevsw nmdm_class = { .tsw_outwakeup = nmdm_outwakeup, .tsw_param = nmdm_param, .tsw_modem = nmdm_modem, + .tsw_close = nmdm_close, + .tsw_free = nmdm_free, }; static void nmdm_task_tty(void *, int); @@ -94,15 +98,83 @@ struct nmdmsoftc { static int nmdm_count = 0; -static struct nmdmsoftc * -nmdm_alloc(unsigned long unit) +static void +nmdm_close(struct tty *tp) +{ + struct nmdmpart *np; + struct nmdmpart *onp; + struct tty *otp; + + np = tty_softc(tp); + onp = np->np_other; + otp = onp->np_tty; + + /* If second part is opened, do not destroy ourselves. */ + if (tty_opened(otp)) + return; + + /* Shut down self. */ + tty_rel_gone(tp); + + /* Shut down second part. */ + tty_lock(tp); + onp = np->np_other; + if (onp == NULL) + return; + otp = onp->np_tty; + tty_rel_gone(otp); + tty_lock(tp); +} + +static void +nmdm_free(void *softc) +{ + struct nmdmpart *np = (struct nmdmpart *)softc; + struct nmdmsoftc *ns = np->np_pair; + + callout_drain(&np->np_callout); + taskqueue_drain(taskqueue_swi, &np->np_task); + + /* + * The function is called on both parts simultaneously. We serialize + * with help of ns_mtx. The first invocation should return and + * delegate freeing of resources to the second. + */ + mtx_lock(&ns->ns_mtx); + if (np->np_other != NULL) { + np->np_other->np_other = NULL; + mtx_unlock(&ns->ns_mtx); + return; + } + mtx_destroy(&ns->ns_mtx); + free(ns, M_NMDM); + atomic_subtract_int(&nmdm_count, 1); +} + +static void +nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen, + struct cdev **dev) { struct nmdmsoftc *ns; struct tty *tp; + char *end; + int error; + char endc; - atomic_add_int(&nmdm_count, 1); + if (*dev != NULL) + return; + if (strncmp(name, "nmdm", 4) != 0) + return; + if (strlen(name) <= strlen("nmdmX")) + return; + + /* Device name must be "nmdm%s%c", where %c is 'A' or 'B'. */ + end = name + strlen(name) - 1; + endc = *end; + if (endc != 'A' && endc != 'B') + return; - ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK|M_ZERO); + ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK | M_ZERO); mtx_init(&ns->ns_mtx, "nmdm", NULL, MTX_DEF); /* Hook the pairs together. */ @@ -119,43 +191,38 @@ nmdm_alloc(unsigned long unit) /* Create device nodes. */ tp = ns->ns_part1.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part1, &ns->ns_mtx); - tty_makedev(tp, NULL, "nmdm%luA", unit); + *end = 'A'; + error = tty_makedevf(tp, NULL, endc == 'A' ? TTYMK_CLONING : 0, + "%s", name); + if (error) { + *end = endc; + mtx_destroy(&ns->ns_mtx); + free(ns, M_NMDM); + return; + } tp = ns->ns_part2.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part2, &ns->ns_mtx); - tty_makedev(tp, NULL, "nmdm%luB", unit); - - return (ns); -} - -static void -nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen, - struct cdev **dev) -{ - unsigned long unit; - char *end; - struct nmdmsoftc *ns; - - if (*dev != NULL) - return; - if (strncmp(name, "nmdm", 4) != 0) - return; - - /* Device name must be "nmdm%lu%c", where %c is 'A' or 'B'. */ - name += 4; - unit = strtoul(name, &end, 10); - if (unit == ULONG_MAX || name == end) - return; - if ((end[0] != 'A' && end[0] != 'B') || end[1] != '\0') + *end = 'B'; + error = tty_makedevf(tp, NULL, endc == 'B' ? TTYMK_CLONING : 0, + "%s", name); + if (error) { + *end = endc; + mtx_lock(&ns->ns_mtx); + /* see nmdm_free() */ + ns->ns_part1.np_other = NULL; + atomic_add_int(&nmdm_count, 1); + tty_rel_gone(ns->ns_part1.np_tty); return; + } - /* XXX: pass privileges? */ - ns = nmdm_alloc(unit); - - if (end[0] == 'A') + if (endc == 'A') *dev = ns->ns_part1.np_tty->t_dev; else *dev = ns->ns_part2.np_tty->t_dev; + + *end = endc; + atomic_add_int(&nmdm_count, 1); } static void @@ -187,6 +254,10 @@ nmdm_task_tty(void *arg, int pending __u tp = np->np_tty; tty_lock(tp); + if (tty_gone(tp)) { + tty_unlock(tp); + return; + } otp = np->np_other->np_tty; KASSERT(otp != NULL, ("NULL otp in nmdmstart")); @@ -203,6 +274,12 @@ nmdm_task_tty(void *arg, int pending __u } } + /* This may happen when we are in detach process. */ + if (tty_gone(otp)) { + tty_unlock(otp); + return; + } + while (ttydisc_rint_poll(otp) > 0) { if (np->np_rate && !np->np_quota) break; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 19:57:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C38C8554; Thu, 18 Sep 2014 19:57:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE3E3B9E; Thu, 18 Sep 2014 19:57:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IJvDdq028535; Thu, 18 Sep 2014 19:57:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IJvDnX028534; Thu, 18 Sep 2014 19:57:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181957.s8IJvDnX028534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 19:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271801 - head/sys/dev/msk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 19:57:14 -0000 Author: glebius Date: Thu Sep 18 19:57:13 2014 New Revision: 271801 URL: http://svnweb.freebsd.org/changeset/base/271801 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Thu Sep 18 19:20:08 2014 (r271800) +++ head/sys/dev/msk/if_msk.c Thu Sep 18 19:57:13 2014 (r271801) @@ -2987,14 +2987,14 @@ msk_watchdog(struct msk_if_softc *sc_if) if (bootverbose) if_printf(sc_if->msk_ifp, "watchdog timeout " "(missed link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; msk_init_locked(sc_if); return; } if_printf(ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; msk_init_locked(sc_if); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -3216,7 +3216,7 @@ msk_rxeof(struct msk_if_softc *sc_if, ui * handle this frame. */ if (len > MSK_MAX_FRAMELEN || len < ETHER_HDR_LEN) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); msk_discard_rxbuf(sc_if, cons); break; } @@ -3225,7 +3225,7 @@ msk_rxeof(struct msk_if_softc *sc_if, ui ((status & GMR_FS_RX_OK) == 0) || (rxlen != len)) { /* Don't count flow-control packet as errors. */ if ((status & GMR_FS_GOOD_FC) == 0) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); msk_discard_rxbuf(sc_if, cons); break; } @@ -3237,7 +3237,7 @@ msk_rxeof(struct msk_if_softc *sc_if, ui #endif m = rxd->rx_m; if (msk_newbuf(sc_if, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); /* Reuse old buffer. */ msk_discard_rxbuf(sc_if, cons); break; @@ -3248,7 +3248,7 @@ msk_rxeof(struct msk_if_softc *sc_if, ui if ((sc_if->msk_flags & MSK_FLAG_RAMBUF) != 0) msk_fixup_rx(m); #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) msk_rxcsum(sc_if, control, m); /* Check for VLAN tagged packets. */ @@ -3290,7 +3290,7 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ ((status & GMR_FS_RX_OK) == 0) || (rxlen != len)) { /* Don't count flow-control packet as errors. */ if ((status & GMR_FS_GOOD_FC) == 0) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); msk_discard_jumbo_rxbuf(sc_if, cons); break; } @@ -3302,7 +3302,7 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ #endif m = jrxd->rx_m; if (msk_jumbo_newbuf(sc_if, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); /* Reuse old buffer. */ msk_discard_jumbo_rxbuf(sc_if, cons); break; @@ -3313,7 +3313,7 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ if ((sc_if->msk_flags & MSK_FLAG_RAMBUF) != 0) msk_fixup_rx(m); #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) msk_rxcsum(sc_if, control, m); /* Check for VLAN tagged packets. */ @@ -3368,7 +3368,7 @@ msk_txeof(struct msk_if_softc *sc_if, in BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc_if->msk_cdata.msk_tx_tag, txd->tx_dmamap); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); KASSERT(txd->tx_m != NULL, ("%s: freeing NULL mbuf!", __func__)); m_freem(txd->tx_m); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:00:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA7A9854; Thu, 18 Sep 2014 20:00:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 940AEC46; Thu, 18 Sep 2014 20:00:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IK0bOs031167; Thu, 18 Sep 2014 20:00:37 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IK0aO0030966; Thu, 18 Sep 2014 20:00:36 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409182000.s8IK0aO0030966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 18 Sep 2014 20:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271802 - in head: share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/modules/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:00:37 -0000 Author: smh Date: Thu Sep 18 20:00:36 2014 New Revision: 271802 URL: http://svnweb.freebsd.org/changeset/base/271802 Log: Add dtrace probe support for zfs SET_ERROR(..) MFC after: 1 week Sponsored by: Multiplay Added: head/sys/cddl/compat/opensolaris/kern/opensolaris_dtrace.c (contents, props changed) Modified: head/share/man/man9/SDT.9 head/sys/cddl/compat/opensolaris/sys/sdt.h head/sys/modules/zfs/Makefile Modified: head/share/man/man9/SDT.9 ============================================================================== --- head/share/man/man9/SDT.9 Thu Sep 18 19:57:13 2014 (r271801) +++ head/share/man/man9/SDT.9 Thu Sep 18 20:00:36 2014 (r271802) @@ -24,13 +24,16 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2013 +.Dd September 18, 2014 .Dt SDT 9 .Os .Sh NAME .Nm SDT .Nd a DTrace framework for adding statically-defined tracing probes .Sh SYNOPSIS +.In sys/param.h +.In sys/types.h +.In sys/queue.h .In sys/sdt.h .Fn SDT_PROVIDER_DECLARE prov .Fn SDT_PROVIDER_DEFINE prov Added: head/sys/cddl/compat/opensolaris/kern/opensolaris_dtrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_dtrace.c Thu Sep 18 20:00:36 2014 (r271802) @@ -0,0 +1,37 @@ +/*- + * Copyright 2014 The FreeBSD Project. + * All rights reserved. + * + * This software was developed by Steven Hartland. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +SDT_PROBE_DEFINE1(sdt, , , set__error, "int"); Modified: head/sys/cddl/compat/opensolaris/sys/sdt.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/sdt.h Thu Sep 18 19:57:13 2014 (r271801) +++ head/sys/cddl/compat/opensolaris/sys/sdt.h Thu Sep 18 20:00:36 2014 (r271802) @@ -31,6 +31,15 @@ #include_next -#define SET_ERROR(err) (err) +#ifdef KDTRACE_HOOKS +SDT_PROBE_DECLARE(sdt, , , set__error); + +#define SET_ERROR(err) \ + ((sdt_sdt___set__error->id ? \ + (*sdt_probe_func)(sdt_sdt___set__error->id, \ + (uintptr_t)err, 0, 0, 0, 0) : 0), err) +#else +#define SET_ERROR(err) (err) +#endif #endif /* _OPENSOLARIS_SYS_SDT_H_ */ Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Thu Sep 18 19:57:13 2014 (r271801) +++ head/sys/modules/zfs/Makefile Thu Sep 18 20:00:36 2014 (r271802) @@ -21,6 +21,7 @@ SRCS+= u8_textprep.c .PATH: ${SYSDIR}/cddl/compat/opensolaris/kern SRCS+= opensolaris_acl.c +SRCS+= opensolaris_dtrace.c SRCS+= opensolaris_kobj.c SRCS+= opensolaris_kstat.c SRCS+= opensolaris_lookup.c From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:03:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 559239D0; Thu, 18 Sep 2014 20:03:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26E03C68; Thu, 18 Sep 2014 20:03:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IK3k4p033069; Thu, 18 Sep 2014 20:03:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IK3kr8033068; Thu, 18 Sep 2014 20:03:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182003.s8IK3kr8033068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271803 - head/sys/dev/tl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:03:46 -0000 Author: glebius Date: Thu Sep 18 20:03:45 2014 New Revision: 271803 URL: http://svnweb.freebsd.org/changeset/base/271803 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/tl/if_tl.c Modified: head/sys/dev/tl/if_tl.c ============================================================================== --- head/sys/dev/tl/if_tl.c Thu Sep 18 20:00:36 2014 (r271802) +++ head/sys/dev/tl/if_tl.c Thu Sep 18 20:03:45 2014 (r271803) @@ -1430,7 +1430,7 @@ tl_intvec_rxeof(xsc, type) total_len = cur_rx->tl_ptr->tlist_frsize; if (tl_newbuf(sc, cur_rx) == ENOBUFS) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->tl_ptr->tlist_frsize = MCLBYTES; cur_rx->tl_ptr->tlist_cstat = TL_CSTAT_READY; cur_rx->tl_ptr->tl_frag.tlist_dcnt = MCLBYTES; @@ -1726,13 +1726,13 @@ tl_stats_update(xsc) *p++ = CSR_READ_4(sc, TL_DIO_DATA); *p++ = CSR_READ_4(sc, TL_DIO_DATA); - ifp->if_opackets += tl_tx_goodframes(tl_stats); - ifp->if_collisions += tl_stats.tl_tx_single_collision + - tl_stats.tl_tx_multi_collision; - ifp->if_ipackets += tl_rx_goodframes(tl_stats); - ifp->if_ierrors += tl_stats.tl_crc_errors + tl_stats.tl_code_errors + - tl_rx_overrun(tl_stats); - ifp->if_oerrors += tl_tx_underrun(tl_stats); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, tl_tx_goodframes(tl_stats)); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + tl_stats.tl_tx_single_collision + tl_stats.tl_tx_multi_collision); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, tl_rx_goodframes(tl_stats)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, tl_stats.tl_crc_errors + + tl_stats.tl_code_errors + tl_rx_overrun(tl_stats)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, tl_tx_underrun(tl_stats)); if (tl_tx_underrun(tl_stats)) { u_int8_t tx_thresh; @@ -2186,7 +2186,7 @@ tl_watchdog(sc) if_printf(ifp, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); tl_softreset(sc, 1); tl_init_locked(sc); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:06:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE926BCA; Thu, 18 Sep 2014 20:06:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99569C8D; Thu, 18 Sep 2014 20:06:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IK6ADb033434; Thu, 18 Sep 2014 20:06:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IK6A0X033433; Thu, 18 Sep 2014 20:06:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182006.s8IK6A0X033433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271804 - head/sys/dev/tx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:06:10 -0000 Author: glebius Date: Thu Sep 18 20:06:10 2014 New Revision: 271804 URL: http://svnweb.freebsd.org/changeset/base/271804 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/tx/if_tx.c Modified: head/sys/dev/tx/if_tx.c ============================================================================== --- head/sys/dev/tx/if_tx.c Thu Sep 18 20:03:45 2014 (r271803) +++ head/sys/dev/tx/if_tx.c Thu Sep 18 20:06:10 2014 (r271804) @@ -671,7 +671,7 @@ epic_ifstart_locked(struct ifnet * ifp) if (error && error != EFBIG) { m_freem(m0); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } @@ -683,7 +683,7 @@ epic_ifstart_locked(struct ifnet * ifp) m = m_defrag(m0, M_NOWAIT); if (m == NULL) { m_freem(m0); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } m_freem(m0); @@ -693,7 +693,7 @@ epic_ifstart_locked(struct ifnet * ifp) epic_dma_map_txbuf, flist, 0); if (error) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -748,7 +748,7 @@ epic_rx_done(epic_softc_t *sc) * RXE interrupt usually. */ if ((desc->status & 1) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); desc->status = 0x8000; continue; } @@ -763,7 +763,7 @@ epic_rx_done(epic_softc_t *sc) if (buf->mbuf == NULL) { buf->mbuf = m; desc->status = 0x8000; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } buf->mbuf->m_len = buf->mbuf->m_pkthdr.len = MCLBYTES; @@ -775,7 +775,7 @@ epic_rx_done(epic_softc_t *sc) if (error) { buf->mbuf = m; desc->status = 0x8000; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } @@ -796,7 +796,7 @@ epic_rx_done(epic_softc_t *sc) EPIC_LOCK(sc); /* Successfuly received frame */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); } bus_dmamap_sync(sc->rtag, sc->rmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -838,10 +838,10 @@ epic_tx_done(epic_softc_t *sc) /* Check for errors and collisions. */ if (status & 0x0001) - sc->ifp->if_opackets++; + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); else - sc->ifp->if_oerrors++; - sc->ifp->if_collisions += (status >> 8) & 0x1F; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, (status >> 8) & 0x1F); #ifdef EPIC_DIAG if ((status & 0x1001) == 0x1001) device_printf(sc->dev, @@ -881,7 +881,7 @@ epic_intr(void *arg) #endif if ((CSR_READ_4(sc, COMMAND) & COMMAND_RXQUEUED) == 0) CSR_WRITE_4(sc, COMMAND, COMMAND_RXQUEUED); - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); } } @@ -911,12 +911,12 @@ epic_intr(void *arg) #ifdef EPIC_DIAG device_printf(sc->dev, "CRC/Alignment error\n"); #endif - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); } if (status & INTSTAT_TXU) { epic_tx_underrun(sc); - sc->ifp->if_oerrors++; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); } } } @@ -981,7 +981,7 @@ epic_timer(void *arg) /* If not successful. */ if (sc->pending_txs > 0) { - ifp->if_oerrors += sc->pending_txs; + if_inc_counter(ifp, IFCOUNTER_OERRORS, sc->pending_txs); /* Reinitialize board. */ device_printf(sc->dev, "reinitialization\n"); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:09:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88AC9D4B; Thu, 18 Sep 2014 20:09:10 +0000 (UTC) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C432CB6; Thu, 18 Sep 2014 20:09:10 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id bj1so2281822pad.3 for ; Thu, 18 Sep 2014 13:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=kPU8ohhZKahZSrwAR/ZJ10Y9e9F1OLPM9bbPvaDLnQA=; b=k/Cn+vNyDiiMuR/ferNPwYw//oiKT0hE5loih45Gl7jZrFzVer5LygHE8Wi0ae+2S6 4JpmmxPGLR4NCYaCjNYZoNgDcAP6g+za3XA0ImNNEqfzWqEVHSWVsZWKAMZwYek/yPtp jkNb6pHM9/gPjf6tPQBlIviYSlKyCvFybmYBnk3H+hVW8qts7HCFof8VlX3VSpH4gFw4 0/K1Webr/UDqLdbclkjL8pFd4KROWoyFQWtYNBCFZRDJpnrZREuydGGq2nW2HhQU2M5M vQlSgka6L8fEzQB9U0QyhVZ8a0qhZvgc1WoMVKmp+PHdh6Np6fxJ/rCcjQcR9ZyMyEwH rRqw== X-Received: by 10.70.96.200 with SMTP id du8mr10032453pdb.117.1411070949303; Thu, 18 Sep 2014 13:09:09 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id d3sm20524775pbu.18.2014.09.18.13.09.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 13:09:08 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <541B3BE1.7080005@FreeBSD.org> Date: Thu, 18 Sep 2014 13:09:05 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271803 - head/sys/dev/tl References: <201409182003.s8IK3kr8033068@svn.freebsd.org> In-Reply-To: <201409182003.s8IK3kr8033068@svn.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:09:10 -0000 Consider changing if_inc_counter to be inline and have it take const ints for the counter and increment. The compiler will optimize away all the unneeded code in if_inc_counter. Regards, Navdeep On 09/18/14 13:03, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Sep 18 20:03:45 2014 > New Revision: 271803 > URL: http://svnweb.freebsd.org/changeset/base/271803 > > Log: > Mechanically convert to if_inc_counter(). > > Modified: > head/sys/dev/tl/if_tl.c > > Modified: head/sys/dev/tl/if_tl.c > ============================================================================== > --- head/sys/dev/tl/if_tl.c Thu Sep 18 20:00:36 2014 (r271802) > +++ head/sys/dev/tl/if_tl.c Thu Sep 18 20:03:45 2014 (r271803) > @@ -1430,7 +1430,7 @@ tl_intvec_rxeof(xsc, type) > total_len = cur_rx->tl_ptr->tlist_frsize; > > if (tl_newbuf(sc, cur_rx) == ENOBUFS) { > - ifp->if_ierrors++; > + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); > cur_rx->tl_ptr->tlist_frsize = MCLBYTES; > cur_rx->tl_ptr->tlist_cstat = TL_CSTAT_READY; > cur_rx->tl_ptr->tl_frag.tlist_dcnt = MCLBYTES; > @@ -1726,13 +1726,13 @@ tl_stats_update(xsc) > *p++ = CSR_READ_4(sc, TL_DIO_DATA); > *p++ = CSR_READ_4(sc, TL_DIO_DATA); > > - ifp->if_opackets += tl_tx_goodframes(tl_stats); > - ifp->if_collisions += tl_stats.tl_tx_single_collision + > - tl_stats.tl_tx_multi_collision; > - ifp->if_ipackets += tl_rx_goodframes(tl_stats); > - ifp->if_ierrors += tl_stats.tl_crc_errors + tl_stats.tl_code_errors + > - tl_rx_overrun(tl_stats); > - ifp->if_oerrors += tl_tx_underrun(tl_stats); > + if_inc_counter(ifp, IFCOUNTER_OPACKETS, tl_tx_goodframes(tl_stats)); > + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, > + tl_stats.tl_tx_single_collision + tl_stats.tl_tx_multi_collision); > + if_inc_counter(ifp, IFCOUNTER_IPACKETS, tl_rx_goodframes(tl_stats)); > + if_inc_counter(ifp, IFCOUNTER_IERRORS, tl_stats.tl_crc_errors + > + tl_stats.tl_code_errors + tl_rx_overrun(tl_stats)); > + if_inc_counter(ifp, IFCOUNTER_OERRORS, tl_tx_underrun(tl_stats)); > > if (tl_tx_underrun(tl_stats)) { > u_int8_t tx_thresh; > @@ -2186,7 +2186,7 @@ tl_watchdog(sc) > > if_printf(ifp, "device timeout\n"); > > - ifp->if_oerrors++; > + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); > > tl_softreset(sc, 1); > tl_init_locked(sc); > From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:09:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 605BDE8E; Thu, 18 Sep 2014 20:09:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41395CBB; Thu, 18 Sep 2014 20:09:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IK9a1G034050; Thu, 18 Sep 2014 20:09:36 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IK9asR034049; Thu, 18 Sep 2014 20:09:36 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182009.s8IK9asR034049@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271805 - head/sys/dev/sis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:09:36 -0000 Author: glebius Date: Thu Sep 18 20:09:35 2014 New Revision: 271805 URL: http://svnweb.freebsd.org/changeset/base/271805 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/sis/if_sis.c Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Thu Sep 18 20:06:10 2014 (r271804) +++ head/sys/dev/sis/if_sis.c Thu Sep 18 20:09:35 2014 (r271805) @@ -1509,9 +1509,9 @@ sis_rxeof(struct sis_softc *sc) ETHER_CRC_LEN)) rxstat &= ~SIS_RXSTAT_GIANT; if (SIS_RXSTAT_ERROR(rxstat) != 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (rxstat & SIS_RXSTAT_COLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); sis_discard_rxbuf(rxd); continue; } @@ -1519,7 +1519,7 @@ sis_rxeof(struct sis_softc *sc) /* Add a new receive buffer to the ring. */ m = rxd->rx_m; if (sis_newbuf(sc, rxd) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); sis_discard_rxbuf(rxd); continue; } @@ -1535,7 +1535,7 @@ sis_rxeof(struct sis_softc *sc) */ sis_fixup_rx(m); #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; SIS_UNLOCK(sc); @@ -1593,15 +1593,15 @@ sis_txeof(struct sis_softc *sc) m_freem(txd->tx_m); txd->tx_m = NULL; if ((txstat & SIS_CMDSTS_PKT_OK) != 0) { - ifp->if_opackets++; - ifp->if_collisions += - (txstat & SIS_TXSTAT_COLLCNT) >> 16; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + (txstat & SIS_TXSTAT_COLLCNT) >> 16); } else { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (txstat & SIS_TXSTAT_EXCESSCOLLS) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (txstat & SIS_TXSTAT_OUTOFWINCOLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } } sc->sis_tx_cnt--; @@ -1664,7 +1664,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm status = CSR_READ_4(sc, SIS_ISR); if (status & (SIS_ISR_RX_ERR|SIS_ISR_RX_OFLOW)) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (status & (SIS_ISR_RX_IDLE)) SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); @@ -1722,7 +1722,7 @@ sis_intr(void *arg) sis_rxeof(sc); if (status & SIS_ISR_RX_OFLOW) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (status & (SIS_ISR_RX_IDLE)) SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); @@ -2197,7 +2197,7 @@ sis_watchdog(struct sis_softc *sc) return; device_printf(sc->sis_dev, "watchdog timeout\n"); - sc->sis_ifp->if_oerrors++; + if_inc_counter(sc->sis_ifp, IFCOUNTER_OERRORS, 1); sc->sis_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:11:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE2B11BD; Thu, 18 Sep 2014 20:11:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F4BFCE3; Thu, 18 Sep 2014 20:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKBSth037242; Thu, 18 Sep 2014 20:11:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKBSJf037241; Thu, 18 Sep 2014 20:11:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182011.s8IKBSJf037241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271806 - head/sys/dev/ep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:11:28 -0000 Author: glebius Date: Thu Sep 18 20:11:28 2014 New Revision: 271806 URL: http://svnweb.freebsd.org/changeset/base/271806 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ep/if_ep.c Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Thu Sep 18 20:09:35 2014 (r271805) +++ head/sys/dev/ep/if_ep.c Thu Sep 18 20:11:28 2014 (r271806) @@ -512,7 +512,7 @@ startagain: */ if (len + pad > ETHER_MAX_LEN) { /* packet is obviously too large: toss it */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m0); goto readcheck; } @@ -564,7 +564,7 @@ startagain: BPF_MTAP(ifp, m0); sc->tx_timer = 2; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); m_freem(m0); /* @@ -640,7 +640,8 @@ rescan: CSR_READ_2(sc, EP_W4_FIFO_DIAG)); printf("\tStat: %x\n", sc->stat); printf("\tIpackets=%d, Opackets=%d\n", - ifp->if_ipackets, ifp->if_opackets); + ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS), + ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS)); printf("\tNOF=%d, NOMB=%d, RXOF=%d, RXOL=%d, TXU=%d\n", sc->rx_no_first, sc->rx_no_mbuf, sc->rx_overrunf, sc->rx_overrunl, sc->tx_underrun); @@ -650,7 +651,7 @@ rescan: device_printf(sc->dev, "Status: %x (input buffer overflow)\n", status); #else - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); #endif #endif @@ -683,9 +684,9 @@ rescan: * TXS_MAX_COLLISION we * shouldn't get here */ - ++ifp->if_collisions; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE); /* * To have a tx_avail_int but giving @@ -731,7 +732,7 @@ epread(struct ep_softc *sc) read_again: if (status & ERR_RX) { - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (status & ERR_RX_OVERRUN) { /* * We can think the rx latency is actually @@ -829,7 +830,7 @@ read_again: return; } CSR_WRITE_2(sc, EP_COMMAND, RX_DISCARD_TOP_PACK); - ++ifp->if_ipackets; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); EP_FSET(sc, F_RX_FIRST); top->m_pkthdr.rcvif = sc->ifp; top->m_pkthdr.len = sc->cur_len; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:15:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A966845A; Thu, 18 Sep 2014 20:15:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 942F2D97; Thu, 18 Sep 2014 20:15:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKFrtk038440; Thu, 18 Sep 2014 20:15:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKFrfj038439; Thu, 18 Sep 2014 20:15:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182015.s8IKFrfj038439@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271807 - head/sys/dev/fe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:15:53 -0000 Author: glebius Date: Thu Sep 18 20:15:53 2014 New Revision: 271807 URL: http://svnweb.freebsd.org/changeset/base/271807 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/fe/if_fe.c Modified: head/sys/dev/fe/if_fe.c ============================================================================== --- head/sys/dev/fe/if_fe.c Thu Sep 18 20:11:28 2014 (r271806) +++ head/sys/dev/fe/if_fe.c Thu Sep 18 20:15:53 2014 (r271807) @@ -930,7 +930,7 @@ static void fe_reset (struct fe_softc *sc) { /* Record how many packets are lost by this accident. */ - sc->ifp->if_oerrors += sc->txb_sched + sc->txb_count; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, sc->txb_sched + sc->txb_count); sc->mibdata.dot3StatsInternalMacTransmitErrors++; /* Put the interface into known initial state. */ @@ -997,12 +997,15 @@ fe_watchdog (void *arg) FE_ASSERT_LOCKED(sc); if (sc->tx_timeout && --sc->tx_timeout == 0) { + struct ifnet *ifp = sc->ifp; + /* A "debug" message. */ - if_printf(sc->ifp, "transmission timeout (%d+%d)%s\n", + if_printf(ifp, "transmission timeout (%d+%d)%s\n", sc->txb_sched, sc->txb_count, - (sc->ifp->if_flags & IFF_UP) ? "" : " when down"); - if (sc->ifp->if_opackets == 0 && sc->ifp->if_ipackets == 0) - if_printf(sc->ifp, "wrong IRQ setting in config?\n"); + (ifp->if_flags & IFF_UP) ? "" : " when down"); + if (ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS) == 0 && + ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS) == 0) + if_printf(ifp, "wrong IRQ setting in config?\n"); fe_reset(sc); } callout_reset(&sc->timer, hz, fe_watchdog, sc); @@ -1519,7 +1522,7 @@ fe_tint (struct fe_softc * sc, u_char ts */ col = 1; } - sc->ifp->if_collisions += col; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, col); if (col == 1) sc->mibdata.dot3StatsSingleCollisionFrames++; else @@ -1532,9 +1535,9 @@ fe_tint (struct fe_softc * sc, u_char ts * Be sure to reflect number of excessive collisions. */ col = sc->tx_excolls; - sc->ifp->if_opackets += sc->txb_sched - col; - sc->ifp->if_oerrors += col; - sc->ifp->if_collisions += col * 16; + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, sc->txb_sched - col); + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, col); + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, col * 16); sc->mibdata.dot3StatsExcessiveCollisions += col; sc->mibdata.dot3StatsCollFrequencies[15] += col; sc->txb_sched = 0; @@ -1591,7 +1594,7 @@ fe_rint (struct fe_softc * sc, u_char rs if (rstat & FE_D1_SRTPKT) sc->mibdata.dot3StatsFrameTooShorts++; /* :-) */ #endif - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); } /* @@ -1651,7 +1654,7 @@ fe_rint (struct fe_softc * sc, u_char rs len < ETHER_MIN_LEN - ETHER_CRC_LEN) { if_printf(sc->ifp, "RX buffer out-of-sync\n"); - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); sc->mibdata.dot3StatsInternalMacReceiveErrors++; fe_reset(sc); return; @@ -1668,14 +1671,14 @@ fe_rint (struct fe_softc * sc, u_char rs * in the buffer. We hope we can get more * mbuf next time. */ - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); sc->mibdata.dot3StatsMissedFrames++; fe_droppacket(sc, len); return; } /* Successfully received a packet. Update stat. */ - sc->ifp->if_ipackets++; + if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1); } /* Maximum number of frames has been received. Something @@ -1961,7 +1964,7 @@ fe_write_mbufs (struct fe_softc *sc, str length > ETHER_MAX_LEN - ETHER_CRC_LEN) { if_printf(sc->ifp, "got an out-of-spec packet (%u bytes) to send\n", length); - sc->ifp->if_oerrors++; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); sc->mibdata.dot3StatsInternalMacTransmitErrors++; return; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:17:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1A0D618; Thu, 18 Sep 2014 20:17:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 814DEDC8; Thu, 18 Sep 2014 20:17:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKHR6L038681; Thu, 18 Sep 2014 20:17:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKHRoh038680; Thu, 18 Sep 2014 20:17:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182017.s8IKHRoh038680@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271808 - head/sys/dev/vr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:17:27 -0000 Author: glebius Date: Thu Sep 18 20:17:27 2014 New Revision: 271808 URL: http://svnweb.freebsd.org/changeset/base/271808 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/vr/if_vr.c Modified: head/sys/dev/vr/if_vr.c ============================================================================== --- head/sys/dev/vr/if_vr.c Thu Sep 18 20:15:53 2014 (r271807) +++ head/sys/dev/vr/if_vr.c Thu Sep 18 20:17:27 2014 (r271808) @@ -1325,7 +1325,7 @@ vr_rxeof(struct vr_softc *sc) if ((rxstat & VR_RXSTAT_RX_OK) == 0 || (rxstat & (VR_RXSTAT_FIRSTFRAG | VR_RXSTAT_LASTFRAG)) != (VR_RXSTAT_FIRSTFRAG | VR_RXSTAT_LASTFRAG)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); sc->vr_stat.rx_errors++; if (rxstat & VR_RXSTAT_CRCERR) sc->vr_stat.rx_crc_errors++; @@ -1348,7 +1348,7 @@ vr_rxeof(struct vr_softc *sc) } if (vr_newbuf(sc, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); sc->vr_stat.rx_errors++; sc->vr_stat.rx_no_mbufs++; vr_discard_rxbuf(rxd); @@ -1376,7 +1376,7 @@ vr_rxeof(struct vr_softc *sc) vr_fixup_rx(m); #endif m->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); sc->vr_stat.rx_ok++; if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && (rxstat & VR_RXSTAT_FRAG) == 0 && @@ -1466,7 +1466,7 @@ vr_txeof(struct vr_softc *sc) __func__)); if ((txstat & VR_TXSTAT_ERRSUM) != 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); sc->vr_stat.tx_errors++; if ((txstat & VR_TXSTAT_ABRT) != 0) { /* Give up and restart Tx. */ @@ -1504,28 +1504,28 @@ vr_txeof(struct vr_softc *sc) return; } if ((txstat & VR_TXSTAT_DEFER) != 0) { - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); sc->vr_stat.tx_collisions++; } if ((txstat & VR_TXSTAT_LATECOLL) != 0) { - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); sc->vr_stat.tx_late_collisions++; } } else { sc->vr_stat.tx_ok++; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } bus_dmamap_sync(sc->vr_cdata.vr_tx_tag, txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->vr_cdata.vr_tx_tag, txd->tx_dmamap); if (sc->vr_revid < REV_ID_VT3071_A) { - ifp->if_collisions += - (txstat & VR_TXSTAT_COLLCNT) >> 3; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + (txstat & VR_TXSTAT_COLLCNT) >> 3); sc->vr_stat.tx_collisions += (txstat & VR_TXSTAT_COLLCNT) >> 3; } else { - ifp->if_collisions += (txstat & 0x0f); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (txstat & 0x0f)); sc->vr_stat.tx_collisions += (txstat & 0x0f); } m_freem(txd->tx_m); @@ -2318,13 +2318,13 @@ vr_watchdog(struct vr_softc *sc) if (bootverbose) if_printf(sc->vr_ifp, "watchdog timeout " "(missed link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vr_init_locked(sc); return; } - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if_printf(ifp, "watchdog timeout\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:17:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3827756; Thu, 18 Sep 2014 20:17:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4282DCB; Thu, 18 Sep 2014 20:17:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKHgIb038758; Thu, 18 Sep 2014 20:17:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKHgVQ038756; Thu, 18 Sep 2014 20:17:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182017.s8IKHgVQ038756@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 20:17:42 +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: r271809 - stable/9/sys/netinet 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:17:43 -0000 Author: asomers Date: Thu Sep 18 20:17:42 2014 New Revision: 271809 URL: http://svnweb.freebsd.org/changeset/base/271809 Log: MFC 263779, except for the ATF test change. Correct ARP update handling when the routes for network interfaces are restricted to a single FIB in a multifib system. Restricting an interface's routes to the FIB to which it is assigned (by setting net.add_addr_allfibs=0) causes ARP updates to fail with "arpresolve: can't allocate llinfo for x.x.x.x". This is due to the ARP update code hard coding it's lookup for existing routing entries to FIB 0. sys/netinet/in.c: When dealing with RTM_ADD (add route) requests for an interface, use the interface's assigned FIB instead of the default (FIB 0). sys/netinet/if_ether.c: In arpresolve(), enhance error message generated when an lla_lookup() fails so that the interface causing the error is visible in logs. PR: kern/167947 Modified: stable/9/sys/netinet/if_ether.c stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Thu Sep 18 20:17:27 2014 (r271808) +++ stable/9/sys/netinet/if_ether.c Thu Sep 18 20:17:42 2014 (r271809) @@ -326,8 +326,8 @@ retry: if (la == NULL) { if (flags & LLE_CREATE) log(LOG_DEBUG, - "arpresolve: can't allocate llinfo for %s\n", - inet_ntoa(SIN(dst)->sin_addr)); + "arpresolve: can't allocate llinfo for %s on %s\n", + inet_ntoa(SIN(dst)->sin_addr), ifp->if_xname); m_freem(m); return (EINVAL); } Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 20:17:27 2014 (r271808) +++ stable/9/sys/netinet/in.c Thu Sep 18 20:17:42 2014 (r271809) @@ -1366,8 +1366,9 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - /* XXX rtalloc1 should take a const param */ - rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); + /* XXX rtalloc1_fib should take a const param */ + rt = rtalloc1_fib(__DECONST(struct sockaddr *, l3addr), 0, 0, + ifp->if_fib); if (rt == NULL) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:18:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02BF58A1; Thu, 18 Sep 2014 20:18:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7A2EDDA; Thu, 18 Sep 2014 20:18:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKItHa039054; Thu, 18 Sep 2014 20:18:55 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKIt4Y039053; Thu, 18 Sep 2014 20:18:55 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182018.s8IKIt4Y039053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271810 - head/sys/dev/mwl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:18:56 -0000 Author: glebius Date: Thu Sep 18 20:18:55 2014 New Revision: 271810 URL: http://svnweb.freebsd.org/changeset/base/271810 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Thu Sep 18 20:17:42 2014 (r271809) +++ head/sys/dev/mwl/if_mwl.c Thu Sep 18 20:18:55 2014 (r271810) @@ -1434,7 +1434,7 @@ mwl_start(struct ifnet *ifp) * Pass the frame to the h/w for transmission. */ if (mwl_tx_start(sc, ni, bf, m)) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); mwl_puttxbuf_head(txq, bf); ieee80211_free_node(ni); continue; @@ -1504,7 +1504,7 @@ mwl_raw_xmit(struct ieee80211_node *ni, * Pass the frame to the h/w for transmission. */ if (mwl_tx_start(sc, ni, bf, m)) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); mwl_puttxbuf_head(txq, bf); ieee80211_free_node(ni); @@ -2741,7 +2741,7 @@ mwl_rx_proc(void *arg, int npending) #endif status = ds->Status; if (status & EAGLE_RXD_STATUS_DECRYPT_ERR_MASK) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); sc->sc_stats.mst_rx_crypto++; /* * NB: Check EAGLE_RXD_STATUS_GENERAL_DECRYPT_ERR @@ -2887,7 +2887,7 @@ mwl_rx_proc(void *arg, int npending) ieee80211_dump_pkt(ic, mtod(m, caddr_t), len, ds->Rate, rssi); } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* dispatch */ ni = ieee80211_find_rxnode(ic, @@ -3405,7 +3405,7 @@ mwl_tx_start(struct mwl_softc *sc, struc STAILQ_INSERT_TAIL(&txq->active, bf, bf_list); MWL_TXDESC_SYNC(txq, ds, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->sc_tx_timer = 5; MWL_TXQ_UNLOCK(txq); @@ -4785,7 +4785,7 @@ mwl_watchdog(void *arg) mwl_reset(ifp); mwl_txq_dump(&sc->sc_txq[0]);/*XXX*/ #endif - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); sc->sc_stats.mst_watchdog++; } } @@ -4928,8 +4928,10 @@ mwl_ioctl(struct ifnet *ifp, u_long cmd, case SIOCGMVSTATS: mwl_hal_gethwstats(sc->sc_mh, &sc->sc_stats.hw_stats); /* NB: embed these numbers to get a consistent view */ - sc->sc_stats.mst_tx_packets = ifp->if_opackets; - sc->sc_stats.mst_rx_packets = ifp->if_ipackets; + sc->sc_stats.mst_tx_packets = + ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS); + sc->sc_stats.mst_rx_packets = + ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS); /* * NB: Drop the softc lock in case of a page fault; * we'll accept any potential inconsisentcy in the From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:21:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72486C0C; Thu, 18 Sep 2014 20:21:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1F7E91; Thu, 18 Sep 2014 20:21:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKLlfa041279; Thu, 18 Sep 2014 20:21:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKLlMV041278; Thu, 18 Sep 2014 20:21:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182021.s8IKLlMV041278@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271811 - head/sys/dev/gem X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:21:47 -0000 Author: glebius Date: Thu Sep 18 20:21:46 2014 New Revision: 271811 URL: http://svnweb.freebsd.org/changeset/base/271811 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/gem/if_gem.c Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Thu Sep 18 20:18:55 2014 (r271810) +++ head/sys/dev/gem/if_gem.c Thu Sep 18 20:21:46 2014 (r271811) @@ -568,18 +568,18 @@ gem_tick(void *arg) /* * Unload collision and error counters. */ - ifp->if_collisions += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, GEM_BANK1_READ_4(sc, GEM_MAC_NORM_COLL_CNT) + - GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT); + GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT)); v = GEM_BANK1_READ_4(sc, GEM_MAC_EXCESS_COLL_CNT) + GEM_BANK1_READ_4(sc, GEM_MAC_LATE_COLL_CNT); - ifp->if_collisions += v; - ifp->if_oerrors += v; - ifp->if_ierrors += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, v); + if_inc_counter(ifp, IFCOUNTER_OERRORS, v); + if_inc_counter(ifp, IFCOUNTER_IERRORS, GEM_BANK1_READ_4(sc, GEM_MAC_RX_LEN_ERR_CNT) + GEM_BANK1_READ_4(sc, GEM_MAC_RX_ALIGN_ERR) + GEM_BANK1_READ_4(sc, GEM_MAC_RX_CRC_ERR_CNT) + - GEM_BANK1_READ_4(sc, GEM_MAC_RX_CODE_VIOL); + GEM_BANK1_READ_4(sc, GEM_MAC_RX_CODE_VIOL)); /* * Then clear the hardware counters. @@ -1485,7 +1485,7 @@ gem_tint(struct gem_softc *sc) STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); progress = 1; } @@ -1580,7 +1580,7 @@ gem_rint(struct gem_softc *sc) } if (rxstat & GEM_RD_BAD_CRC) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); device_printf(sc->sc_dev, "receive error: CRC error\n"); GEM_INIT_RXDESC(sc, sc->sc_rxptr); m = NULL; @@ -1606,7 +1606,7 @@ gem_rint(struct gem_softc *sc) * the buffer that's already attached to this descriptor. */ if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); GEM_INIT_RXDESC(sc, sc->sc_rxptr); m = NULL; } @@ -1634,7 +1634,7 @@ gem_rint(struct gem_softc *sc) continue; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_data += ETHER_ALIGN; /* first byte offset */ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = GEM_RD_BUFLEN(rxstat); @@ -1706,7 +1706,7 @@ static void gem_eint(struct gem_softc *sc, u_int status) { - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); if ((status & GEM_INTR_RX_TAG_ERR) != 0) { gem_reset_rxdma(sc); return; @@ -1784,7 +1784,7 @@ gem_intr(void *v) "MAC TX fault, status %x\n", status2); if ((status2 & (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) != 0) { - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; gem_init_locked(sc); } @@ -1798,7 +1798,7 @@ gem_intr(void *v) * likely that the receiver has hung so we reset it. */ if ((status2 & GEM_MAC_RX_OVERFLOW) != 0) { - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); gem_reset_rxdma(sc); } else if ((status2 & ~(GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT)) != 0) @@ -1835,7 +1835,7 @@ gem_watchdog(struct gem_softc *sc) device_printf(sc->sc_dev, "device timeout\n"); else if (bootverbose) device_printf(sc->sc_dev, "device timeout (no link)\n"); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* Try to get more packets going. */ ifp->if_drv_flags &= ~IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:23:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17E7FD5A; Thu, 18 Sep 2014 20:23:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBA32E9D; Thu, 18 Sep 2014 20:23:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKNY9o043400; Thu, 18 Sep 2014 20:23:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKNYLY043399; Thu, 18 Sep 2014 20:23:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182023.s8IKNYLY043399@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271812 - head/sys/dev/nge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:23:35 -0000 Author: glebius Date: Thu Sep 18 20:23:34 2014 New Revision: 271812 URL: http://svnweb.freebsd.org/changeset/base/271812 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/nge/if_nge.c Modified: head/sys/dev/nge/if_nge.c ============================================================================== --- head/sys/dev/nge/if_nge.c Thu Sep 18 20:21:46 2014 (r271811) +++ head/sys/dev/nge/if_nge.c Thu Sep 18 20:23:34 2014 (r271812) @@ -1476,7 +1476,7 @@ nge_rxeof(struct nge_softc *sc) if ((cmdsts & NGE_CMDSTS_MORE) != 0) { if (nge_newbuf(sc, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); if (sc->nge_head != NULL) { m_freem(sc->nge_head); sc->nge_head = sc->nge_tail = NULL; @@ -1526,7 +1526,7 @@ nge_rxeof(struct nge_softc *sc) /* Try conjure up a replacement mbuf. */ if (nge_newbuf(sc, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); if (sc->nge_head != NULL) { m_freem(sc->nge_head); sc->nge_head = sc->nge_tail = NULL; @@ -1563,7 +1563,7 @@ nge_rxeof(struct nge_softc *sc) nge_fixup_rx(m); #endif m->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { /* Do IP checksum checking. */ @@ -1650,15 +1650,15 @@ nge_txeof(struct nge_softc *sc) BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->nge_cdata.nge_tx_tag, txd->tx_dmamap); if ((cmdsts & NGE_CMDSTS_PKT_OK) == 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if ((cmdsts & NGE_TXSTAT_EXCESSCOLLS) != 0) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if ((cmdsts & NGE_TXSTAT_OUTOFWINCOLL) != 0) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } else - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - ifp->if_collisions += (cmdsts & NGE_TXSTAT_COLLCNT) >> 16; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (cmdsts & NGE_TXSTAT_COLLCNT) >> 16); KASSERT(txd->tx_m != NULL, ("%s: freeing NULL mbuf!\n", __func__)); m_freem(txd->tx_m); @@ -1730,8 +1730,9 @@ nge_stats_update(struct nge_softc *sc) /* * Since we've accept errored frames exclude Rx length errors. */ - ifp->if_ierrors += stats->rx_pkts_errs + stats->rx_crc_errs + - stats->rx_fifo_oflows + stats->rx_sym_errs; + if_inc_counter(ifp, IFCOUNTER_IERRORS, + stats->rx_pkts_errs + stats->rx_crc_errs + + stats->rx_fifo_oflows + stats->rx_sym_errs); nstats = &sc->nge_stats; nstats->rx_pkts_errs += stats->rx_pkts_errs; @@ -2435,7 +2436,7 @@ nge_watchdog(struct nge_softc *sc) return; ifp = sc->nge_ifp; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if_printf(ifp, "watchdog timeout\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:24:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E2CAEC7; Thu, 18 Sep 2014 20:24:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFBBEB1; Thu, 18 Sep 2014 20:24:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKOmv0043590; Thu, 18 Sep 2014 20:24:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKOmcU043588; Thu, 18 Sep 2014 20:24:48 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182024.s8IKOmcU043588@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271813 - head/sys/dev/pcn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:24:48 -0000 Author: glebius Date: Thu Sep 18 20:24:47 2014 New Revision: 271813 URL: http://svnweb.freebsd.org/changeset/base/271813 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/pcn/if_pcn.c Modified: head/sys/dev/pcn/if_pcn.c ============================================================================== --- head/sys/dev/pcn/if_pcn.c Thu Sep 18 20:23:34 2014 (r271812) +++ head/sys/dev/pcn/if_pcn.c Thu Sep 18 20:24:47 2014 (r271813) @@ -856,7 +856,7 @@ pcn_rxeof(sc) * comes up in the ring. */ if (cur_rx->pcn_rxstat & PCN_RXSTAT_ERR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); pcn_newbuf(sc, i, m); PCN_INC(i, PCN_RX_LIST_CNT); continue; @@ -865,7 +865,7 @@ pcn_rxeof(sc) if (pcn_newbuf(sc, i, NULL)) { /* Ran out of mbufs; recycle this one. */ pcn_newbuf(sc, i, m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); PCN_INC(i, PCN_RX_LIST_CNT); continue; } @@ -873,7 +873,7 @@ pcn_rxeof(sc) PCN_INC(i, PCN_RX_LIST_CNT); /* No errors; receive the packet. */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_len = m->m_pkthdr.len = cur_rx->pcn_rxlen - ETHER_CRC_LEN; m->m_pkthdr.rcvif = ifp; @@ -921,17 +921,17 @@ pcn_txeof(sc) } if (cur_tx->pcn_txctl & PCN_TXCTL_ERR) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (cur_tx->pcn_txstat & PCN_TXSTAT_EXDEF) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (cur_tx->pcn_txstat & PCN_TXSTAT_RTRY) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } - ifp->if_collisions += - cur_tx->pcn_txstat & PCN_TXSTAT_TRC; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + cur_tx->pcn_txstat & PCN_TXSTAT_TRC); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (sc->pcn_cdata.pcn_tx_chain[idx] != NULL) { m_freem(sc->pcn_cdata.pcn_tx_chain[idx]); sc->pcn_cdata.pcn_tx_chain[idx] = NULL; @@ -1436,7 +1436,7 @@ pcn_watchdog(struct pcn_softc *sc) PCN_LOCK_ASSERT(sc); ifp = sc->pcn_ifp; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if_printf(ifp, "watchdog timeout\n"); pcn_stop(sc); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:29:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DE532C4; Thu, 18 Sep 2014 20:29:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28B55EFE; Thu, 18 Sep 2014 20:29:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKTIgq044176; Thu, 18 Sep 2014 20:29:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKTIsj044175; Thu, 18 Sep 2014 20:29:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182029.s8IKTIsj044175@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271814 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:29:18 -0000 Author: glebius Date: Thu Sep 18 20:29:17 2014 New Revision: 271814 URL: http://svnweb.freebsd.org/changeset/base/271814 Log: Fix build on 32-bit machines. Pointy hat to: glebius Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu Sep 18 20:24:47 2014 (r271813) +++ head/sys/compat/linprocfs/linprocfs.c Thu Sep 18 20:29:17 2014 (r271814) @@ -1152,7 +1152,7 @@ linprocfs_donetdev(PFS_FILL_ARGS) 0UL, /* rx_compressed */ (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IMCASTS)); /* XXX-BZ rx only? */ - sbuf_printf(sb, "%8ju %7ju %4ju %4lu %4lu %5ju %7lu %10lu\n", + sbuf_printf(sb, "%8ju %7ju %4ju %4ju %4lu %5ju %7lu %10lu\n", (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OBYTES), (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS), (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OERRORS), From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:30:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DA62425; Thu, 18 Sep 2014 20:30:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D548F0E; Thu, 18 Sep 2014 20:30:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKUmvX044930; Thu, 18 Sep 2014 20:30:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKUmAw044929; Thu, 18 Sep 2014 20:30:48 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182030.s8IKUmAw044929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271815 - head/sys/dev/vge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:30:48 -0000 Author: glebius Date: Thu Sep 18 20:30:47 2014 New Revision: 271815 URL: http://svnweb.freebsd.org/changeset/base/271815 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Thu Sep 18 20:29:17 2014 (r271814) +++ head/sys/dev/vge/if_vge.c Thu Sep 18 20:30:47 2014 (r271815) @@ -1400,7 +1400,7 @@ vge_freebufs(struct vge_softc *sc) txd->tx_dmamap); m_freem(txd->tx_m); txd->tx_m = NULL; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } } } @@ -1467,7 +1467,7 @@ vge_rxeof(struct vge_softc *sc, int coun */ if ((rxstat & VGE_RXPKT_SOF) != 0) { if (vge_newbuf(sc, prod) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); VGE_CHAIN_RESET(sc); vge_discard_rxbuf(sc, prod); continue; @@ -1498,7 +1498,7 @@ vge_rxeof(struct vge_softc *sc, int coun if ((rxstat & VGE_RDSTS_RXOK) == 0 && (rxstat & (VGE_RDSTS_VIDM | VGE_RDSTS_RLERR | VGE_RDSTS_CSUMERR)) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); /* * If this is part of a multi-fragment packet, * discard all the pieces. @@ -1509,7 +1509,7 @@ vge_rxeof(struct vge_softc *sc, int coun } if (vge_newbuf(sc, prod) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); VGE_CHAIN_RESET(sc); vge_discard_rxbuf(sc, prod); continue; @@ -2380,7 +2380,7 @@ vge_watchdog(void *arg) ifp = sc->vge_ifp; if_printf(ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); vge_txeof(sc); vge_rxeof(sc, VGE_RX_DESC_CNT); @@ -2706,24 +2706,25 @@ reset_idx: stats->tx_latecolls += mib[VGE_MIB_TX_LATECOLLS]; /* Update counters in ifnet. */ - ifp->if_opackets += mib[VGE_MIB_TX_GOOD_FRAMES]; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, mib[VGE_MIB_TX_GOOD_FRAMES]); - ifp->if_collisions += mib[VGE_MIB_TX_COLLS] + - mib[VGE_MIB_TX_LATECOLLS]; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + mib[VGE_MIB_TX_COLLS] + mib[VGE_MIB_TX_LATECOLLS]); - ifp->if_oerrors += mib[VGE_MIB_TX_COLLS] + - mib[VGE_MIB_TX_LATECOLLS]; + if_inc_counter(ifp, IFCOUNTER_OERRORS, + mib[VGE_MIB_TX_COLLS] + mib[VGE_MIB_TX_LATECOLLS]); - ifp->if_ipackets += mib[VGE_MIB_RX_GOOD_FRAMES]; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, mib[VGE_MIB_RX_GOOD_FRAMES]); - ifp->if_ierrors += mib[VGE_MIB_RX_FIFO_OVERRUNS] + + if_inc_counter(ifp, IFCOUNTER_IERRORS, + mib[VGE_MIB_RX_FIFO_OVERRUNS] + mib[VGE_MIB_RX_RUNTS] + mib[VGE_MIB_RX_RUNTS_ERRS] + mib[VGE_MIB_RX_CRCERRS] + mib[VGE_MIB_RX_ALIGNERRS] + mib[VGE_MIB_RX_NOBUFS] + mib[VGE_MIB_RX_SYMERRS] + - mib[VGE_MIB_RX_LENERRS]; + mib[VGE_MIB_RX_LENERRS]); } static void From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:32:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5932266A; Thu, 18 Sep 2014 20:32:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F95DFA9; Thu, 18 Sep 2014 20:32:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKWhsb048198; Thu, 18 Sep 2014 20:32:43 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKWfjk048187; Thu, 18 Sep 2014 20:32:41 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409182032.s8IKWfjk048187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Thu, 18 Sep 2014 20: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: r271816 - in stable/10/sys: dev/drm2 dev/drm2/i915 modules/drm2/i915kms 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:32:43 -0000 Author: dumbbell Date: Thu Sep 18 20:32:40 2014 New Revision: 271816 URL: http://svnweb.freebsd.org/changeset/base/271816 Log: drm/i915: Add HW context support This feature is required by Mesa 9.2+. Without this, a GL application crashes with the following message: # glxinfo name of display: :0.0 Gen6+ requires Kernel 3.6 or later. Assertion failed: (ctx->Version > 0), function handle_first_current, file ../../src/mesa/main/context.c, line 1498. Abort (core dumped) Now, Mesa 10.2.4 and 10.3-rc3 works fine: # glxinfo name of display: :0 display: :0 screen: 0 direct rendering: Yes ... OpenGL renderer string: Mesa DRI Intel(R) 965GM OpenGL version string: 2.1 Mesa 10.2.4 ... The code was imported from Linux 3.8.13. This an MFC of r271705. Approved by: re (glebius) Reviewed by: kib@ Tested by: kwm@, danfe@, Henry Hu, Lundberg, Johannes , Johannes Dieterich , Lutz Bichler , Relnotes: yes Added: stable/10/sys/dev/drm2/i915/i915_gem_context.c - copied unchanged from r271705, head/sys/dev/drm2/i915/i915_gem_context.c Modified: stable/10/sys/dev/drm2/drm_gem_names.c stable/10/sys/dev/drm2/drm_gem_names.h stable/10/sys/dev/drm2/i915/i915_dma.c stable/10/sys/dev/drm2/i915/i915_drm.h stable/10/sys/dev/drm2/i915/i915_drv.c stable/10/sys/dev/drm2/i915/i915_drv.h stable/10/sys/dev/drm2/i915/i915_gem.c stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c stable/10/sys/dev/drm2/i915/i915_gem_gtt.c stable/10/sys/dev/drm2/i915/i915_irq.c stable/10/sys/dev/drm2/i915/i915_reg.h stable/10/sys/dev/drm2/i915/intel_ringbuffer.c stable/10/sys/dev/drm2/i915/intel_ringbuffer.h stable/10/sys/modules/drm2/i915kms/Makefile stable/10/sys/sys/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_gem_names.c ============================================================================== --- stable/10/sys/dev/drm2/drm_gem_names.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/drm_gem_names.c Thu Sep 18 20:32:40 2014 (r271816) @@ -127,6 +127,24 @@ drm_gem_find_name(struct drm_gem_names * return (arg.res); } +void * +drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name) +{ + struct drm_gem_name *n; + void *res; + + mtx_lock(&names->lock); + LIST_FOREACH(n, gem_name_hash_index(names, name), link) { + if (n->name == name) { + res = n->ptr; + mtx_unlock(&names->lock); + return (res); + } + } + mtx_unlock(&names->lock); + return (NULL); +} + int drm_gem_name_create(struct drm_gem_names *names, void *p, uint32_t *name) { Modified: stable/10/sys/dev/drm2/drm_gem_names.h ============================================================================== --- stable/10/sys/dev/drm2/drm_gem_names.h Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/drm_gem_names.h Thu Sep 18 20:32:40 2014 (r271816) @@ -54,6 +54,7 @@ struct drm_gem_names { void drm_gem_names_init(struct drm_gem_names *names); void drm_gem_names_fini(struct drm_gem_names *names); uint32_t drm_gem_find_name(struct drm_gem_names *names, void *ptr); +void *drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name); void *drm_gem_name_ref(struct drm_gem_names *names, uint32_t name, void (*ref)(void *)); int drm_gem_name_create(struct drm_gem_names *names, void *obj, uint32_t *name); Modified: stable/10/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_dma.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_dma.c Thu Sep 18 20:32:40 2014 (r271816) @@ -1357,6 +1357,7 @@ i915_driver_unload_int(struct drm_device DRM_LOCK(dev); i915_gem_free_all_phys_object(dev); i915_gem_cleanup_ringbuffer(dev); + i915_gem_context_fini(dev); if (!locked) DRM_UNLOCK(dev); i915_gem_cleanup_aliasing_ppgtt(dev); @@ -1413,6 +1414,8 @@ i915_driver_open(struct drm_device *dev, INIT_LIST_HEAD(&i915_file_priv->mm.request_list); file_priv->driver_priv = i915_file_priv; + drm_gem_names_init(&i915_file_priv->context_idr); + return (0); } @@ -1437,6 +1440,7 @@ i915_driver_lastclose(struct drm_device void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) { + i915_gem_context_close(dev, file_priv); i915_gem_release(dev, file_priv); } @@ -1491,6 +1495,8 @@ struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF(DRM_I915_OVERLAY_ATTRS, intel_overlay_attrs, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_I915_SET_SPRITE_COLORKEY, intel_sprite_set_colorkey, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_I915_GET_SPRITE_COLORKEY, intel_sprite_get_colorkey, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_I915_GEM_CONTEXT_CREATE, i915_gem_context_create_ioctl, DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_I915_GEM_CONTEXT_DESTROY, i915_gem_context_destroy_ioctl, DRM_UNLOCKED), }; #ifdef COMPAT_FREEBSD32 Modified: stable/10/sys/dev/drm2/i915/i915_drm.h ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drm.h Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_drm.h Thu Sep 18 20:32:40 2014 (r271816) @@ -204,6 +204,8 @@ typedef struct drm_i915_sarea { #define DRM_I915_GEM_EXECBUFFER2 0x29 #define DRM_I915_GET_SPRITE_COLORKEY 0x2a #define DRM_I915_SET_SPRITE_COLORKEY 0x2b +#define DRM_I915_GEM_CONTEXT_CREATE 0x2d +#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) @@ -248,6 +250,8 @@ typedef struct drm_i915_sarea { #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) +#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) +#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) /* Asynchronous page flipping: */ @@ -702,7 +706,7 @@ struct drm_i915_gem_exec_object2 { #define EXEC_OBJECT_NEEDS_FENCE (1<<0) uint64_t flags; - uint64_t rsvd1; + uint64_t rsvd1; /* now used for context info */ uint64_t rsvd2; }; @@ -746,6 +750,12 @@ struct drm_i915_gem_execbuffer2 { /** Resets the SO write offset registers for transform feedback on gen7. */ #define I915_EXEC_GEN7_SOL_RESET (1<<8) +#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) +#define i915_execbuffer2_set_context_id(eb2, context) \ + (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK +#define i915_execbuffer2_get_context_id(eb2) \ + ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK) + struct drm_i915_gem_pin { /** Handle of the buffer to be pinned. */ uint32_t handle; @@ -968,4 +978,15 @@ struct drm_intel_sprite_colorkey { uint32_t flags; }; +struct drm_i915_gem_context_create { + /* output: id of new context*/ + uint32_t ctx_id; + uint32_t pad; +}; + +struct drm_i915_gem_context_destroy { + uint32_t ctx_id; + uint32_t pad; +}; + #endif /* _I915_DRM_H_ */ Modified: stable/10/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drv.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_drv.c Thu Sep 18 20:32:40 2014 (r271816) @@ -612,7 +612,7 @@ __gen6_gt_wait_for_fifo(struct drm_i915_ } static int -i8xx_do_reset(struct drm_device *dev, u8 flags) +i8xx_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; int onems; @@ -657,7 +657,7 @@ i965_reset_complete(struct drm_device *d } static int -i965_do_reset(struct drm_device *dev, u8 flags) +i965_do_reset(struct drm_device *dev) { u8 gdrst; @@ -667,28 +667,30 @@ i965_do_reset(struct drm_device *dev, u8 * triggers the reset; when done, the hardware will clear it. */ gdrst = pci_read_config(dev->device, I965_GDRST, 1); - pci_write_config(dev->device, I965_GDRST, gdrst | flags | 0x1, 1); + pci_write_config(dev->device, I965_GDRST, + gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE, 1); return (_intel_wait_for(dev, i965_reset_complete(dev), 500, 1, "915rst")); } static int -ironlake_do_reset(struct drm_device *dev, u8 flags) +ironlake_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv; u32 gdrst; dev_priv = dev->dev_private; gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); - I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, gdrst | flags | 0x1); + I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, + gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE); return (_intel_wait_for(dev, (I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1) != 0, 500, 1, "915rst")); } static int -gen6_do_reset(struct drm_device *dev, u8 flags) +gen6_do_reset(struct drm_device *dev) { struct drm_i915_private *dev_priv; int ret; @@ -726,8 +728,43 @@ gen6_do_reset(struct drm_device *dev, u8 return (ret); } +int intel_gpu_reset(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret = -ENODEV; + + switch (INTEL_INFO(dev)->gen) { + case 7: + case 6: + ret = gen6_do_reset(dev); + break; + case 5: + ret = ironlake_do_reset(dev); + break; + case 4: + ret = i965_do_reset(dev); + break; + case 2: + ret = i8xx_do_reset(dev); + break; + } + + /* Also reset the gpu hangman. */ + if (dev_priv->stop_rings) { + DRM_DEBUG("Simulated gpu hang, resetting stop_rings\n"); + dev_priv->stop_rings = 0; + if (ret == -ENODEV) { + DRM_ERROR("Reset not implemented, but ignoring " + "error for simulated gpu hangs\n"); + ret = 0; + } + } + + return ret; +} + int -i915_reset(struct drm_device *dev, u8 flags) +i915_reset(struct drm_device *dev) { drm_i915_private_t *dev_priv = dev->dev_private; /* @@ -748,23 +785,9 @@ i915_reset(struct drm_device *dev, u8 fl ret = -ENODEV; if (time_second - dev_priv->last_gpu_reset < 5) { DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); - } else { - switch (INTEL_INFO(dev)->gen) { - case 7: - case 6: - ret = gen6_do_reset(dev, flags); - break; - case 5: - ret = ironlake_do_reset(dev, flags); - break; - case 4: - ret = i965_do_reset(dev, flags); - break; - case 2: - ret = i8xx_do_reset(dev, flags); - break; - } - } + } else + ret = intel_gpu_reset(dev); + dev_priv->last_gpu_reset = time_second; if (ret) { DRM_ERROR("Failed to reset chip.\n"); @@ -784,6 +807,7 @@ i915_reset(struct drm_device *dev, u8 fl if (HAS_BLT(dev)) dev_priv->rings[BCS].init(&dev_priv->rings[BCS]); + i915_gem_context_init(dev); i915_gem_init_ppgtt(dev); drm_irq_uninstall(dev); Modified: stable/10/sys/dev/drm2/i915/i915_drv.h ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drv.h Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_drv.h Thu Sep 18 20:32:40 2014 (r271816) @@ -174,6 +174,17 @@ struct i915_hw_ppgtt { vm_paddr_t scratch_page_dma_addr; }; + +/* This must match up with the value previously used for execbuf2.rsvd1. */ +#define DEFAULT_CONTEXT_ID 0 +struct i915_hw_context { + uint32_t id; + bool is_initialized; + struct drm_i915_file_private *file_priv; + struct intel_ring_buffer *ring; + struct drm_i915_gem_object *obj; +}; + enum no_fbc_reason { FBC_NO_OUTPUT, /* no outputs enabled to compress */ FBC_STOLEN_TOO_SMALL, /* not enough space to hold compressed buffers */ @@ -700,6 +711,8 @@ typedef struct drm_i915_private { enum no_fbc_reason no_fbc_reason; + unsigned int stop_rings; + unsigned long cfb_size; unsigned int cfb_fb; int cfb_plane; @@ -723,8 +736,16 @@ typedef struct drm_i915_private { struct drm_property *broadcast_rgb_property; struct drm_property *force_audio_property; + + bool hw_contexts_disabled; + uint32_t hw_context_size; } drm_i915_private_t; +/* Iterate over initialised rings */ +#define for_each_ring(ring__, dev_priv__, i__) \ + for ((i__) = 0; (i__) < I915_NUM_RINGS; (i__)++) \ + if (((ring__) = &(dev_priv__)->rings[(i__)]), intel_ring_initialized((ring__))) + enum hdmi_force_audio { HDMI_AUDIO_OFF_DVI = -2, /* no aux data for HDMI-DVI converter */ HDMI_AUDIO_OFF, /* force turn off HDMI audio */ @@ -832,6 +853,7 @@ struct drm_i915_gem_object { unsigned int cache_level:2; unsigned int has_aliasing_ppgtt_mapping:1; + unsigned int has_global_gtt_mapping:1; vm_page_t *pages; @@ -927,6 +949,7 @@ struct drm_i915_file_private { struct list_head request_list; struct mtx lck; } mm; + struct drm_gem_names context_idr; }; struct drm_i915_error_state { @@ -1026,7 +1049,8 @@ extern int i915_enable_hangcheck; const struct intel_device_info *i915_get_device_id(int device); -int i915_reset(struct drm_device *dev, u8 flags); +extern int intel_gpu_reset(struct drm_device *dev); +int i915_reset(struct drm_device *dev); /* i915_debug.c */ int i915_sysctl_init(struct drm_device *dev, struct sysctl_ctx_list *ctx, @@ -1205,6 +1229,17 @@ void i915_gem_release(struct drm_device int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj, enum i915_cache_level cache_level); +/* i915_gem_context.c */ +void i915_gem_context_init(struct drm_device *dev); +void i915_gem_context_fini(struct drm_device *dev); +void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); +int i915_switch_context(struct intel_ring_buffer *ring, + struct drm_file *file, int to_id); +int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, + struct drm_file *file); +int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, + struct drm_file *file); + void i915_gem_free_all_phys_object(struct drm_device *dev); void i915_gem_detach_phys_object(struct drm_device *dev, struct drm_i915_gem_object *obj); @@ -1443,6 +1478,7 @@ __i915_write(64, 64) #define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc) #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) +#define HAS_HW_CONTEXTS(dev) (INTEL_INFO(dev)->gen >= 6) #define HAS_ALIASING_PPGTT(dev) (INTEL_INFO(dev)->gen >=6) #define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay) Modified: stable/10/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_gem.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_gem.c Thu Sep 18 20:32:40 2014 (r271816) @@ -477,6 +477,7 @@ i915_gem_init_hw(struct drm_device *dev) } dev_priv->next_seqno = 1; + i915_gem_context_init(dev); i915_gem_init_ppgtt(dev); return (0); @@ -2584,11 +2585,16 @@ int i915_gpu_idle(struct drm_device *dev, bool do_retire) { drm_i915_private_t *dev_priv = dev->dev_private; + struct intel_ring_buffer *ring; int ret, i; /* Flush everything onto the inactive list. */ - for (i = 0; i < I915_NUM_RINGS; i++) { - ret = i915_ring_idle(&dev_priv->rings[i], do_retire); + for_each_ring(ring, dev_priv, i) { + ret = i915_switch_context(ring, NULL, DEFAULT_CONTEXT_ID); + if (ret) + return ret; + + ret = i915_ring_idle(ring, do_retire); if (ret) return ret; } Copied: stable/10/sys/dev/drm2/i915/i915_gem_context.c (from r271705, head/sys/dev/drm2/i915/i915_gem_context.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/drm2/i915/i915_gem_context.c Thu Sep 18 20:32:40 2014 (r271816, copy of r271705, head/sys/dev/drm2/i915/i915_gem_context.c) @@ -0,0 +1,549 @@ +/* + * Copyright © 2011-2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Ben Widawsky + * + */ + +/* + * This file implements HW context support. On gen5+ a HW context consists of an + * opaque GPU object which is referenced at times of context saves and restores. + * With RC6 enabled, the context is also referenced as the GPU enters and exists + * from RC6 (GPU has it's own internal power context, except on gen5). Though + * something like a context does exist for the media ring, the code only + * supports contexts for the render ring. + * + * In software, there is a distinction between contexts created by the user, + * and the default HW context. The default HW context is used by GPU clients + * that do not request setup of their own hardware context. The default + * context's state is never restored to help prevent programming errors. This + * would happen if a client ran and piggy-backed off another clients GPU state. + * The default context only exists to give the GPU some offset to load as the + * current to invoke a save of the context we actually care about. In fact, the + * code could likely be constructed, albeit in a more complicated fashion, to + * never use the default context, though that limits the driver's ability to + * swap out, and/or destroy other contexts. + * + * All other contexts are created as a request by the GPU client. These contexts + * store GPU state, and thus allow GPU clients to not re-emit state (and + * potentially query certain state) at any time. The kernel driver makes + * certain that the appropriate commands are inserted. + * + * The context life cycle is semi-complicated in that context BOs may live + * longer than the context itself because of the way the hardware, and object + * tracking works. Below is a very crude representation of the state machine + * describing the context life. + * refcount pincount active + * S0: initial state 0 0 0 + * S1: context created 1 0 0 + * S2: context is currently running 2 1 X + * S3: GPU referenced, but not current 2 0 1 + * S4: context is current, but destroyed 1 1 0 + * S5: like S3, but destroyed 1 0 1 + * + * The most common (but not all) transitions: + * S0->S1: client creates a context + * S1->S2: client submits execbuf with context + * S2->S3: other clients submits execbuf with context + * S3->S1: context object was retired + * S3->S2: clients submits another execbuf + * S2->S4: context destroy called with current context + * S3->S5->S0: destroy path + * S4->S5->S0: destroy path on current context + * + * There are two confusing terms used above: + * The "current context" means the context which is currently running on the + * GPU. The GPU has loaded it's state already and has stored away the gtt + * offset of the BO. The GPU is not actively referencing the data at this + * offset, but it will on the next context switch. The only way to avoid this + * is to do a GPU reset. + * + * An "active context' is one which was previously the "current context" and is + * on the active list waiting for the next context switch to occur. Until this + * happens, the object must remain at the same gtt offset. It is therefore + * possible to destroy a context, but it is still active. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "i915_drv.h" + +/* This is a HW constraint. The value below is the largest known requirement + * I've seen in a spec to date, and that was a workaround for a non-shipping + * part. It should be safe to decrease this, but it's more future proof as is. + */ +#define CONTEXT_ALIGN (64<<10) + +static struct i915_hw_context * +i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id); +static int do_switch(struct i915_hw_context *to); + +static int get_context_size(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret; + u32 reg; + + switch (INTEL_INFO(dev)->gen) { + case 6: + reg = I915_READ(CXT_SIZE); + ret = GEN6_CXT_TOTAL_SIZE(reg) * 64; + break; + case 7: + reg = I915_READ(GEN7_CXT_SIZE); +#ifdef FREEBSD_WIP + if (IS_HASWELL(dev)) + ret = HSW_CXT_TOTAL_SIZE(reg) * 64; + else +#endif + ret = GEN7_CXT_TOTAL_SIZE(reg) * 64; + break; + default: + panic("i915_gem_context: Unsupported Intel GPU generation %d", + INTEL_INFO(dev)->gen); + } + + return ret; +} + +static void do_destroy(struct i915_hw_context *ctx) +{ +#if defined(INVARIANTS) + struct drm_device *dev = ctx->obj->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; +#endif + + if (ctx->file_priv) + drm_gem_names_remove(&ctx->file_priv->context_idr, ctx->id); + else + KASSERT(ctx == dev_priv->rings[RCS].default_context, + ("i915_gem_context: ctx != default_context")); + + drm_gem_object_unreference(&ctx->obj->base); + free(ctx, DRM_I915_GEM); +} + +static int +create_hw_context(struct drm_device *dev, + struct drm_i915_file_private *file_priv, + struct i915_hw_context **ret_ctx) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + struct i915_hw_context *ctx; + int ret, id; + + ctx = malloc(sizeof(*ctx), DRM_I915_GEM, M_NOWAIT | M_ZERO); + if (ctx == NULL) + return (-ENOMEM); + + ctx->obj = i915_gem_alloc_object(dev, dev_priv->hw_context_size); + if (ctx->obj == NULL) { + free(ctx, DRM_I915_GEM); + DRM_DEBUG_DRIVER("Context object allocated failed\n"); + return (-ENOMEM); + } + + if (INTEL_INFO(dev)->gen >= 7) { + ret = i915_gem_object_set_cache_level(ctx->obj, + I915_CACHE_LLC_MLC); + if (ret) + goto err_out; + } + + /* The ring associated with the context object is handled by the normal + * object tracking code. We give an initial ring value simple to pass an + * assertion in the context switch code. + */ + ctx->ring = &dev_priv->rings[RCS]; + + /* Default context will never have a file_priv */ + if (file_priv == NULL) { + *ret_ctx = ctx; + return (0); + } + + ctx->file_priv = file_priv; + +again: + id = 0; + ret = drm_gem_name_create(&file_priv->context_idr, ctx, &id); + if (ret == 0) + ctx->id = id; + + if (ret == -EAGAIN) + goto again; + else if (ret) + goto err_out; + + *ret_ctx = ctx; + return (0); + +err_out: + do_destroy(ctx); + return (ret); +} + +static inline bool is_default_context(struct i915_hw_context *ctx) +{ + return (ctx == ctx->ring->default_context); +} + +/** + * The default context needs to exist per ring that uses contexts. It stores the + * context state of the GPU for applications that don't utilize HW contexts, as + * well as an idle case. + */ +static int create_default_context(struct drm_i915_private *dev_priv) +{ + struct i915_hw_context *ctx; + int ret; + + DRM_LOCK_ASSERT(dev_priv->dev); + + ret = create_hw_context(dev_priv->dev, NULL, &ctx); + if (ret != 0) + return (ret); + + /* We may need to do things with the shrinker which require us to + * immediately switch back to the default context. This can cause a + * problem as pinning the default context also requires GTT space which + * may not be available. To avoid this we always pin the + * default context. + */ + dev_priv->rings[RCS].default_context = ctx; + ret = i915_gem_object_pin(ctx->obj, CONTEXT_ALIGN, false); + if (ret) + goto err_destroy; + + ret = do_switch(ctx); + if (ret) + goto err_unpin; + + DRM_DEBUG_DRIVER("Default HW context loaded\n"); + return 0; + +err_unpin: + i915_gem_object_unpin(ctx->obj); +err_destroy: + do_destroy(ctx); + return ret; +} + +void i915_gem_context_init(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + uint32_t ctx_size; + + if (!HAS_HW_CONTEXTS(dev)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + /* If called from reset, or thaw... we've been here already */ + if (dev_priv->hw_contexts_disabled || + dev_priv->rings[RCS].default_context) + return; + + ctx_size = get_context_size(dev); + dev_priv->hw_context_size = get_context_size(dev); + dev_priv->hw_context_size = roundup(dev_priv->hw_context_size, 4096); + + if (ctx_size <= 0 || ctx_size > (1<<20)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + if (create_default_context(dev_priv)) { + dev_priv->hw_contexts_disabled = true; + return; + } + + DRM_DEBUG_DRIVER("HW context support initialized\n"); +} + +void i915_gem_context_fini(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + if (dev_priv->hw_contexts_disabled) + return; + + /* The only known way to stop the gpu from accessing the hw context is + * to reset it. Do this as the very last operation to avoid confusing + * other code, leading to spurious errors. */ + intel_gpu_reset(dev); + + i915_gem_object_unpin(dev_priv->rings[RCS].default_context->obj); + + do_destroy(dev_priv->rings[RCS].default_context); +} + +static int context_idr_cleanup(uint32_t id, void *p, void *data) +{ + struct i915_hw_context *ctx = p; + + KASSERT(id != DEFAULT_CONTEXT_ID, ("i915_gem_context: id == DEFAULT_CONTEXT_ID in cleanup")); + + do_destroy(ctx); + + return 0; +} + +void i915_gem_context_close(struct drm_device *dev, struct drm_file *file) +{ + struct drm_i915_file_private *file_priv = file->driver_priv; + + //DRM_LOCK(dev); /* Called from preclose(), the lock is already owned. */ + drm_gem_names_foreach(&file_priv->context_idr, context_idr_cleanup, NULL); + drm_gem_names_fini(&file_priv->context_idr); + //DRM_UNLOCK(dev); +} + +static struct i915_hw_context * +i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id) +{ + return (struct i915_hw_context *)drm_gem_find_ptr(&file_priv->context_idr, id); +} + +static inline int +mi_set_context(struct intel_ring_buffer *ring, + struct i915_hw_context *new_context, + u32 hw_flags) +{ + int ret; + + /* w/a: If Flush TLB Invalidation Mode is enabled, driver must do a TLB + * invalidation prior to MI_SET_CONTEXT. On GEN6 we don't set the value + * explicitly, so we rely on the value at ring init, stored in + * itlb_before_ctx_switch. + */ + if (IS_GEN6(ring->dev) && ring->itlb_before_ctx_switch) { + ret = ring->flush(ring, I915_GEM_GPU_DOMAINS, 0); + if (ret) + return ret; + } + + ret = intel_ring_begin(ring, 6); + if (ret) + return ret; + + if (IS_GEN7(ring->dev)) + intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_DISABLE); + else + intel_ring_emit(ring, MI_NOOP); + + intel_ring_emit(ring, MI_NOOP); + intel_ring_emit(ring, MI_SET_CONTEXT); + intel_ring_emit(ring, new_context->obj->gtt_offset | + MI_MM_SPACE_GTT | + MI_SAVE_EXT_STATE_EN | + MI_RESTORE_EXT_STATE_EN | + hw_flags); + /* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */ + intel_ring_emit(ring, MI_NOOP); + + if (IS_GEN7(ring->dev)) + intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_ENABLE); + else + intel_ring_emit(ring, MI_NOOP); + + intel_ring_advance(ring); + + return ret; +} + +static int do_switch(struct i915_hw_context *to) +{ + struct intel_ring_buffer *ring = to->ring; + struct drm_i915_gem_object *from_obj = ring->last_context_obj; + u32 hw_flags = 0; + int ret; + + KASSERT(!(from_obj != NULL && from_obj->pin_count == 0), + ("i915_gem_context: invalid \"from\" context")); + + if (from_obj == to->obj) + return 0; + + ret = i915_gem_object_pin(to->obj, CONTEXT_ALIGN, false); + if (ret) + return ret; + + /* Clear this page out of any CPU caches for coherent swap-in/out. Note + * that thanks to write = false in this call and us not setting any gpu + * write domains when putting a context object onto the active list + * (when switching away from it), this won't block. + * XXX: We need a real interface to do this instead of trickery. */ + ret = i915_gem_object_set_to_gtt_domain(to->obj, false); + if (ret) { + i915_gem_object_unpin(to->obj); + return ret; + } + + if (!to->obj->has_global_gtt_mapping) + i915_gem_gtt_bind_object(to->obj); + + if (!to->is_initialized || is_default_context(to)) + hw_flags |= MI_RESTORE_INHIBIT; + else if (from_obj == to->obj) /* not yet expected */ + hw_flags |= MI_FORCE_RESTORE; + + ret = mi_set_context(ring, to, hw_flags); + if (ret) { + i915_gem_object_unpin(to->obj); + return ret; + } + + /* The backing object for the context is done after switching to the + * *next* context. Therefore we cannot retire the previous context until + * the next context has already started running. In fact, the below code + * is a bit suboptimal because the retiring can occur simply after the + * MI_SET_CONTEXT instead of when the next seqno has completed. + */ + if (from_obj != NULL) { + from_obj->base.read_domains = I915_GEM_DOMAIN_INSTRUCTION; + i915_gem_object_move_to_active(from_obj, ring, + i915_gem_next_request_seqno(ring)); + /* As long as MI_SET_CONTEXT is serializing, ie. it flushes the + * whole damn pipeline, we don't need to explicitly mark the + * object dirty. The only exception is that the context must be + * correct in case the object gets swapped out. Ideally we'd be + * able to defer doing this until we know the object would be + * swapped, but there is no way to do that yet. + */ + from_obj->dirty = 1; + KASSERT(from_obj->ring == ring, ("i915_gem_context: from_ring != ring")); + i915_gem_object_unpin(from_obj); + + drm_gem_object_unreference(&from_obj->base); + } + + drm_gem_object_reference(&to->obj->base); + ring->last_context_obj = to->obj; + to->is_initialized = true; + + return 0; +} + +/** + * i915_switch_context() - perform a GPU context switch. + * @ring: ring for which we'll execute the context switch + * @file_priv: file_priv associated with the context, may be NULL + * @id: context id number + * @seqno: sequence number by which the new context will be switched to + * @flags: + * + * The context life cycle is simple. The context refcount is incremented and + * decremented by 1 and create and destroy. If the context is in use by the GPU, + * it will have a refoucnt > 1. This allows us to destroy the context abstract + * object while letting the normal object tracking destroy the backing BO. + */ +int i915_switch_context(struct intel_ring_buffer *ring, + struct drm_file *file, + int to_id) +{ + struct drm_i915_private *dev_priv = ring->dev->dev_private; + struct i915_hw_context *to; + + if (dev_priv->hw_contexts_disabled) + return 0; + + if (ring != &dev_priv->rings[RCS]) + return 0; + + if (to_id == DEFAULT_CONTEXT_ID) { + to = ring->default_context; + } else { + if (file == NULL) + return -EINVAL; + + to = i915_gem_context_get(file->driver_priv, to_id); + if (to == NULL) + return -ENOENT; + } + + return do_switch(to); +} + +int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_i915_gem_context_create *args = data; + struct drm_i915_file_private *file_priv = file->driver_priv; + struct i915_hw_context *ctx; + int ret; + + if (!(dev->driver->driver_features & DRIVER_GEM)) + return -ENODEV; + + if (dev_priv->hw_contexts_disabled) + return -ENODEV; + + ret = i915_mutex_lock_interruptible(dev); + if (ret) + return ret; + + ret = create_hw_context(dev, file_priv, &ctx); + DRM_UNLOCK(dev); + if (ret != 0) + return (ret); + + args->ctx_id = ctx->id; + DRM_DEBUG_DRIVER("HW context %d created\n", args->ctx_id); + + return 0; +} + +int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct drm_i915_gem_context_destroy *args = data; + struct drm_i915_file_private *file_priv = file->driver_priv; + struct i915_hw_context *ctx; + int ret; + + if (!(dev->driver->driver_features & DRIVER_GEM)) + return -ENODEV; + + ret = i915_mutex_lock_interruptible(dev); + if (ret) + return ret; + + ctx = i915_gem_context_get(file_priv, args->ctx_id); + if (!ctx) { + DRM_UNLOCK(dev); + return -ENOENT; + } + + do_destroy(ctx); + + DRM_UNLOCK(dev); + + DRM_DEBUG_DRIVER("HW context %d destroyed\n", args->ctx_id); + return 0; +} Modified: stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c Thu Sep 18 20:32:40 2014 (r271816) @@ -1130,6 +1130,7 @@ i915_gem_do_execbuffer(struct drm_device struct drm_clip_rect *cliprects = NULL; struct intel_ring_buffer *ring; vm_page_t **relocs_ma; + u32 ctx_id = i915_execbuffer2_get_context_id(*args); u32 exec_start, exec_len; u32 seqno; u32 mask; @@ -1158,6 +1159,11 @@ i915_gem_do_execbuffer(struct drm_device return -EINVAL; } ring = &dev_priv->rings[VCS]; + if (ctx_id != 0) { + DRM_DEBUG("Ring %s doesn't support contexts\n", + ring->name); + return -EPERM; + } break; case I915_EXEC_BLT: if (!HAS_BLT(dev)) { @@ -1165,6 +1171,11 @@ i915_gem_do_execbuffer(struct drm_device return -EINVAL; } ring = &dev_priv->rings[BCS]; + if (ctx_id != 0) { + DRM_DEBUG("Ring %s doesn't support contexts\n", + ring->name); + return -EPERM; + } break; default: DRM_DEBUG("execbuf with unknown ring: %d\n", @@ -1306,6 +1317,10 @@ i915_gem_do_execbuffer(struct drm_device if (ret) goto err; + ret = i915_switch_context(ring, file, ctx_id); + if (ret) + goto err; + seqno = i915_gem_next_request_seqno(ring); for (i = 0; i < I915_NUM_RINGS - 1; i++) { if (seqno < ring->sync_seqno[i]) { @@ -1461,6 +1476,7 @@ i915_gem_execbuffer(struct drm_device *d exec2.num_cliprects = args->num_cliprects; exec2.cliprects_ptr = args->cliprects_ptr; exec2.flags = I915_EXEC_RENDER; + i915_execbuffer2_set_context_id(exec2, 0); ret = i915_gem_do_execbuffer(dev, data, file, &exec2, exec2_list); if (!ret) { Modified: stable/10/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_gem_gtt.c Thu Sep 18 20:30:47 2014 (r271815) +++ stable/10/sys/dev/drm2/i915/i915_gem_gtt.c Thu Sep 18 20:32:40 2014 (r271816) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:33:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6500898; Thu, 18 Sep 2014 20:33:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87387FB5; Thu, 18 Sep 2014 20:33:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKXPmA048523; Thu, 18 Sep 2014 20:33:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKXPpl048522; Thu, 18 Sep 2014 20:33:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182033.s8IKXPpl048522@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271817 - head/sys/dev/smc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:33:25 -0000 Author: glebius Date: Thu Sep 18 20:33:25 2014 New Revision: 271817 URL: http://svnweb.freebsd.org/changeset/base/271817 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/smc/if_smc.c Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Thu Sep 18 20:32:40 2014 (r271816) +++ head/sys/dev/smc/if_smc.c Thu Sep 18 20:33:25 2014 (r271817) @@ -512,7 +512,7 @@ smc_start_locked(struct ifnet *ifp) len += (len & 1); if (len > ETHER_MAX_LEN - ETHER_CRC_LEN) { if_printf(ifp, "large packet discarded\n"); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return; /* XXX readcheck? */ } @@ -598,7 +598,7 @@ smc_task_tx(void *context, int pending) */ if (packet & ARR_FAILED) { IFQ_DRV_PREPEND(&ifp->if_snd, m); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; smc_start_locked(ifp); SMC_UNLOCK(sc); @@ -655,7 +655,7 @@ smc_task_tx(void *context, int pending) /* * Finish up. */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; SMC_UNLOCK(sc); BPF_MTAP(ifp, m0); @@ -721,7 +721,7 @@ smc_task_rx(void *context, int pending) if (status & (RX_TOOSHORT | RX_TOOLNG | RX_BADCRC | RX_ALGNERR)) { smc_mmu_wait(sc); smc_write_2(sc, MMUCR, MMUCR_CMD_RELEASE); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); break; } @@ -777,7 +777,7 @@ smc_task_rx(void *context, int pending) m = mhead; mhead = mhead->m_next; m->m_next = NULL; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } } @@ -892,7 +892,7 @@ smc_task_intr(void *context, int pending */ if (status & RX_OVRN_INT) { smc_write_1(sc, ACK, RX_OVRN_INT); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } /* @@ -909,10 +909,9 @@ smc_task_intr(void *context, int pending smc_select_bank(sc, 0); counter = smc_read_2(sc, ECR); smc_select_bank(sc, 2); - ifp->if_collisions += - (counter & ECR_SNGLCOL_MASK) >> ECR_SNGLCOL_SHIFT; - ifp->if_collisions += - (counter & ECR_MULCOL_MASK) >> ECR_MULCOL_SHIFT; + if_inc_counter(ifp, IFNET_COLLISIONS, + ((counter & ECR_SNGLCOL_MASK) >> ECR_SNGLCOL_SHIFT) + + ((counter & ECR_MULCOL_MASK) >> ECR_MULCOL_SHIFT)); /* * See if there are any packets to transmit. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:35:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 114E8AB2; Thu, 18 Sep 2014 20:35:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F067AFD5; Thu, 18 Sep 2014 20:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKZMGY048863; Thu, 18 Sep 2014 20:35:22 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKZMsL048862; Thu, 18 Sep 2014 20:35:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182035.s8IKZMsL048862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271818 - head/sys/dev/xl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:35:23 -0000 Author: glebius Date: Thu Sep 18 20:35:22 2014 New Revision: 271818 URL: http://svnweb.freebsd.org/changeset/base/271818 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Thu Sep 18 20:33:25 2014 (r271817) +++ head/sys/dev/xl/if_xl.c Thu Sep 18 20:35:22 2014 (r271818) @@ -1866,7 +1866,7 @@ again: * comes up in the ring. */ if (rxstat & XL_RXSTAT_UP_ERROR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->xl_ptr->xl_status = 0; bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); @@ -1881,7 +1881,7 @@ again: if (!(rxstat & XL_RXSTAT_UP_CMPLT)) { device_printf(sc->xl_dev, "bad receive status -- packet dropped\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->xl_ptr->xl_status = 0; bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); @@ -1901,7 +1901,7 @@ again: * can do in this situation. */ if (xl_newbuf(sc, cur_rx)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->xl_ptr->xl_status = 0; bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); @@ -1910,7 +1910,7 @@ again: bus_dmamap_sync(sc->xl_ldata.xl_rx_tag, sc->xl_ldata.xl_rx_dmamap, BUS_DMASYNC_PREWRITE); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = total_len; @@ -2014,7 +2014,7 @@ xl_txeof(struct xl_softc *sc) bus_dmamap_unload(sc->xl_mtag, cur_tx->xl_map); m_freem(cur_tx->xl_mbuf); cur_tx->xl_mbuf = NULL; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; cur_tx->xl_next = sc->xl_cdata.xl_tx_free; @@ -2061,7 +2061,7 @@ xl_txeof_90xB(struct xl_softc *sc) cur_tx->xl_mbuf = NULL; } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->xl_cdata.xl_tx_cnt--; XL_INC(idx, XL_TX_LIST_CNT); @@ -2185,7 +2185,7 @@ xl_intr(void *arg) } if (status & XL_STAT_TX_COMPLETE) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); xl_txeoc(sc); } @@ -2255,7 +2255,7 @@ xl_poll_locked(struct ifnet *ifp, enum p XL_CMD_INTR_ACK|(status & XL_INTRS)); if (status & XL_STAT_TX_COMPLETE) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); xl_txeoc(sc); } @@ -2312,10 +2312,12 @@ xl_stats_update(struct xl_softc *sc) for (i = 0; i < 16; i++) *p++ = CSR_READ_1(sc, XL_W6_CARRIER_LOST + i); - ifp->if_ierrors += xl_stats.xl_rx_overrun; + if_inc_counter(ifp, IFCOUNTER_IERRORS, xl_stats.xl_rx_overrun); - ifp->if_collisions += xl_stats.xl_tx_multi_collision + - xl_stats.xl_tx_single_collision + xl_stats.xl_tx_late_collision; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + xl_stats.xl_tx_multi_collision + + xl_stats.xl_tx_single_collision + + xl_stats.xl_tx_late_collision); /* * Boomerang and cyclone chips have an extra stats counter @@ -3121,7 +3123,7 @@ xl_watchdog(struct xl_softc *sc) return (0); } - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); XL_SEL_WIN(4); status = CSR_READ_2(sc, XL_W4_MEDIA_STATUS); device_printf(sc->xl_dev, "watchdog timeout\n"); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:38:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E10118D; Thu, 18 Sep 2014 20:38:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 088B2A4; Thu, 18 Sep 2014 20:38:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKcItu049603; Thu, 18 Sep 2014 20:38:18 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKcIc6049601; Thu, 18 Sep 2014 20:38:18 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409182038.s8IKcIc6049601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 18 Sep 2014 20:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271819 - in head: share/man/man9 sys/cddl/compat/opensolaris/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:38:19 -0000 Author: smh Date: Thu Sep 18 20:38:18 2014 New Revision: 271819 URL: http://svnweb.freebsd.org/changeset/base/271819 Log: Remove sys/types.h include as per style (9) SDT requries sys/param.h due to use of NULL Reported by: Garrett Sponsored by: Multiplay Modified: head/share/man/man9/SDT.9 head/sys/cddl/compat/opensolaris/kern/opensolaris_dtrace.c Modified: head/share/man/man9/SDT.9 ============================================================================== --- head/share/man/man9/SDT.9 Thu Sep 18 20:35:22 2014 (r271818) +++ head/share/man/man9/SDT.9 Thu Sep 18 20:38:18 2014 (r271819) @@ -32,7 +32,6 @@ .Nd a DTrace framework for adding statically-defined tracing probes .Sh SYNOPSIS .In sys/param.h -.In sys/types.h .In sys/queue.h .In sys/sdt.h .Fn SDT_PROVIDER_DECLARE prov Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_dtrace.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_dtrace.c Thu Sep 18 20:35:22 2014 (r271818) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_dtrace.c Thu Sep 18 20:38:18 2014 (r271819) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:39:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 252F94C3; Thu, 18 Sep 2014 20:39:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07635D3; Thu, 18 Sep 2014 20:39:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKdNDg049833; Thu, 18 Sep 2014 20:39:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKdNnH049832; Thu, 18 Sep 2014 20:39:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182039.s8IKdNnH049832@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271820 - head/sys/dev/ie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:39:24 -0000 Author: glebius Date: Thu Sep 18 20:39:23 2014 New Revision: 271820 URL: http://svnweb.freebsd.org/changeset/base/271820 Log: - Mechanically convert to if_inc_counter(). - Cut code that runs a counter backwards. Modified: head/sys/dev/ie/if_ie.c Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Thu Sep 18 20:38:18 2014 (r271819) +++ head/sys/dev/ie/if_ie.c Thu Sep 18 20:39:23 2014 (r271820) @@ -427,13 +427,13 @@ ierint(struct ie_softc *sc) status = sc->rframes[i]->ie_fd_status; if ((status & IE_FD_COMPLETE) && (status & IE_FD_OK)) { - sc->ifp->if_ipackets++; + if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1); if (!--timesthru) { - sc->ifp->if_ierrors += + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, sc->scb->ie_err_crc + sc->scb->ie_err_align + sc->scb->ie_err_resource + - sc->scb->ie_err_overrun; + sc->scb->ie_err_overrun); sc->scb->ie_err_crc = 0; sc->scb->ie_err_align = 0; sc->scb->ie_err_resource = 0; @@ -477,24 +477,24 @@ ietint(struct ie_softc *sc) if (status & IE_XS_LATECOLL) { if_printf(ifp, "late collision\n"); - ifp->if_collisions++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_NOCARRIER) { if_printf(ifp, "no carrier\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_LOSTCTS) { if_printf(ifp, "lost CTS\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_UNDERRUN) { if_printf(ifp, "DMA underrun\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else if (status & IE_XS_EXCMAX) { if_printf(ifp, "too many collisions\n"); - ifp->if_collisions += 16; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 16); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else { - ifp->if_opackets++; - ifp->if_collisions += status & IE_XS_MAXCOLL; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, status & IE_XS_MAXCOLL); } } sc->xmit_count = 0; @@ -539,7 +539,7 @@ iernr(struct ie_softc *sc) #endif ie_ack(sc, IE_ST_WHENCE); - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); return (0); } @@ -688,16 +688,12 @@ ieget(struct ie_softc *sc, struct mbuf * */ if (!check_eh(sc, &eh)) { ie_drop_packet_buffer(sc); - sc->ifp->if_ierrors--; /* just this case, it's not an - * error - */ return (-1); } MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) { ie_drop_packet_buffer(sc); - /* XXXX if_ierrors++; */ return (-1); } @@ -859,7 +855,7 @@ ie_readframe(struct ie_softc *sc, int nu if (rfd.ie_fd_status & IE_FD_OK) { if (ieget(sc, &m)) { - sc->ifp->if_ierrors++; /* this counts as an + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); /* this counts as an * error */ return; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:43:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E86A6EA; Thu, 18 Sep 2014 20:43:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 695DC198; Thu, 18 Sep 2014 20:43:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKhIpN053699; Thu, 18 Sep 2014 20:43:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKhInl053698; Thu, 18 Sep 2014 20:43:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182043.s8IKhInl053698@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271821 - head/sys/dev/snc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:43:18 -0000 Author: glebius Date: Thu Sep 18 20:43:17 2014 New Revision: 271821 URL: http://svnweb.freebsd.org/changeset/base/271821 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/snc/dp83932.c Modified: head/sys/dev/snc/dp83932.c ============================================================================== --- head/sys/dev/snc/dp83932.c Thu Sep 18 20:39:23 2014 (r271820) +++ head/sys/dev/snc/dp83932.c Thu Sep 18 20:43:17 2014 (r271821) @@ -369,7 +369,7 @@ outloop: sc->mtd_prev = sc->mtd_free; sc->mtd_free = mtd_next; - ifp->if_opackets++; /* # of pkts */ + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* # of pkts */ /* Jump back for possibly more punishment. */ goto outloop; @@ -935,11 +935,12 @@ sonictxint(struct snc_softc *sc) txp_status = SRO(sc, txp, TXP_STATUS); - ifp->if_collisions += (txp_status & TCR_EXC) ? 16 : - ((txp_status & TCR_NC) >> 12); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + (txp_status & TCR_EXC) ? 16 : + ((txp_status & TCR_NC) >> 12)); if ((txp_status & TCR_PTX) == 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); device_printf(sc->sc_dev, "Tx packet status=0x%x\n", txp_status); @@ -989,11 +990,11 @@ sonicrxint(struct snc_softc *sc) u_int32_t pkt = sc->rbuf[orra & RBAMASK] + (rxpkt_ptr & PAGE_MASK); if (sonic_read(sc, pkt, len)) - sc->sc_ifp->if_ipackets++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); else - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); } else - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); /* * give receive buffer area back to chip. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:44:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C7B192F; Thu, 18 Sep 2014 20:44:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6771B1AD; Thu, 18 Sep 2014 20:44:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKisRJ054044; Thu, 18 Sep 2014 20:44:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKisWR054043; Thu, 18 Sep 2014 20:44:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182044.s8IKisWR054043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271822 - head/sys/dev/pdq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:44:54 -0000 Author: glebius Date: Thu Sep 18 20:44:53 2014 New Revision: 271822 URL: http://svnweb.freebsd.org/changeset/base/271822 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/pdq/pdq_ifsubr.c Modified: head/sys/dev/pdq/pdq_ifsubr.c ============================================================================== --- head/sys/dev/pdq/pdq_ifsubr.c Thu Sep 18 20:43:17 2014 (r271821) +++ head/sys/dev/pdq/pdq_ifsubr.c Thu Sep 18 20:44:53 2014 (r271822) @@ -229,7 +229,7 @@ pdq_os_receive_pdu( struct ifnet *ifp = PDQ_IFNET(sc); struct fddi_header *fh; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); #if defined(PDQ_BUS_DMA) { /* @@ -251,8 +251,8 @@ pdq_os_receive_pdu( m->m_pkthdr.len = pktlen; fh = mtod(m, struct fddi_header *); if (drop || (fh->fddi_fc & (FDDIFC_L|FDDIFC_F)) != FDDIFC_LLC_ASYNC) { - ifp->if_iqdrops++; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); PDQ_OS_DATABUF_FREE(pdq, m); return; } @@ -289,7 +289,7 @@ pdq_os_transmit_done( PDQ_BPF_MTAP(sc, m); #endif PDQ_OS_DATABUF_FREE(pdq, m); - PDQ_IFNET(sc)->if_opackets++; + if_inc_counter(PDQ_IFNET(sc), IFCOUNTER_OPACKETS, 1); } void From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:47:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9691DBD9; Thu, 18 Sep 2014 20:47:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 812EB1D7; Thu, 18 Sep 2014 20:47:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKleOO054567; Thu, 18 Sep 2014 20:47:40 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKldKW054562; Thu, 18 Sep 2014 20:47:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182047.s8IKldKW054562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271823 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:47:40 -0000 Author: glebius Date: Thu Sep 18 20:47:39 2014 New Revision: 271823 URL: http://svnweb.freebsd.org/changeset/base/271823 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Sep 18 20:44:53 2014 (r271822) +++ head/sys/dev/ath/if_ath.c Thu Sep 18 20:47:39 2014 (r271823) @@ -3192,7 +3192,7 @@ ath_transmit(struct ifnet *ifp, struct m DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); sc->sc_stats.ast_tx_nofrag++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ath_freetx(m); goto bad; } @@ -3240,7 +3240,7 @@ ath_transmit(struct ifnet *ifp, struct m * * XXX should use atomics? */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); nextfrag: /* * Pass the frame to the h/w for transmission. @@ -3260,7 +3260,7 @@ nextfrag: next = m->m_nextpkt; if (ath_tx_start(sc, ni, bf, m)) { bad: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); reclaim: bf->bf_m = NULL; bf->bf_node = NULL; @@ -6346,7 +6346,7 @@ ath_watchdog(void *arg) } else if_printf(ifp, "device timeout\n"); do_reset = 1; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); sc->sc_stats.ast_watchdog++; ATH_LOCK(sc); @@ -6530,8 +6530,10 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, break; case SIOCGATHSTATS: /* NB: embed these numbers to get a consistent view */ - sc->sc_stats.ast_tx_packets = ifp->if_opackets; - sc->sc_stats.ast_rx_packets = ifp->if_ipackets; + sc->sc_stats.ast_tx_packets = ifp->if_get_counter(ifp, + IFCOUNTER_OPACKETS); + sc->sc_stats.ast_rx_packets = ifp->if_get_counter(ifp, + IFCOUNTER_IPACKETS); sc->sc_stats.ast_tx_rssi = ATH_RSSI(sc->sc_halstats.ns_avgtxrssi); sc->sc_stats.ast_rx_rssi = ATH_RSSI(sc->sc_halstats.ns_avgrssi); #ifdef IEEE80211_SUPPORT_TDMA Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Thu Sep 18 20:44:53 2014 (r271822) +++ head/sys/dev/ath/if_ath_rx.c Thu Sep 18 20:47:39 2014 (r271823) @@ -704,7 +704,7 @@ ath_rx_pkt(struct ath_softc *sc, struct rs->rs_keyix-32 : rs->rs_keyix); } } - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); rx_error: /* * Cleanup any pending partial frame. @@ -830,7 +830,7 @@ rx_accept: rs->rs_antenna |= 0x4; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); sc->sc_stats.ast_ant_rx[rs->rs_antenna]++; /* Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Sep 18 20:44:53 2014 (r271822) +++ head/sys/dev/ath/if_ath_tx.c Thu Sep 18 20:47:39 2014 (r271823) @@ -2424,7 +2424,7 @@ ath_raw_xmit(struct ieee80211_node *ni, } } sc->sc_wd_timer = 5; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->sc_stats.ast_tx_raw++; /* @@ -2473,7 +2473,7 @@ bad: badbad: ATH_KTR(sc, ATH_KTR_TX, 2, "ath_raw_xmit: bad0: m=%p, params=%p", m, params); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); sc->sc_stats.ast_tx_raw_fail++; ieee80211_free_node(ni); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:51:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 157B1DB8; Thu, 18 Sep 2014 20:51:00 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC2C283; Thu, 18 Sep 2014 20:50:58 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8IKotQ0003297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Sep 2014 00:50:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8IKotSP003296; Fri, 19 Sep 2014 00:50:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Sep 2014 00:50:55 +0400 From: Gleb Smirnoff To: Navdeep Parhar Subject: Re: svn commit: r271803 - head/sys/dev/tl Message-ID: <20140918205055.GE884@FreeBSD.org> References: <201409182003.s8IK3kr8033068@svn.freebsd.org> <541B3BE1.7080005@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <541B3BE1.7080005@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:51:00 -0000 Navdeep, On Thu, Sep 18, 2014 at 01:09:05PM -0700, Navdeep Parhar wrote: N> Consider changing if_inc_counter to be inline and have it take const N> ints for the counter and increment. The compiler will optimize away all N> the unneeded code in if_inc_counter. Yep, constifying is a good idea. Regarding the contents of if_inc_counter(). The plan is to remove racy counters, make array of counter(9), then if_inc_counter() will get rid of switch(), instead it will do: counter_u64_add(ifp->counters[cnt]); We can't make it inline, since we want drivers to be not aware of struct ifnet entirely. Anyway, high performance drivers do accounting in hardware, and will not execute if_inc_counter() on fast path. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:53:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEB82AB; Thu, 18 Sep 2014 20:53:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A97282DB; Thu, 18 Sep 2014 20:53:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKr2K6058563; Thu, 18 Sep 2014 20:53:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKr2JG058562; Thu, 18 Sep 2014 20:53:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182053.s8IKr2JG058562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271824 - head/sys/dev/cas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:53:02 -0000 Author: glebius Date: Thu Sep 18 20:53:02 2014 New Revision: 271824 URL: http://svnweb.freebsd.org/changeset/base/271824 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/cas/if_cas.c Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Thu Sep 18 20:47:39 2014 (r271823) +++ head/sys/dev/cas/if_cas.c Thu Sep 18 20:53:02 2014 (r271824) @@ -642,18 +642,18 @@ cas_tick(void *arg) /* * Unload collision and error counters. */ - ifp->if_collisions += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, CAS_READ_4(sc, CAS_MAC_NORM_COLL_CNT) + - CAS_READ_4(sc, CAS_MAC_FIRST_COLL_CNT); + CAS_READ_4(sc, CAS_MAC_FIRST_COLL_CNT)); v = CAS_READ_4(sc, CAS_MAC_EXCESS_COLL_CNT) + CAS_READ_4(sc, CAS_MAC_LATE_COLL_CNT); - ifp->if_collisions += v; - ifp->if_oerrors += v; - ifp->if_ierrors += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, v); + if_inc_counter(ifp, IFCOUNTER_OERRORS, v); + if_inc_counter(ifp, IFCOUNTER_IERRORS, CAS_READ_4(sc, CAS_MAC_RX_LEN_ERR_CNT) + CAS_READ_4(sc, CAS_MAC_RX_ALIGN_ERR) + CAS_READ_4(sc, CAS_MAC_RX_CRC_ERR_CNT) + - CAS_READ_4(sc, CAS_MAC_RX_CODE_VIOL); + CAS_READ_4(sc, CAS_MAC_RX_CODE_VIOL)); /* * Then clear the hardware counters. @@ -1581,7 +1581,7 @@ cas_tint(struct cas_softc *sc) STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); progress = 1; } @@ -1700,7 +1700,7 @@ cas_rint(struct cas_softc *sc) if (__predict_false( (word4 & (CAS_RC4_BAD | CAS_RC4_LEN_MMATCH)) != 0)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); device_printf(sc->sc_dev, "receive error: CRC error\n"); continue; @@ -1750,7 +1750,7 @@ cas_rint(struct cas_softc *sc) if (m != NULL) { m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); @@ -1759,7 +1759,7 @@ cas_rint(struct cas_softc *sc) (*ifp->if_input)(ifp, m); CAS_LOCK(sc); } else - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); if ((word1 & CAS_RC1_RELEASE_HDR) != 0 && refcount_release(&rxds->rxds_refcount) != 0) @@ -1848,7 +1848,7 @@ cas_rint(struct cas_softc *sc) if (m != NULL) { m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = len; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); @@ -1857,7 +1857,7 @@ cas_rint(struct cas_softc *sc) (*ifp->if_input)(ifp, m); CAS_LOCK(sc); } else - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); if ((word1 & CAS_RC1_RELEASE_DATA) != 0 && refcount_release(&rxds->rxds_refcount) != 0) @@ -1949,7 +1949,7 @@ cas_eint(struct cas_softc *sc, u_int sta CAS_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); device_printf(sc->sc_dev, "%s: status 0x%x", __func__, status); if ((status & CAS_INTR_PCI_ERROR_INT) != 0) { @@ -2049,7 +2049,7 @@ cas_intr_task(void *arg, int pending __u status2 = CAS_READ_4(sc, CAS_MAC_TX_STATUS); if ((status2 & (CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)) != 0) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); else if ((status2 & ~CAS_MAC_TX_FRAME_XMTD) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); @@ -2058,7 +2058,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false(status & CAS_INTR_RX_MAC_INT)) { status2 = CAS_READ_4(sc, CAS_MAC_RX_STATUS); if ((status2 & CAS_MAC_RX_OVERFLOW) != 0) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); else if ((status2 & ~CAS_MAC_RX_FRAME_RCVD) != 0) device_printf(sc->sc_dev, "MAC RX fault, status %x\n", status2); @@ -2135,7 +2135,7 @@ cas_watchdog(struct cas_softc *sc) device_printf(sc->sc_dev, "device timeout\n"); else if (bootverbose) device_printf(sc->sc_dev, "device timeout (no link)\n"); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* Try to get more packets going. */ ifp->if_drv_flags &= ~IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:53:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0D5F20B; Thu, 18 Sep 2014 20:53:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA2152E0; Thu, 18 Sep 2014 20:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKrbKA058673; Thu, 18 Sep 2014 20:53:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKrbBa058668; Thu, 18 Sep 2014 20:53:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182053.s8IKrbBa058668@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 20:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271825 - in stable/9/sys: net netinet 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:53:38 -0000 Author: asomers Date: Thu Sep 18 20:53:36 2014 New Revision: 271825 URL: http://svnweb.freebsd.org/changeset/base/271825 Log: MFC r264887, except for the ATF test change. Also, ifa_switch_loopback_route doesn't exist in stable/9, so the relevant change to that function went into in_scrubprefix instead. Fix host and network routes for new interfaces when net.add_addr_allfibs=0 sys/net/route.c In rtinit1, use the interface fib instead of the process fib. The latter wasn't very useful because ifconfig(8) is usually invoked with the default process fib. Changing ifconfig(8) to use setfib(2) would be redundant, because it already sets the interface fib. tests/sys/netinet/fibs_test.sh Clear the expected ATF failure sys/net/if.c Pass the interface fib in calls to rtrequest1_fib and rtalloc1_fib sys/netinet/in.c sys/net/if_var.h Add a fibnum argument to ifa_switch_loopback_route, a subroutine of in_scrubprefix. Pass it the interface fib. PR: kern/187549 Modified: stable/9/sys/net/if.c stable/9/sys/net/route.c stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Thu Sep 18 20:53:02 2014 (r271824) +++ stable/9/sys/net/if.c Thu Sep 18 20:53:36 2014 (r271825) @@ -1479,7 +1479,7 @@ ifa_add_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); + error = rtrequest1_fib(RTM_ADD, &info, &rt, ifa->ifa_ifp->if_fib); if (error == 0 && rt != NULL) { RT_LOCK(rt); @@ -1511,7 +1511,7 @@ ifa_del_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); + error = rtrequest1_fib(RTM_DELETE, &info, NULL, ifa->ifa_ifp->if_fib); if (error != 0) log(LOG_INFO, "ifa_del_loopback_route: deletion failed\n"); Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Thu Sep 18 20:53:02 2014 (r271824) +++ stable/9/sys/net/route.c Thu Sep 18 20:53:36 2014 (r271825) @@ -1527,7 +1527,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int } if (fibnum == RT_ALL_FIBS) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { - startfib = endfib = curthread->td_proc->p_fibnum; + startfib = endfib = ifa->ifa_ifp->if_fib; } else { startfib = 0; endfib = rt_numfibs - 1; Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 20:53:02 2014 (r271824) +++ stable/9/sys/netinet/in.c Thu Sep 18 20:53:36 2014 (r271825) @@ -1069,7 +1069,7 @@ in_scrubprefix(struct in_ifaddr *target, bzero(&ia_ro, sizeof(ia_ro)); *((struct sockaddr_in *)(&ia_ro.ro_dst)) = target->ia_addr; - rtalloc_ign_fib(&ia_ro, 0, 0); + rtalloc_ign_fib(&ia_ro, 0, fibnum); if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && (ia_ro.ro_rt->rt_ifp == V_loif)) { RT_LOCK(ia_ro.ro_rt); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:58:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 396AF4CE; Thu, 18 Sep 2014 20:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A310314; Thu, 18 Sep 2014 20:58:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKw4LM059451; Thu, 18 Sep 2014 20:58:04 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKw4KS059450; Thu, 18 Sep 2014 20:58:04 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182058.s8IKw4KS059450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271826 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:58:05 -0000 Author: glebius Date: Thu Sep 18 20:58:04 2014 New Revision: 271826 URL: http://svnweb.freebsd.org/changeset/base/271826 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Thu Sep 18 20:53:36 2014 (r271825) +++ head/sys/dev/ffec/if_ffec.c Thu Sep 18 20:58:04 2014 (r271826) @@ -499,23 +499,21 @@ ffec_harvest_stats(struct ffec_softc *sc sc->stats_harvest_count = 0; ifp = sc->ifp; - ifp->if_ipackets += RD4(sc, FEC_RMON_R_PACKETS); - ifp->if_imcasts += RD4(sc, FEC_RMON_R_MC_PKT); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_CRC_ALIGN); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_UNDERSIZE); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_OVERSIZE); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_FRAG); - ifp->if_ierrors += RD4(sc, FEC_RMON_R_JAB); - - ifp->if_opackets += RD4(sc, FEC_RMON_T_PACKETS); - ifp->if_omcasts += RD4(sc, FEC_RMON_T_MC_PKT); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_CRC_ALIGN); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_UNDERSIZE); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_OVERSIZE ); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_FRAG); - ifp->if_oerrors += RD4(sc, FEC_RMON_T_JAB); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, RD4(sc, FEC_RMON_R_PACKETS)); + if_inc_counter(ifp, IFCOUNTER_IMCASTS, RD4(sc, FEC_RMON_R_MC_PKT)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, + RD4(sc, FEC_RMON_R_CRC_ALIGN) + RD4(sc, FEC_RMON_R_UNDERSIZE) + + RD4(sc, FEC_RMON_R_OVERSIZE) + RD4(sc, FEC_RMON_R_FRAG) + + RD4(sc, FEC_RMON_R_JAB)); + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, RD4(sc, FEC_RMON_T_PACKETS)); + if_inc_counter(ifp, IFCOUNTER_OMCASTS, RD4(sc, FEC_RMON_T_MC_PKT)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, + RD4(sc, FEC_RMON_T_CRC_ALIGN) + RD4(sc, FEC_RMON_T_UNDERSIZE) + + RD4(sc, FEC_RMON_T_OVERSIZE) + RD4(sc, FEC_RMON_T_FRAG) + + RD4(sc, FEC_RMON_T_JAB)); - ifp->if_collisions += RD4(sc, FEC_RMON_T_COL); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, RD4(sc, FEC_RMON_T_COL)); ffec_clear_stats(sc); } @@ -784,7 +782,7 @@ ffec_rxfinish_onebuf(struct ffec_softc * * mbuf, which is still mapped and loaded. */ if ((newmbuf = ffec_alloc_mbufcl(sc)) == NULL) { - ++sc->ifp->if_iqdrops; + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); ffec_setup_rxdesc(sc, sc->rx_idx, sc->rxdesc_ring[sc->rx_idx].buf_paddr); return; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:59:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCB7464A; Thu, 18 Sep 2014 20:59:59 +0000 (UTC) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB1C325; Thu, 18 Sep 2014 20:59:59 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id lf10so2328067pab.36 for ; Thu, 18 Sep 2014 13:59:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=G4XuvTypuH9A8aEthyMHqo6BNNoJi/aYt6iYPbN5RIU=; b=rcktzDPRJ9uMPhTc0aF6Pok5cMt8rBoLjMN8ZmQcspYontgVeKD8lfjwvJFOZKlbHl U7PzU+2mOaXRPNqcfq3pGqP+LAhhHGWfY27pc2mt3MSuERCqWjuOfiwbhJr8S1tbCI2M MKbu2IiWuTlPB4R33envXMwdvcc4JSVXgfL6k0qGm3UVW9+G6lk9rJOqu7eQ1Dq0fNz1 HnGUFxe3UCNRDNvDHCLvWhZvrzyP3P9SgKWlgp38vGQeB04B9LSFQ/DZXbEEqWV84dJi b8c6qp8MFUWFAsMXMXHlKywO4QeRpI7UNx951oaTtCHXsYudAj/aaHcpWYcGu4ew7012 3uUQ== X-Received: by 10.68.125.227 with SMTP id mt3mr9722234pbb.97.1411073999163; Thu, 18 Sep 2014 13:59:59 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id v1sm20600016pdg.28.2014.09.18.13.59.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 13:59:57 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <541B47CB.3000100@FreeBSD.org> Date: Thu, 18 Sep 2014 13:59:55 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r271803 - head/sys/dev/tl References: <201409182003.s8IK3kr8033068@svn.freebsd.org> <541B3BE1.7080005@FreeBSD.org> <20140918205055.GE884@FreeBSD.org> In-Reply-To: <20140918205055.GE884@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 20:59:59 -0000 On 09/18/14 13:50, Gleb Smirnoff wrote: > Navdeep, > > On Thu, Sep 18, 2014 at 01:09:05PM -0700, Navdeep Parhar wrote: > N> Consider changing if_inc_counter to be inline and have it take const > N> ints for the counter and increment. The compiler will optimize away all > N> the unneeded code in if_inc_counter. > > Yep, constifying is a good idea. > > Regarding the contents of if_inc_counter(). The plan is to remove racy > counters, make array of counter(9), then if_inc_counter() will get rid > of switch(), instead it will do: > > counter_u64_add(ifp->counters[cnt]); > > We can't make it inline, since we want drivers to be not aware of > struct ifnet entirely. You can hide ifnet behind a stable KPI or KBI. Looks like your goal is the latter. Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 20:59:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D670B64C; Thu, 18 Sep 2014 20:59:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7676326; Thu, 18 Sep 2014 20:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IKxx2r059722; Thu, 18 Sep 2014 20:59:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IKxxPT059721; Thu, 18 Sep 2014 20:59:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182059.s8IKxxPT059721@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 20:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271827 - head/sys/dev/my X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:00:00 -0000 Author: glebius Date: Thu Sep 18 20:59:59 2014 New Revision: 271827 URL: http://svnweb.freebsd.org/changeset/base/271827 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/my/if_my.c Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Thu Sep 18 20:58:04 2014 (r271826) +++ head/sys/dev/my/if_my.c Thu Sep 18 20:59:59 2014 (r271827) @@ -1121,7 +1121,7 @@ my_rxeof(struct my_softc * sc) sc->my_cdata.my_rx_head = cur_rx->my_nextdesc; if (rxstat & MY_ES) { /* error summary: give up this rx pkt */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->my_ptr->my_status = MY_OWNByNIC; continue; } @@ -1134,7 +1134,7 @@ my_rxeof(struct my_softc * sc) total_len, 0, ifp, NULL); cur_rx->my_ptr->my_status = MY_OWNByNIC; if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } } else { @@ -1147,14 +1147,14 @@ my_rxeof(struct my_softc * sc) * little else we can do in this situation. */ if (my_newbuf(sc, cur_rx) == ENOBUFS) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); cur_rx->my_ptr->my_status = MY_OWNByNIC; continue; } m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = total_len; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); eh = mtod(m, struct ether_header *); #if NBPFILTER > 0 /* @@ -1212,16 +1212,16 @@ my_txeof(struct my_softc * sc) break; if (!(CSR_READ_4(sc, MY_TCRRCR) & MY_Enhanced)) { if (txstat & MY_TXERR) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (txstat & MY_EC) /* excessive collision */ - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (txstat & MY_LC) /* late collision */ - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } - ifp->if_collisions += (txstat & MY_NCRMASK) >> - MY_NCRShift; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + (txstat & MY_NCRMASK) >> MY_NCRShift); } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); m_freem(cur_tx->my_mbuf); cur_tx->my_mbuf = NULL; if (sc->my_cdata.my_tx_head == sc->my_cdata.my_tx_tail) { @@ -1232,7 +1232,7 @@ my_txeof(struct my_softc * sc) sc->my_cdata.my_tx_head = cur_tx->my_nextdesc; } if (CSR_READ_4(sc, MY_TCRRCR) & MY_Enhanced) { - ifp->if_collisions += (CSR_READ_4(sc, MY_TSR) & MY_NCRMask); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (CSR_READ_4(sc, MY_TSR) & MY_NCRMask)); } return; } @@ -1293,7 +1293,7 @@ my_intr(void *arg) if ((status & MY_RBU) || (status & MY_RxErr)) { /* rx buffer unavailable or rx error */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); #ifdef foo my_stop(sc); my_reset(sc); @@ -1701,7 +1701,7 @@ my_watchdog(void *arg) return; ifp = sc->my_ifp; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if_printf(ifp, "watchdog timeout\n"); if (!(my_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT)) if_printf(ifp, "no carrier - transceiver cable problem?\n"); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:01:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9756A33; Thu, 18 Sep 2014 21:01:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B47F350; Thu, 18 Sep 2014 21:01:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IL1fpB063596; Thu, 18 Sep 2014 21:01:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IL1fB5063595; Thu, 18 Sep 2014 21:01:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182101.s8IL1fB5063595@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271828 - head/sys/dev/age X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:01:41 -0000 Author: glebius Date: Thu Sep 18 21:01:41 2014 New Revision: 271828 URL: http://svnweb.freebsd.org/changeset/base/271828 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Thu Sep 18 20:59:59 2014 (r271827) +++ head/sys/dev/age/if_age.c Thu Sep 18 21:01:41 2014 (r271828) @@ -1792,7 +1792,7 @@ age_watchdog(struct age_softc *sc) ifp = sc->age_ifp; if ((sc->age_flags & AGE_FLAG_LINK) == 0) { if_printf(sc->age_ifp, "watchdog timeout (missed link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; age_init_locked(sc); return; @@ -1805,7 +1805,7 @@ age_watchdog(struct age_softc *sc) return; } if_printf(sc->age_ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; age_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2087,22 +2087,22 @@ age_stats_update(struct age_softc *sc) stat->tx_mcast_bytes += smb->tx_mcast_bytes; /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, smb->tx_frames); - ifp->if_collisions += smb->tx_single_colls + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls + smb->tx_multi_colls + smb->tx_late_colls + - smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT; + smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT); - ifp->if_oerrors += smb->tx_excess_colls + + if_inc_counter(ifp, IFCOUNTER_OERRORS, smb->tx_excess_colls + smb->tx_late_colls + smb->tx_underrun + - smb->tx_pkts_truncated; + smb->tx_pkts_truncated); - ifp->if_ipackets += smb->rx_frames; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames); - ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs + - smb->rx_runts + smb->rx_pkts_truncated + + if_inc_counter(ifp, IFCOUNTER_IERRORS, smb->rx_crcerrs + + smb->rx_lenerrs + smb->rx_runts + smb->rx_pkts_truncated + smb->rx_fifo_oflows + smb->rx_desc_oflows + - smb->rx_alignerrs; + smb->rx_alignerrs); /* Update done, clear. */ smb->updated = 0; @@ -2291,7 +2291,7 @@ age_fixup_rx(struct ifnet *ifp, struct m */ MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); m_freem(m); return (NULL); } @@ -2347,7 +2347,7 @@ age_rxeof(struct age_softc *sc, struct r mp = rxd->rx_m; /* Add a new receive buffer to the ring. */ if (age_newbuf(sc, rxd) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); /* Reuse Rx buffers. */ if (sc->age_cdata.age_rxhead != NULL) m_freem(sc->age_cdata.age_rxhead); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:03:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22198D16; Thu, 18 Sep 2014 21:03:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2B93402; Thu, 18 Sep 2014 21:03:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IL3DXN063933; Thu, 18 Sep 2014 21:03:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IL3DoM063932; Thu, 18 Sep 2014 21:03:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182103.s8IL3DoM063932@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271829 - head/sys/dev/bfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:03:14 -0000 Author: glebius Date: Thu Sep 18 21:03:13 2014 New Revision: 271829 URL: http://svnweb.freebsd.org/changeset/base/271829 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/bfe/if_bfe.c Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Thu Sep 18 21:01:41 2014 (r271828) +++ head/sys/dev/bfe/if_bfe.c Thu Sep 18 21:03:13 2014 (r271829) @@ -1310,22 +1310,22 @@ bfe_stats_update(struct bfe_softc *sc) stats->rx_control_frames += mib[MIB_RX_NPAUSE]; /* Update counters in ifnet. */ - ifp->if_opackets += (u_long)mib[MIB_TX_GOOD_P]; - ifp->if_collisions += (u_long)mib[MIB_TX_TCOLS]; - ifp->if_oerrors += (u_long)mib[MIB_TX_URUNS] + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, (u_long)mib[MIB_TX_GOOD_P]); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (u_long)mib[MIB_TX_TCOLS]); + if_inc_counter(ifp, IFCOUNTER_OERRORS, (u_long)mib[MIB_TX_URUNS] + (u_long)mib[MIB_TX_ECOLS] + (u_long)mib[MIB_TX_DEFERED] + - (u_long)mib[MIB_TX_CLOST]; + (u_long)mib[MIB_TX_CLOST]); - ifp->if_ipackets += (u_long)mib[MIB_RX_GOOD_P]; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, (u_long)mib[MIB_RX_GOOD_P]); - ifp->if_ierrors += mib[MIB_RX_JABBER] + + if_inc_counter(ifp, IFCOUNTER_IERRORS, mib[MIB_RX_JABBER] + mib[MIB_RX_MISS] + mib[MIB_RX_CRCA] + mib[MIB_RX_USIZE] + mib[MIB_RX_CRC] + mib[MIB_RX_ALIGN] + - mib[MIB_RX_SYM]; + mib[MIB_RX_SYM]); } static void @@ -1403,7 +1403,7 @@ bfe_rxeof(struct bfe_softc *sc) * reuse mapped buffer from errored frame. */ if (bfe_list_newbuf(sc, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); bfe_discard_buf(sc, cons); continue; } @@ -1818,7 +1818,7 @@ bfe_watchdog(struct bfe_softc *sc) device_printf(sc->bfe_dev, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bfe_init_locked(sc); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:05:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E48E3F69; Thu, 18 Sep 2014 21:05:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF8865FB; Thu, 18 Sep 2014 21:05:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IL5xcD064418; Thu, 18 Sep 2014 21:05:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IL5xjI064417; Thu, 18 Sep 2014 21:05:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182105.s8IL5xjI064417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271830 - head/sys/dev/bm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:06:00 -0000 Author: glebius Date: Thu Sep 18 21:05:59 2014 New Revision: 271830 URL: http://svnweb.freebsd.org/changeset/base/271830 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/bm/if_bm.c Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Thu Sep 18 21:03:13 2014 (r271829) +++ head/sys/dev/bm/if_bm.c Thu Sep 18 21:05:59 2014 (r271830) @@ -608,7 +608,7 @@ bm_rxintr(void *xsc) m = sc->sc_rxsoft[i].rxs_mbuf; if (bm_add_rxbuf(sc, i)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m = NULL; continue; } @@ -616,7 +616,7 @@ bm_rxintr(void *xsc) if (m == NULL) continue; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_len -= (dbdma_get_residuals(sc->sc_rxdma, i) + 2); m->m_pkthdr.len = m->m_len; @@ -678,7 +678,7 @@ bm_txintr(void *xsc) STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); progress = 1; } @@ -1196,12 +1196,13 @@ bm_tick(void *arg) struct bm_softc *sc = arg; /* Read error counters */ - sc->sc_ifp->if_collisions += CSR_READ_2(sc, BM_TX_NCCNT) + - CSR_READ_2(sc, BM_TX_FCCNT) + CSR_READ_2(sc, BM_TX_EXCNT) + - CSR_READ_2(sc, BM_TX_LTCNT); - - sc->sc_ifp->if_ierrors += CSR_READ_2(sc, BM_RX_LECNT) + - CSR_READ_2(sc, BM_RX_AECNT) + CSR_READ_2(sc, BM_RX_FECNT); + if_inc_counter(sc->sc_ifp, IFCOUNTER_COLLISIONS, + CSR_READ_2(sc, BM_TX_NCCNT) + CSR_READ_2(sc, BM_TX_FCCNT) + + CSR_READ_2(sc, BM_TX_EXCNT) + CSR_READ_2(sc, BM_TX_LTCNT)); + + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, + CSR_READ_2(sc, BM_RX_LECNT) + CSR_READ_2(sc, BM_RX_AECNT) + + CSR_READ_2(sc, BM_RX_FECNT)); /* Zero collision counters */ CSR_WRITE_2(sc, BM_TX_NCCNT, 0); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:07:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C568138; Thu, 18 Sep 2014 21:07:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D144360B; Thu, 18 Sep 2014 21:07:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IL75GF064606; Thu, 18 Sep 2014 21:07:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IL75Ow064605; Thu, 18 Sep 2014 21:07:05 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182107.s8IL75Ow064605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271831 - head/sys/dev/hme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:07:06 -0000 Author: glebius Date: Thu Sep 18 21:07:05 2014 New Revision: 271831 URL: http://svnweb.freebsd.org/changeset/base/271831 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/hme/if_hme.c Modified: head/sys/dev/hme/if_hme.c ============================================================================== --- head/sys/dev/hme/if_hme.c Thu Sep 18 21:05:59 2014 (r271830) +++ head/sys/dev/hme/if_hme.c Thu Sep 18 21:07:05 2014 (r271831) @@ -477,11 +477,11 @@ hme_tick(void *arg) /* * Unload collision counters */ - ifp->if_collisions += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, HME_MAC_READ_4(sc, HME_MACI_NCCNT) + HME_MAC_READ_4(sc, HME_MACI_FCCNT) + HME_MAC_READ_4(sc, HME_MACI_EXCNT) + - HME_MAC_READ_4(sc, HME_MACI_LTCNT); + HME_MAC_READ_4(sc, HME_MACI_LTCNT)); /* * then clear the hardware counters. @@ -1072,7 +1072,7 @@ hme_read(struct hme_softc *sc, int ix, i HME_WHINE(sc->sc_dev, "invalid packet size %d; dropping\n", len); #endif - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); hme_discard_rxbuf(sc, ix); return; } @@ -1086,12 +1086,12 @@ hme_read(struct hme_softc *sc, int ix, i * it is sure that a new buffer can be mapped. If it can not, * drop the packet, but leave the interface up. */ - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); hme_discard_rxbuf(sc, ix); return; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len + HME_RXOFFS; @@ -1193,7 +1193,7 @@ hme_tint(struct hme_softc *sc) BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->sc_tdmatag, htx->htx_dmamap); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); m_freem(htx->htx_m); htx->htx_m = NULL; STAILQ_REMOVE_HEAD(&sc->sc_rb.rb_txbusyq, htx_q); @@ -1299,7 +1299,7 @@ hme_rint(struct hme_softc *sc) if ((flags & HME_XD_OFL) != 0) { device_printf(sc->sc_dev, "buffer overflow, ri=%d; " "flags=0x%x\n", ri, flags); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); hme_discard_rxbuf(sc, ri); } else { len = HME_XD_DECODE_RSIZE(flags); @@ -1374,7 +1374,7 @@ hme_watchdog(struct hme_softc *sc) device_printf(sc->sc_dev, "device timeout\n"); else if (bootverbose) device_printf(sc->sc_dev, "device timeout (no link)\n"); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; hme_init_locked(sc); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:09:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED0B0298; Thu, 18 Sep 2014 21:09:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC411619; Thu, 18 Sep 2014 21:09:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IL9PFe065267; Thu, 18 Sep 2014 21:09:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IL9M5i065244; Thu, 18 Sep 2014 21:09:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182109.s8IL9M5i065244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271832 - head/sys/dev/usb/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:09:26 -0000 Author: glebius Date: Thu Sep 18 21:09:22 2014 New Revision: 271832 URL: http://svnweb.freebsd.org/changeset/base/271832 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_smsc.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/net/if_usie.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/net/usb_ethernet.c Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_aue.c Thu Sep 18 21:09:22 2014 (r271832) @@ -748,10 +748,10 @@ aue_intr_callback(struct usb_xfer *xfer, usbd_copy_out(pc, 0, &pkt, sizeof(pkt)); if (pkt.aue_txstat0) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (pkt.aue_txstat0 & (AUE_TXSTAT0_LATECOLL | AUE_TXSTAT0_EXCESSCOLL)) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } /* FALLTHROUGH */ case USB_ST_SETUP: @@ -790,13 +790,13 @@ aue_bulk_read_callback(struct usb_xfer * if (sc->sc_flags & AUE_FLAG_VER_2) { if (actlen == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } } else { if (actlen <= (int)(sizeof(stat) + ETHER_CRC_LEN)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } usbd_copy_out(pc, actlen - sizeof(stat), &stat, @@ -808,7 +808,7 @@ aue_bulk_read_callback(struct usb_xfer * */ stat.aue_rxstat &= AUE_RXSTAT_MASK; if (stat.aue_rxstat) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } /* No errors; receive the packet. */ @@ -853,7 +853,7 @@ aue_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer of %d bytes complete\n", actlen); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -910,7 +910,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_axe.c Thu Sep 18 21:09:22 2014 (r271832) @@ -1097,7 +1097,7 @@ axe_rx_frame(struct usb_ether *ue, struc axe_rxeof(ue, pc, 0, actlen, NULL); if (error != 0) - ue->ue_ifp->if_ierrors++; + if_inc_counter(ue->ue_ifp, IFCOUNTER_IERRORS, 1); return (error); } @@ -1109,13 +1109,13 @@ axe_rxeof(struct usb_ether *ue, struct u struct mbuf *m; if (len < ETHER_HDR_LEN || len > MCLBYTES - ETHER_ALIGN) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (EINVAL); } m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (ENOMEM); } m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1123,7 +1123,7 @@ axe_rxeof(struct usb_ether *ue, struct u usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; @@ -1229,7 +1229,7 @@ tr_setup: * multiple writes into single one if there is * room in TX buffer of controller. */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* * if there's a BPF listener, bounce a copy @@ -1253,7 +1253,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (error != USB_ERR_CANCELLED) { Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_axge.c Thu Sep 18 21:09:22 2014 (r271832) @@ -681,7 +681,7 @@ tr_setup: * multiple writes into single one if there is * room in TX buffer of controller. */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* * if there's a BPF listener, bounce a copy @@ -702,7 +702,7 @@ tr_setup: return; /* NOTREACHED */ default: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (error != USB_ERR_CANCELLED) { @@ -962,7 +962,7 @@ axge_rx_frame(struct usb_ether *ue, stru pktlen = (pkt_hdr >> 16) & 0x1fff; if (pkt_hdr & (AXGE_RXHDR_CRC_ERR | AXGE_RXHDR_DROP_ERR)) { DPRINTF("Dropped a packet\n"); - ue->ue_ifp->if_ierrors++; + if_inc_counter(ue->ue_ifp, IFCOUNTER_IERRORS, 1); } if (pktlen >= 6 && (int)(pos + pktlen) <= actlen) { axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); @@ -984,13 +984,13 @@ axge_rxeof(struct usb_ether *ue, struct ifp = ue->ue_ifp; if (len < ETHER_HDR_LEN || len > MCLBYTES - ETHER_ALIGN) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return; } m->m_pkthdr.rcvif = ifp; @@ -999,7 +999,7 @@ axge_rxeof(struct usb_ether *ue, struct usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_cdce.c Thu Sep 18 21:09:22 2014 (r271832) @@ -788,7 +788,7 @@ cdce_bulk_write_callback(struct usb_xfer DPRINTFN(11, "transfer complete: %u bytes in %u frames\n", actlen, aframes); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* free all previous TX buffers */ cdce_free_queue(sc->sc_tx_buf, CDCE_FRAMES_MAX); @@ -814,7 +814,7 @@ tr_setup: if (!m_append(m, 4, (void *)&crc)) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -822,7 +822,7 @@ tr_setup: mt = m_defrag(m, M_NOWAIT); if (mt == NULL) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } m = mt; @@ -854,7 +854,7 @@ tr_setup: cdce_free_queue(sc->sc_tx_buf, CDCE_FRAMES_MAX); /* count output errors */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ @@ -1169,7 +1169,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer /* The frame won't fit in our buffer */ DPRINTFN(1, "Frame too big to be transmitted!\n"); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); n--; continue; } @@ -1207,7 +1207,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer /* Pre-increment interface counter */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } if (n == 0) @@ -1310,7 +1310,7 @@ cdce_ncm_bulk_write_callback(struct usb_ usbd_errstr(error)); /* update error counter */ - ifp->if_oerrors += 1; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ @@ -1454,7 +1454,7 @@ cdce_ncm_bulk_read_callback(struct usb_x sumdata += temp; } else { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } } Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_cue.c Thu Sep 18 21:09:22 2014 (r271832) @@ -462,7 +462,7 @@ cue_bulk_read_callback(struct usb_xfer * case USB_ST_TRANSFERRED: if (actlen <= (int)(2 + sizeof(struct ether_header))) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } pc = usbd_xfer_get_frame(xfer, 0); @@ -506,7 +506,7 @@ cue_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -544,7 +544,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ @@ -563,12 +563,12 @@ cue_tick(struct usb_ether *ue) CUE_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_collisions += cue_csr_read_2(sc, CUE_TX_SINGLECOLL); - ifp->if_collisions += cue_csr_read_2(sc, CUE_TX_MULTICOLL); - ifp->if_collisions += cue_csr_read_2(sc, CUE_TX_EXCESSCOLL); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, cue_csr_read_2(sc, CUE_TX_SINGLECOLL)); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, cue_csr_read_2(sc, CUE_TX_MULTICOLL)); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, cue_csr_read_2(sc, CUE_TX_EXCESSCOLL)); if (cue_csr_read_2(sc, CUE_RX_FRAMEERR)) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } static void Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_ipheth.c Thu Sep 18 21:09:22 2014 (r271832) @@ -400,7 +400,7 @@ ipheth_bulk_write_callback(struct usb_xf DPRINTFN(11, "transfer complete: %u bytes in %u frames\n", actlen, aframes); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* free all previous TX buffers */ ipheth_free_queue(sc->sc_tx_buf, IPHETH_TX_FRAMES_MAX); @@ -455,7 +455,7 @@ tr_setup: ipheth_free_queue(sc->sc_tx_buf, IPHETH_TX_FRAMES_MAX); /* count output errors */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_kue.c Thu Sep 18 21:09:22 2014 (r271832) @@ -550,7 +550,7 @@ kue_bulk_read_callback(struct usb_xfer * case USB_ST_TRANSFERRED: if (actlen <= (int)(2 + sizeof(struct ether_header))) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } pc = usbd_xfer_get_frame(xfer, 0); @@ -596,7 +596,7 @@ kue_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -638,7 +638,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_mos.c Thu Sep 18 21:09:22 2014 (r271832) @@ -792,7 +792,7 @@ mos_bulk_read_callback(struct usb_xfer * case USB_ST_TRANSFERRED: MOS_DPRINTFN("actlen : %d", actlen); if (actlen <= 1) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } /* evaluate status byte at the end */ @@ -811,7 +811,7 @@ mos_bulk_read_callback(struct usb_xfer * MOS_DPRINTFN("CRC error"); if (rxstat & MOS_RXSTS_ALIGN_ERROR) MOS_DPRINTFN("alignment error"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } /* Remember the last byte was used for the status fields */ @@ -820,7 +820,7 @@ mos_bulk_read_callback(struct usb_xfer * MOS_DPRINTFN("error: pktlen %d is smaller " "than ether_header %zd", pktlen, sizeof(struct ether_header)); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } uether_rxbuf(ue, pc, 0, actlen); @@ -859,7 +859,7 @@ mos_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: MOS_DPRINTFN("transfer of complete"); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: @@ -886,11 +886,11 @@ tr_setup: usbd_transfer_submit(xfer); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); return; default: MOS_DPRINTFN("usb error on tx: %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); goto tr_setup; @@ -981,7 +981,7 @@ mos_intr_callback(struct usb_xfer *xfer, uint32_t pkt; int actlen; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); MOS_DPRINTFN("actlen %i", actlen); Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_rue.c Thu Sep 18 21:09:22 2014 (r271832) @@ -648,9 +648,9 @@ rue_intr_callback(struct usb_xfer *xfer, pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, &pkt, sizeof(pkt)); - ifp->if_ierrors += pkt.rue_rxlost_cnt; - ifp->if_ierrors += pkt.rue_crcerr_cnt; - ifp->if_collisions += pkt.rue_col_cnt; + if_inc_counter(ifp, IFCOUNTER_IERRORS, pkt.rue_rxlost_cnt); + if_inc_counter(ifp, IFCOUNTER_IERRORS, pkt.rue_crcerr_cnt); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, pkt.rue_col_cnt); } /* FALLTHROUGH */ case USB_ST_SETUP: @@ -685,7 +685,7 @@ rue_bulk_read_callback(struct usb_xfer * case USB_ST_TRANSFERRED: if (actlen < 4) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } pc = usbd_xfer_get_frame(xfer, 0); @@ -695,7 +695,7 @@ rue_bulk_read_callback(struct usb_xfer * /* check recieve packet was valid or not */ status = le16toh(status); if ((status & RUE_RXSTAT_VALID) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } uether_rxbuf(ue, pc, 0, actlen); @@ -732,7 +732,7 @@ rue_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -782,7 +782,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_smsc.c Thu Sep 18 21:09:22 2014 (r271832) @@ -989,9 +989,9 @@ smsc_bulk_read_callback(struct usb_xfer if (rxhdr & SMSC_RX_STAT_ERROR) { smsc_dbg_printf(sc, "rx error (hdr 0x%08x)\n", rxhdr); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (rxhdr & SMSC_RX_STAT_COLLISION) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } else { /* Check if the ethernet frame is too big or too small */ @@ -1002,7 +1002,7 @@ smsc_bulk_read_callback(struct usb_xfer m = uether_newbuf(); if (m == NULL) { smsc_warn_printf(sc, "failed to create new mbuf\n"); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } @@ -1158,7 +1158,7 @@ tr_setup: usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); frm_len += m->m_pkthdr.len; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* If there's a BPF listener, bounce a copy of this frame to him */ BPF_MTAP(ifp, m); @@ -1176,7 +1176,7 @@ tr_setup: return; default: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (error != USB_ERR_CANCELLED) { Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_udav.c Thu Sep 18 21:09:22 2014 (r271832) @@ -582,7 +582,7 @@ udav_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -638,7 +638,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ @@ -666,7 +666,7 @@ udav_bulk_read_callback(struct usb_xfer case USB_ST_TRANSFERRED: if (actlen < (int)(sizeof(stat) + ETHER_CRC_LEN)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } pc = usbd_xfer_get_frame(xfer, 0); @@ -676,11 +676,11 @@ udav_bulk_read_callback(struct usb_xfer len -= ETHER_CRC_LEN; if (stat.rxstat & UDAV_RSR_LCS) { - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); goto tr_setup; } if (stat.rxstat & UDAV_RSR_ERR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } uether_rxbuf(ue, pc, sizeof(stat), len); Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_urndis.c Thu Sep 18 21:09:22 2014 (r271832) @@ -844,12 +844,12 @@ urndis_bulk_read_callback(struct usb_xfe rm_dataoffset), actlen); goto tr_setup; } else if (msg.rm_datalen < (uint32_t)sizeof(struct ether_header)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF("invalid ethernet size " "%u < %u\n", msg.rm_datalen, (unsigned)sizeof(struct ether_header)); goto tr_setup; } else if (msg.rm_datalen > (uint32_t)MCLBYTES) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF("invalid ethernet size " "%u > %u\n", msg.rm_datalen, (unsigned)MCLBYTES); @@ -871,7 +871,7 @@ urndis_bulk_read_callback(struct usb_xfe /* enqueue */ uether_rxmbuf(&sc->sc_ue, m, msg.rm_datalen); } else { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } offset += msg.rm_len; actlen -= msg.rm_len; @@ -917,7 +917,7 @@ urndis_bulk_write_callback(struct usb_xf case USB_ST_TRANSFERRED: DPRINTFN(11, "%u bytes in %u frames\n", actlen, aframes); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -937,7 +937,7 @@ tr_setup: if ((m->m_pkthdr.len + sizeof(msg)) > RNDIS_TX_MAXLEN) { DPRINTF("Too big packet\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* Free buffer */ m_freem(m); @@ -973,7 +973,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); /* count output errors */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ Modified: head/sys/dev/usb/net/if_usie.c ============================================================================== --- head/sys/dev/usb/net/if_usie.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/if_usie.c Thu Sep 18 21:09:22 2014 (r271832) @@ -806,7 +806,7 @@ tr_setup: } if (sc->sc_rxm == NULL) { DPRINTF("could not allocate Rx mbuf\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); usbd_xfer_set_stall(xfer); usbd_xfer_set_frames(xfer, 0); } else { @@ -828,7 +828,7 @@ tr_setup: if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } if (sc->sc_rxm != NULL) { @@ -917,8 +917,8 @@ tr_setup: mtx_lock(&sc->sc_mtx); - ifp->if_ierrors += err; - ifp->if_ipackets += pkt; + if_inc_counter(ifp, IFCOUNTER_IERRORS, err); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, pkt); } static void @@ -934,7 +934,7 @@ usie_if_tx_callback(struct usb_xfer *xfe case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* fall though */ case USB_ST_SETUP: @@ -974,11 +974,11 @@ tr_setup: default: /* Error */ DPRINTF("USB transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } break; @@ -1214,10 +1214,10 @@ usie_if_output(struct ifnet *ifp, struct err = (ifp->if_transmit)(ifp, m); if (err) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); return (0); } @@ -1395,7 +1395,7 @@ usie_cns_req(struct usie_softc *sc, uint m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { DPRINTF("could not allocate mbuf\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } /* to align usie_hip{} on 32 bit */ Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/uhso.c Thu Sep 18 21:09:22 2014 (r271832) @@ -1694,7 +1694,7 @@ uhso_if_rxflush(void *arg) m = m_pullup(m0, sizeof(struct ip)); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); UHSO_DPRINTF(0, "m_pullup failed\n"); mtx_lock(&sc->sc_mtx); continue; @@ -1724,7 +1724,7 @@ uhso_if_rxflush(void *arg) else { UHSO_DPRINTF(0, "got unexpected ip version %d, " "m=%p, len=%d\n", (*cp & 0xf0) >> 4, m, m->m_len); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); UHSO_HEXDUMP(cp, 4); m_freem(m); m = NULL; @@ -1734,7 +1734,7 @@ uhso_if_rxflush(void *arg) if (iplen == 0) { UHSO_DPRINTF(0, "Zero IP length\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); m = NULL; mtx_lock(&sc->sc_mtx); @@ -1775,7 +1775,7 @@ uhso_if_rxflush(void *arg) continue; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; /* Dispatch to IP layer */ @@ -1803,7 +1803,7 @@ uhso_ifnet_write_callback(struct usb_xfe switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; case USB_ST_SETUP: tr_setup: @@ -1898,10 +1898,10 @@ uhso_if_output(struct ifnet *ifp, struct error = (ifp->if_transmit)(ifp, m0); if (error) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); return (0); } Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Thu Sep 18 21:07:05 2014 (r271831) +++ head/sys/dev/usb/net/usb_ethernet.c Thu Sep 18 21:09:22 2014 (r271832) @@ -580,7 +580,7 @@ uether_rxmbuf(struct usb_ether *ue, stru UE_LOCK_ASSERT(ue, MA_OWNED); /* finalize mbuf */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; @@ -603,14 +603,14 @@ uether_rxbuf(struct usb_ether *ue, struc m = uether_newbuf(); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (ENOMEM); } usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); /* finalize mbuf */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:11:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABB7851F; Thu, 18 Sep 2014 21:11:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0816C0; Thu, 18 Sep 2014 21:11:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILBgZk068957; Thu, 18 Sep 2014 21:11:42 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILBgDT068956; Thu, 18 Sep 2014 21:11:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182111.s8ILBgDT068956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271833 - head/sys/dev/alc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:11:42 -0000 Author: glebius Date: Thu Sep 18 21:11:42 2014 New Revision: 271833 URL: http://svnweb.freebsd.org/changeset/base/271833 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Thu Sep 18 21:09:22 2014 (r271832) +++ head/sys/dev/alc/if_alc.c Thu Sep 18 21:11:42 2014 (r271833) @@ -2323,13 +2323,13 @@ alc_watchdog(struct alc_softc *sc) ifp = sc->alc_ifp; if ((sc->alc_flags & ALC_FLAG_LINK) == 0) { if_printf(sc->alc_ifp, "watchdog timeout (lost link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; alc_init_locked(sc); return; } if_printf(sc->alc_ifp, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; alc_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2608,11 +2608,11 @@ alc_stats_update(struct alc_softc *sc) stat->tx_mcast_bytes += smb->tx_mcast_bytes; /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, smb->tx_frames); - ifp->if_collisions += smb->tx_single_colls + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls + smb->tx_multi_colls * 2 + smb->tx_late_colls + - smb->tx_abort * HDPX_CFG_RETRY_DEFAULT; + smb->tx_abort * HDPX_CFG_RETRY_DEFAULT); /* * XXX @@ -2621,15 +2621,16 @@ alc_stats_update(struct alc_softc *sc) * the counter name is not correct one so I've removed the * counter in output errors. */ - ifp->if_oerrors += smb->tx_abort + smb->tx_late_colls + - smb->tx_underrun; + if_inc_counter(ifp, IFCOUNTER_OERRORS, + smb->tx_abort + smb->tx_late_colls + smb->tx_underrun); - ifp->if_ipackets += smb->rx_frames; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames); - ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs + + if_inc_counter(ifp, IFCOUNTER_IERRORS, + smb->rx_crcerrs + smb->rx_lenerrs + smb->rx_runts + smb->rx_pkts_truncated + smb->rx_fifo_oflows + smb->rx_rrs_errs + - smb->rx_alignerrs; + smb->rx_alignerrs); if ((sc->alc_flags & ALC_FLAG_SMB_BUG) == 0) { /* Update done, clear. */ @@ -2921,7 +2922,7 @@ alc_fixup_rx(struct ifnet *ifp, struct m */ MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); m_freem(m); return (NULL); } @@ -2977,7 +2978,7 @@ alc_rxeof(struct alc_softc *sc, struct r mp = rxd->rx_m; /* Add a new receive buffer to the ring. */ if (alc_newbuf(sc, rxd) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); /* Reuse Rx buffers. */ if (sc->alc_cdata.alc_rxhead != NULL) m_freem(sc->alc_cdata.alc_rxhead); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:13:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2474366F; Thu, 18 Sep 2014 21:13:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04BD66D1; Thu, 18 Sep 2014 21:13:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILD4SC069189; Thu, 18 Sep 2014 21:13:04 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILD4ED069183; Thu, 18 Sep 2014 21:13:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409182113.s8ILD4ED069183@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Sep 2014 21:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271834 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:13:05 -0000 Author: bz Date: Thu Sep 18 21:13:03 2014 New Revision: 271834 URL: http://svnweb.freebsd.org/changeset/base/271834 Log: Revert r270808, which were changes to common code (i40e_alloc.h). Rather than #define-ing common code function calls to OS-dependent ones, make the osdep versions match the common code expectations, adjust the FreeBSD specific code to use those, and remove the #defines. In the FreeBSD specific code, use "i40e_mem_reserved" for the now expected but unused argument to i40e_allocate_dma_mem(). Reviewed by: gnn, eric.joyner intel.com MFC after: 3 days Modified: head/sys/dev/ixl/i40e_alloc.h head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/i40e_alloc.h ============================================================================== --- head/sys/dev/ixl/i40e_alloc.h Thu Sep 18 21:11:42 2014 (r271833) +++ head/sys/dev/ixl/i40e_alloc.h Thu Sep 18 21:13:03 2014 (r271834) @@ -51,15 +51,16 @@ enum i40e_memory_type { }; /* prototype for functions used for dynamic memory allocation */ -enum i40e_status_code i40e_allocate_dma(struct i40e_hw *hw, +enum i40e_status_code i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem, - bus_size_t size, u32 alignment); -enum i40e_status_code i40e_free_dma(struct i40e_hw *hw, + enum i40e_memory_type type, + u64 size, u32 alignment); +enum i40e_status_code i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem); -enum i40e_status_code i40e_allocate_virt(struct i40e_hw *hw, +enum i40e_status_code i40e_allocate_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size); -enum i40e_status_code i40e_free_virt(struct i40e_hw *hw, +enum i40e_status_code i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem); #endif /* _I40E_ALLOC_H_ */ Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Thu Sep 18 21:11:42 2014 (r271833) +++ head/sys/dev/ixl/i40e_osdep.c Thu Sep 18 21:13:03 2014 (r271834) @@ -49,22 +49,22 @@ i40e_dmamap_cb(void *arg, bus_dma_segmen } i40e_status -i40e_allocate_virt(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size) +i40e_allocate_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size) { mem->va = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); return(mem->va == NULL); } i40e_status -i40e_free_virt(struct i40e_hw *hw, struct i40e_virt_mem *mem) +i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem) { free(mem->va, M_DEVBUF); return(0); } i40e_status -i40e_allocate_dma(struct i40e_hw *hw, struct i40e_dma_mem *mem, - bus_size_t size, u32 alignment) +i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem, + enum i40e_memory_type type __unused, u64 size, u32 alignment) { device_t dev = ((struct i40e_osdep *)hw->back)->dev; int err; @@ -122,7 +122,7 @@ fail_0: } i40e_status -i40e_free_dma(struct i40e_hw *hw, struct i40e_dma_mem *mem) +i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem) { bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); Modified: head/sys/dev/ixl/i40e_osdep.h ============================================================================== --- head/sys/dev/ixl/i40e_osdep.h Thu Sep 18 21:11:42 2014 (r271833) +++ head/sys/dev/ixl/i40e_osdep.h Thu Sep 18 21:13:03 2014 (r271834) @@ -170,9 +170,6 @@ struct i40e_hw; /* forward decl */ u16 i40e_read_pci_cfg(struct i40e_hw *, u32); void i40e_write_pci_cfg(struct i40e_hw *, u32, u16); -#define i40e_allocate_dma_mem(h, m, unused, s, a) i40e_allocate_dma(h, m, s, a) -#define i40e_free_dma_mem(h, m) i40e_free_dma(h, m) - #define i40e_debug(h, m, s, ...) i40e_debug_d(h, m, s, ##__VA_ARGS__) extern void i40e_debug_d(void *hw, u32 mask, char *fmt_str, ...); @@ -180,8 +177,6 @@ struct i40e_virt_mem { void *va; u32 size; }; -#define i40e_allocate_virt_mem(h, m, s) i40e_allocate_virt(h, m, s) -#define i40e_free_virt_mem(h, m) i40e_free_virt(h, m) /* ** This hardware supports either 16 or 32 byte rx descriptors Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu Sep 18 21:11:42 2014 (r271833) +++ head/sys/dev/ixl/if_ixl.c Thu Sep 18 21:13:03 2014 (r271834) @@ -2591,7 +2591,7 @@ ixl_free_vsi(struct ixl_vsi *vsi) IXL_TX_LOCK(txr); ixl_free_que_tx(que); if (txr->base) - i40e_free_dma(&pf->hw, &txr->dma); + i40e_free_dma_mem(&pf->hw, &txr->dma); IXL_TX_UNLOCK(txr); IXL_TX_LOCK_DESTROY(txr); @@ -2600,7 +2600,7 @@ ixl_free_vsi(struct ixl_vsi *vsi) IXL_RX_LOCK(rxr); ixl_free_que_rx(que); if (rxr->base) - i40e_free_dma(&pf->hw, &rxr->dma); + i40e_free_dma_mem(&pf->hw, &rxr->dma); IXL_RX_UNLOCK(rxr); IXL_RX_LOCK_DESTROY(rxr); @@ -2668,8 +2668,8 @@ ixl_setup_stations(struct ixl_pf *pf) tsize = roundup2((que->num_desc * sizeof(struct i40e_tx_desc)) + sizeof(u32), DBA_ALIGN); - if (i40e_allocate_dma(&pf->hw, - &txr->dma, tsize, DBA_ALIGN)) { + if (i40e_allocate_dma_mem(&pf->hw, + &txr->dma, i40e_mem_reserved, tsize, DBA_ALIGN)) { device_printf(dev, "Unable to allocate TX Descriptor memory\n"); error = ENOMEM; @@ -2708,8 +2708,8 @@ ixl_setup_stations(struct ixl_pf *pf) device_get_nameunit(dev), que->me); mtx_init(&rxr->mtx, rxr->mtx_name, NULL, MTX_DEF); - if (i40e_allocate_dma(&pf->hw, - &rxr->dma, rsize, 4096)) { + if (i40e_allocate_dma_mem(&pf->hw, + &rxr->dma, i40e_mem_reserved, rsize, 4096)) { device_printf(dev, "Unable to allocate RX Descriptor memory\n"); error = ENOMEM; @@ -2735,9 +2735,9 @@ fail: rxr = &que->rxr; txr = &que->txr; if (rxr->base) - i40e_free_dma(&pf->hw, &rxr->dma); + i40e_free_dma_mem(&pf->hw, &rxr->dma); if (txr->base) - i40e_free_dma(&pf->hw, &txr->dma); + i40e_free_dma_mem(&pf->hw, &txr->dma); } early: Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Thu Sep 18 21:11:42 2014 (r271833) +++ head/sys/dev/ixl/if_ixlv.c Thu Sep 18 21:13:03 2014 (r271834) @@ -1457,8 +1457,8 @@ ixlv_setup_queues(struct ixlv_sc *sc) tsize = roundup2((que->num_desc * sizeof(struct i40e_tx_desc)) + sizeof(u32), DBA_ALIGN); - if (i40e_allocate_dma(&sc->hw, - &txr->dma, tsize, DBA_ALIGN)) { + if (i40e_allocate_dma_mem(&sc->hw, + &txr->dma, i40e_mem_reserved, tsize, DBA_ALIGN)) { device_printf(dev, "Unable to allocate TX Descriptor memory\n"); error = ENOMEM; @@ -1497,8 +1497,8 @@ ixlv_setup_queues(struct ixlv_sc *sc) device_get_nameunit(dev), que->me); mtx_init(&rxr->mtx, rxr->mtx_name, NULL, MTX_DEF); - if (i40e_allocate_dma(&sc->hw, - &rxr->dma, rsize, 4096)) { //JFV - should this be DBA? + if (i40e_allocate_dma_mem(&sc->hw, + &rxr->dma, i40e_mem_reserved, rsize, 4096)) { //JFV - should this be DBA? device_printf(dev, "Unable to allocate RX Descriptor memory\n"); error = ENOMEM; @@ -1525,9 +1525,9 @@ fail: rxr = &que->rxr; txr = &que->txr; if (rxr->base) - i40e_free_dma(&sc->hw, &rxr->dma); + i40e_free_dma_mem(&sc->hw, &rxr->dma); if (txr->base) - i40e_free_dma(&sc->hw, &txr->dma); + i40e_free_dma_mem(&sc->hw, &txr->dma); } early: @@ -2346,7 +2346,7 @@ ixlv_free_queues(struct ixl_vsi *vsi) IXL_TX_LOCK(txr); ixl_free_que_tx(que); if (txr->base) - i40e_free_dma(&sc->hw, &txr->dma); + i40e_free_dma_mem(&sc->hw, &txr->dma); IXL_TX_UNLOCK(txr); IXL_TX_LOCK_DESTROY(txr); @@ -2355,7 +2355,7 @@ ixlv_free_queues(struct ixl_vsi *vsi) IXL_RX_LOCK(rxr); ixl_free_que_rx(que); if (rxr->base) - i40e_free_dma(&sc->hw, &rxr->dma); + i40e_free_dma_mem(&sc->hw, &rxr->dma); IXL_RX_UNLOCK(rxr); IXL_RX_LOCK_DESTROY(rxr); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:13:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0CEE7BD; Thu, 18 Sep 2014 21:13:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FE896D2; Thu, 18 Sep 2014 21:13:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILDDu9069254; Thu, 18 Sep 2014 21:13:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILDDsk069253; Thu, 18 Sep 2014 21:13:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182113.s8ILDDsk069253@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271835 - head/sys/dev/ale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:13:13 -0000 Author: glebius Date: Thu Sep 18 21:13:12 2014 New Revision: 271835 URL: http://svnweb.freebsd.org/changeset/base/271835 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ale/if_ale.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Thu Sep 18 21:13:03 2014 (r271834) +++ head/sys/dev/ale/if_ale.c Thu Sep 18 21:13:12 2014 (r271835) @@ -1953,13 +1953,13 @@ ale_watchdog(struct ale_softc *sc) ifp = sc->ale_ifp; if ((sc->ale_flags & ALE_FLAG_LINK) == 0) { if_printf(sc->ale_ifp, "watchdog timeout (lost link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ale_init_locked(sc); return; } if_printf(sc->ale_ifp, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ale_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2206,11 +2206,11 @@ ale_stats_update(struct ale_softc *sc) stat->tx_mcast_bytes += smb->tx_mcast_bytes; /* Update counters in ifnet. */ - ifp->if_opackets += smb->tx_frames; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, smb->tx_frames); - ifp->if_collisions += smb->tx_single_colls + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls + smb->tx_multi_colls * 2 + smb->tx_late_colls + - smb->tx_abort * HDPX_CFG_RETRY_DEFAULT; + smb->tx_abort * HDPX_CFG_RETRY_DEFAULT); /* * XXX @@ -2219,15 +2219,16 @@ ale_stats_update(struct ale_softc *sc) * the counter name is not correct one so I've removed the * counter in output errors. */ - ifp->if_oerrors += smb->tx_abort + smb->tx_late_colls + - smb->tx_underrun; + if_inc_counter(ifp, IFCOUNTER_OERRORS, + smb->tx_abort + smb->tx_late_colls + smb->tx_underrun); - ifp->if_ipackets += smb->rx_frames; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames); - ifp->if_ierrors += smb->rx_crcerrs + smb->rx_lenerrs + + if_inc_counter(ifp, IFCOUNTER_IERRORS, + smb->rx_crcerrs + smb->rx_lenerrs + smb->rx_runts + smb->rx_pkts_truncated + smb->rx_fifo_oflows + smb->rx_rrs_errs + - smb->rx_alignerrs; + smb->rx_alignerrs); } static int @@ -2549,7 +2550,7 @@ ale_rxeof(struct ale_softc *sc, int coun m = m_devget((char *)(rs + 1), length - ETHER_CRC_LEN, ETHER_ALIGN, ifp, NULL); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); ale_rx_update_page(sc, &rx_page, length, &prod); continue; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:14:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BC68911; Thu, 18 Sep 2014 21:14:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD0C6E4; Thu, 18 Sep 2014 21:14:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILElI3069489; Thu, 18 Sep 2014 21:14:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILElwh069488; Thu, 18 Sep 2014 21:14:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182114.s8ILElwh069488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271836 - head/sys/dev/cs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:14:47 -0000 Author: glebius Date: Thu Sep 18 21:14:46 2014 New Revision: 271836 URL: http://svnweb.freebsd.org/changeset/base/271836 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/cs/if_cs.c Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Thu Sep 18 21:13:12 2014 (r271835) +++ head/sys/dev/cs/if_cs.c Thu Sep 18 21:14:46 2014 (r271836) @@ -707,7 +707,7 @@ cs_get_packet(struct cs_softc *sc) #ifdef CS_DEBUG device_printf(sc->dev, "bad pkt stat %x\n", status); #endif - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (-1); } @@ -742,7 +742,7 @@ cs_get_packet(struct cs_softc *sc) (ifp->if_flags & IFF_MULTICAST && status & RX_HASHED)) { /* Feed the packet to the upper layer */ (*ifp->if_input)(ifp, m); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if (length == ETHER_MAX_LEN-ETHER_CRC_LEN) DELAY(cs_recv_delay); } else { @@ -780,9 +780,9 @@ csintr(void *arg) case ISQ_TRANSMITTER_EVENT: if (status & TX_OK) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->tx_timeout = 0; break; @@ -796,16 +796,16 @@ csintr(void *arg) if (status & TX_UNDERRUN) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->tx_timeout = 0; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } break; case ISQ_RX_MISS_EVENT: - ifp->if_ierrors+=(status>>6); + if_inc_counter(ifp, IFCOUNTER_IERRORS, status >> 6); break; case ISQ_TX_COL_EVENT: - ifp->if_collisions+=(status>>6); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, status >> 6); break; } } @@ -1114,7 +1114,7 @@ cs_watchdog(void *arg) CS_ASSERT_LOCKED(sc); if (sc->tx_timeout && --sc->tx_timeout == 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); log(LOG_ERR, "%s: device timeout\n", ifp->if_xname); /* Reset the interface */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:16:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 533ADA6A; Thu, 18 Sep 2014 21:16:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 246386F1; Thu, 18 Sep 2014 21:16:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILG62E069751; Thu, 18 Sep 2014 21:16:06 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILG6wr069750; Thu, 18 Sep 2014 21:16:06 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182116.s8ILG6wr069750@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271837 - head/sys/dev/stge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:16:06 -0000 Author: glebius Date: Thu Sep 18 21:16:05 2014 New Revision: 271837 URL: http://svnweb.freebsd.org/changeset/base/271837 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/stge/if_stge.c Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Thu Sep 18 21:14:46 2014 (r271836) +++ head/sys/dev/stge/if_stge.c Thu Sep 18 21:16:05 2014 (r271837) @@ -1236,7 +1236,7 @@ stge_watchdog(struct stge_softc *sc) ifp = sc->sc_ifp; if_printf(sc->sc_ifp, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1684,7 +1684,7 @@ stge_rxeof(struct stge_softc *sc) * Add a new receive buffer to the ring. */ if (stge_newbuf(sc, cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); stge_discard_rxbuf(sc, cons); if (sc->sc_cdata.stge_rxhead != NULL) { m_freem(sc->sc_cdata.stge_rxhead); @@ -1874,22 +1874,22 @@ stge_stats_update(struct stge_softc *sc) CSR_READ_4(sc,STGE_OctetRcvOk); - ifp->if_ipackets += CSR_READ_4(sc, STGE_FramesRcvdOk); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, CSR_READ_4(sc, STGE_FramesRcvdOk)); - ifp->if_ierrors += CSR_READ_2(sc, STGE_FramesLostRxErrors); + if_inc_counter(ifp, IFCOUNTER_IERRORS, CSR_READ_2(sc, STGE_FramesLostRxErrors)); CSR_READ_4(sc, STGE_OctetXmtdOk); - ifp->if_opackets += CSR_READ_4(sc, STGE_FramesXmtdOk); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, CSR_READ_4(sc, STGE_FramesXmtdOk)); - ifp->if_collisions += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, CSR_READ_4(sc, STGE_LateCollisions) + CSR_READ_4(sc, STGE_MultiColFrames) + - CSR_READ_4(sc, STGE_SingleColFrames); + CSR_READ_4(sc, STGE_SingleColFrames)); - ifp->if_oerrors += + if_inc_counter(ifp, IFCOUNTER_OERRORS, CSR_READ_2(sc, STGE_FramesAbortXSColls) + - CSR_READ_2(sc, STGE_FramesWEXDeferal); + CSR_READ_2(sc, STGE_FramesWEXDeferal)); } /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:19:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AD0BCDD; Thu, 18 Sep 2014 21:19:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A5C8781; Thu, 18 Sep 2014 21:19:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILJMCh070158; Thu, 18 Sep 2014 21:19:22 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILJM0G070157; Thu, 18 Sep 2014 21:19:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409182119.s8ILJM0G070157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 21:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271838 - head/sys/dev/sf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:19:22 -0000 Author: glebius Date: Thu Sep 18 21:19:21 2014 New Revision: 271838 URL: http://svnweb.freebsd.org/changeset/base/271838 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/sf/if_sf.c Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Thu Sep 18 21:16:05 2014 (r271837) +++ head/sys/dev/sf/if_sf.c Thu Sep 18 21:19:21 2014 (r271838) @@ -1566,7 +1566,7 @@ sf_rxeof(struct sf_softc *sc) m = rxd->rx_m; /* - * Note, if_ipackets and if_ierrors counters + * Note, IFCOUNTER_IPACKETS and ICOUNTER_IERRORS * are handled in sf_stats_update(). */ if ((status & SF_RXSTAT1_OK) == 0) { @@ -1575,7 +1575,7 @@ sf_rxeof(struct sf_softc *sc) } if (sf_newbuf(sc, eidx) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); cur_cmp->sf_rx_status1 = 0; continue; } @@ -1720,8 +1720,9 @@ sf_txeof(struct sf_softc *sc) /* * We don't need to check Tx status here. * SF_ISR_TX_LOFIFO intr would handle this. - * Note, if_opackets, if_collisions and if_oerrors - * counters are handled in sf_stats_update(). + * Note, IFCOUNTER_OPACKETS, IFCOUNTER_COLLISIONS + * and IFCOUNTER_OERROR are handled in + * sf_stats_update(). */ txd = &sc->sf_cdata.sf_txdesc[idx]; if (txd->tx_m != NULL) { @@ -2479,23 +2480,26 @@ sf_stats_update(struct sf_softc *sc) for (i = SF_STATS_BASE; i < (SF_STATS_END + 1); i += sizeof(uint32_t)) csr_write_4(sc, i, 0); - ifp->if_opackets += (u_long)stats->sf_tx_frames; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, (u_long)stats->sf_tx_frames); - ifp->if_collisions += (u_long)stats->sf_tx_single_colls + - (u_long)stats->sf_tx_multi_colls; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + (u_long)stats->sf_tx_single_colls + + (u_long)stats->sf_tx_multi_colls); - ifp->if_oerrors += (u_long)stats->sf_tx_excess_colls + + if_inc_counter(ifp, IFCOUNTER_OERRORS, + (u_long)stats->sf_tx_excess_colls + (u_long)stats->sf_tx_excess_defer + - (u_long)stats->sf_tx_frames_lost; + (u_long)stats->sf_tx_frames_lost); - ifp->if_ipackets += (u_long)stats->sf_rx_frames; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, (u_long)stats->sf_rx_frames); - ifp->if_ierrors += (u_long)stats->sf_rx_crcerrs + + if_inc_counter(ifp, IFCOUNTER_IERRORS, + (u_long)stats->sf_rx_crcerrs + (u_long)stats->sf_rx_alignerrs + (u_long)stats->sf_rx_giants + (u_long)stats->sf_rx_runts + (u_long)stats->sf_rx_jabbererrs + - (u_long)stats->sf_rx_frames_lost; + (u_long)stats->sf_rx_frames_lost); nstats = &sc->sf_statistics; @@ -2546,7 +2550,7 @@ sf_watchdog(struct sf_softc *sc) ifp = sc->sf_ifp; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (sc->sf_link == 0) { if (bootverbose) if_printf(sc->sf_ifp, "watchdog timeout " From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:39:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4E9A574; Thu, 18 Sep 2014 21:39:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91FA494F; Thu, 18 Sep 2014 21:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILd11c079900; Thu, 18 Sep 2014 21:39:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILd0aT079892; Thu, 18 Sep 2014 21:39:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409182139.s8ILd0aT079892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 21:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271839 - in head/sys/cam: ctl 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:39:01 -0000 Author: mav Date: Thu Sep 18 21:39:00 2014 New Revision: 271839 URL: http://svnweb.freebsd.org/changeset/base/271839 Log: Add support for "no Data-Out Buffer" (NDOB) flag of WRITE SAME (16) command. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Sep 18 21:19:21 2014 (r271838) +++ head/sys/cam/ctl/ctl.c Thu Sep 18 21:39:00 2014 (r271839) @@ -5993,6 +5993,14 @@ ctl_write_same(struct ctl_scsiio *ctsio) break; /* NOTREACHED */ } + /* NDOB flag can be used only together with UNMAP */ + if ((byte2 & (SWS_NDOB | SWS_UNMAP)) == SWS_NDOB) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, + /*command*/ 1, /*field*/ 1, /*bit_valid*/ 1, /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + /* * The first check is to make sure we're in bounds, the second * check is to catch wrap-around problems. If the lba + num blocks @@ -6027,7 +6035,8 @@ ctl_write_same(struct ctl_scsiio *ctsio) * If we've got a kernel request that hasn't been malloced yet, * malloc it and tell the caller the data buffer is here. */ - if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + if ((byte2 & SWS_NDOB) == 0 && + (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK);; ctsio->kern_data_len = len; ctsio->kern_total_len = len; Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Sep 18 21:19:21 2014 (r271838) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Sep 18 21:39:00 2014 (r271839) @@ -1042,7 +1042,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b softc = be_lun->softc; lbalen = ARGS(beio->io); - if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP | SWS_ANCHOR) || + if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP | SWS_ANCHOR | SWS_NDOB) || (lbalen->flags & (SWS_UNMAP | SWS_ANCHOR) && be_lun->unmap == NULL)) { ctl_free_beio(beio); ctl_set_invalid_field(&io->scsiio, Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Thu Sep 18 21:19:21 2014 (r271838) +++ head/sys/cam/ctl/ctl_cmd_table.c Thu Sep 18 21:39:00 2014 (r271839) @@ -1085,7 +1085,7 @@ const struct ctl_cmd_entry ctl_cmd_table {ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 16, {0x1b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 94 */ Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Sep 18 21:19:21 2014 (r271838) +++ head/sys/cam/scsi/scsi_all.h Thu Sep 18 21:39:00 2014 (r271839) @@ -1030,6 +1030,7 @@ struct scsi_write_same_16 { uint8_t opcode; uint8_t byte2; +#define SWS_NDOB 0x01 uint8_t addr[8]; uint8_t length[4]; uint8_t group; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 21:48:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3EF37FD; Thu, 18 Sep 2014 21:48:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C338AA32; Thu, 18 Sep 2014 21:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ILm62J084428; Thu, 18 Sep 2014 21:48:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ILm6il084424; Thu, 18 Sep 2014 21:48:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182148.s8ILm6il084424@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 21:48:06 +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: r271840 - in stable/9/sys: net netinet 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 21:48:07 -0000 Author: asomers Date: Thu Sep 18 21:48:05 2014 New Revision: 271840 URL: http://svnweb.freebsd.org/changeset/base/271840 Log: MFC r264905 and r266860, except for the ATF parts. r266860 Fix unintended KBI change from r264905. Add _fib versions of ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the _fib() versions with RT_ALL_FIBS, preserving legacy behavior. sys/net/if_var.h sys/net/if.c Add legacy-compatible functions as described above. Ensure legacy behavior when RT_ALL_FIBS is passed as fibnum. sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/net/route.c sys/net/rtsock.c sys/netinet6/nd6.c Call with _fib() functions if we must use a specific fib, or the legacy functions otherwise. r264905 Fix subnet and default routes on different FIBs on the same subnet. These two bugs are closely related. The root cause is that ifa_ifwithnet does not consider FIBs when searching for an interface address. sys/net/if_var.h sys/net/if.c Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr. Those functions will only return an address whose interface fib equals the argument. sys/net/route.c Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib arguments. sys/netinet/in.c Update in_addprefix to consider the interface fib when adding prefixes. This will prevent it from not adding a subnet route when one already exists on a different fib. sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/netinet6/nd6.c Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet. In some cases it there wasn't a clear specific fib number to use. In others, I was unable to test those functions so I chose RT_DEFAULT_FIB to minimize divergence from current behavior. I will fix some of the latter changes along with PR kern/187553. PR: kern/187550 PR: kern/187552 Modified: stable/9/sys/net/if.c stable/9/sys/net/if_var.h stable/9/sys/net/route.c stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/net/if.c Thu Sep 18 21:48:05 2014 (r271840) @@ -1628,7 +1628,7 @@ done: */ /*ARGSUSED*/ struct ifaddr * -ifa_ifwithdstaddr(struct sockaddr *addr) +ifa_ifwithdstaddr_fib(struct sockaddr *addr, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1637,6 +1637,8 @@ ifa_ifwithdstaddr(struct sockaddr *addr) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) @@ -1656,12 +1658,19 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithdstaddr(struct sockaddr *addr) +{ + + return (ifa_ifwithdstaddr_fib(addr, RT_ALL_FIBS)); +} + /* * Find an interface on a specific network. If many, choice * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +ifa_ifwithnet_fib(struct sockaddr *addr, int ignore_ptp, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1681,12 +1690,14 @@ ifa_ifwithnet(struct sockaddr *addr, int /* * Scan though each interface, looking for ones that have addresses - * in this address family. Maintain a reference on ifa_maybe once - * we find one, as we release the IF_ADDR_RLOCK() that kept it stable - * when we move onto the next interface. + * in this address family and the requested fib. Maintain a reference + * on ifa_maybe once we find one, as we release the IF_ADDR_RLOCK() that + * kept it stable when we move onto the next interface. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { char *cp, *cp2, *cp3; @@ -1768,6 +1779,13 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +{ + + return (ifa_ifwithnet_fib(addr, ignore_ptp, RT_ALL_FIBS)); +} + /* * Find an interface address specific to an interface best matching * a given address. Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/net/if_var.h Thu Sep 18 21:48:05 2014 (r271840) @@ -940,7 +940,9 @@ struct ifaddr *ifa_ifwithaddr(struct soc int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); +struct ifaddr *ifa_ifwithdstaddr_fib(struct sockaddr *, int); struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); +struct ifaddr *ifa_ifwithnet_fib(struct sockaddr *, int, int); struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/net/route.c Thu Sep 18 21:48:05 2014 (r271840) @@ -553,7 +553,7 @@ rtredirect_fib(struct sockaddr *dst, } /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway, 0)) == NULL) { + if ((ifa = ifa_ifwithnet_fib(gateway, 0, fibnum)) == NULL) { error = ENETUNREACH; goto out; } @@ -710,7 +710,7 @@ ifa_ifwithroute_fib(int flags, struct so */ ifa = NULL; if (flags & RTF_HOST) - ifa = ifa_ifwithdstaddr(dst); + ifa = ifa_ifwithdstaddr_fib(dst, fibnum); if (ifa == NULL) ifa = ifa_ifwithaddr(gateway); } else { @@ -719,10 +719,10 @@ ifa_ifwithroute_fib(int flags, struct so * or host, the gateway may still be on the * other end of a pt to pt link. */ - ifa = ifa_ifwithdstaddr(gateway); + ifa = ifa_ifwithdstaddr_fib(gateway, fibnum); } if (ifa == NULL) - ifa = ifa_ifwithnet(gateway, 0); + ifa = ifa_ifwithnet_fib(gateway, 0, fibnum); if (ifa == NULL) { struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) @@ -836,7 +836,7 @@ rt_getifa_fib(struct rt_addrinfo *info, */ if (info->rti_ifp == NULL && ifpaddr != NULL && ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr, 0)) != NULL) { + (ifa = ifa_ifwithnet_fib(ifpaddr, 0, fibnum)) != NULL) { info->rti_ifp = ifa->ifa_ifp; ifa_free(ifa); } Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 21:39:00 2014 (r271839) +++ stable/9/sys/netinet/in.c Thu Sep 18 21:48:05 2014 (r271840) @@ -968,7 +968,7 @@ in_addprefix(struct in_ifaddr *target, i { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error, fibnum; + int error; if ((flags & RTF_HOST) != 0) { prefix = target->ia_dstaddr.sin_addr; @@ -979,9 +979,8 @@ in_addprefix(struct in_ifaddr *target, i prefix.s_addr &= mask.s_addr; } - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - IN_IFADDR_RLOCK(); + /* Look for an existing address with the same prefix, mask, and fib */ TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) { p = ia->ia_dstaddr.sin_addr; @@ -997,6 +996,8 @@ in_addprefix(struct in_ifaddr *target, i mask.s_addr != m.s_addr) continue; } + if (target->ia_ifp->if_fib != ia->ia_ifp->if_fib) + continue; /* * If we got a matching prefix route inserted by other @@ -1017,6 +1018,10 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_ADD, &target->ia_ifa, fibnum); IN_IFADDR_RUNLOCK(); return (0); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 22:10:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B5F8D51; Thu, 18 Sep 2014 22:10:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44879C1E; Thu, 18 Sep 2014 22:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMAoep097105; Thu, 18 Sep 2014 22:10:50 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMAoiO097104; Thu, 18 Sep 2014 22:10:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409182210.s8IMAoiO097104@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Sep 2014 22:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271841 - head/sys/dev/smc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 22:10:50 -0000 Author: bz Date: Thu Sep 18 22:10:49 2014 New Revision: 271841 URL: http://svnweb.freebsd.org/changeset/base/271841 Log: Fx a type from r271817; it's IFCOUNTER_* not IFNET_*. Modified: head/sys/dev/smc/if_smc.c Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Thu Sep 18 21:48:05 2014 (r271840) +++ head/sys/dev/smc/if_smc.c Thu Sep 18 22:10:49 2014 (r271841) @@ -909,7 +909,7 @@ smc_task_intr(void *context, int pending smc_select_bank(sc, 0); counter = smc_read_2(sc, ECR); smc_select_bank(sc, 2); - if_inc_counter(ifp, IFNET_COLLISIONS, + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, ((counter & ECR_SNGLCOL_MASK) >> ECR_SNGLCOL_SHIFT) + ((counter & ECR_MULCOL_MASK) >> ECR_MULCOL_SHIFT)); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 22:12:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB186EB7; Thu, 18 Sep 2014 22:12:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6B1CB3; Thu, 18 Sep 2014 22:12:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMCqwi097876; Thu, 18 Sep 2014 22:12:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMCqNw097875; Thu, 18 Sep 2014 22:12:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201409182212.s8IMCqNw097875@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 18 Sep 2014 22:12:52 +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: r271842 - stable/9/sys/netinet 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 22:12:52 -0000 Author: asomers Date: Thu Sep 18 22:12:52 2014 New Revision: 271842 URL: http://svnweb.freebsd.org/changeset/base/271842 Log: MFC r265092, except for the ATF bits. Fix a panic when removing an IP address from an interface, if the same address exists on another interface. The panic was introduced by change 264887, which changed the fibnum parameter in the call to rtalloc1_fib() in ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS. The solution is to use the interface fib in that call. For the majority of users, that will be equivalent to the legacy behavior. PR: kern/189089 Modified: stable/9/sys/netinet/in.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Sep 18 22:10:49 2014 (r271841) +++ stable/9/sys/netinet/in.c Thu Sep 18 22:12:52 2014 (r271842) @@ -1051,11 +1051,9 @@ in_scrubprefix(struct in_ifaddr *target, { struct in_ifaddr *ia; struct in_addr prefix, mask, p; - int error = 0, fibnum; + int error = 0; struct sockaddr_in prefix0, mask0; - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - /* * Remove the loopback route to the interface address. * The "useloopback" setting is not consulted because if the @@ -1071,9 +1069,11 @@ in_scrubprefix(struct in_ifaddr *target, (target->ia_flags & IFA_RTSELF)) { struct route ia_ro; int freeit = 0; + int fibnum; bzero(&ia_ro, sizeof(ia_ro)); *((struct sockaddr_in *)(&ia_ro.ro_dst)) = target->ia_addr; + fibnum = target->ia_ifp->if_fib; rtalloc_ign_fib(&ia_ro, 0, fibnum); if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && (ia_ro.ro_rt->rt_ifp == V_loif)) { @@ -1107,6 +1107,10 @@ in_scrubprefix(struct in_ifaddr *target, } if ((target->ia_flags & IFA_ROUTE) == 0) { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_DELETE, &target->ia_ifa, fibnum); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 22:16:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F5FC19C; Thu, 18 Sep 2014 22:16:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D445ACDA; Thu, 18 Sep 2014 22:16:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMGK4l098594; Thu, 18 Sep 2014 22:16:20 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMGKw8098593; Thu, 18 Sep 2014 22:16:20 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409182216.s8IMGKw8098593@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 18 Sep 2014 22:16: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: r271843 - stable/10/usr.bin/mkimg 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 22:16:21 -0000 Author: marcel Date: Thu Sep 18 22:16:20 2014 New Revision: 271843 URL: http://svnweb.freebsd.org/changeset/base/271843 Log: Fix checksum calculation: 1. Iterate over all partitions counted in the label, which can be more than the number of partitions given to mkimg(1). 2. Start the checksum from the beginning of the label; not the beginning of the bootarea. Tested with bsdlabel(8). Approved by: re@ (rodrigc) Modified: stable/10/usr.bin/mkimg/bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/bsd.c ============================================================================== --- stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:12:52 2014 (r271842) +++ stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:16:20 2014 (r271843) @@ -68,7 +68,7 @@ bsd_write(lba_t imgsz, void *bootcode) struct disklabel *d; struct partition *dp; struct part *part; - int error, n; + int bsdparts, error, n; uint16_t checksum; buf = malloc(BBSIZE); @@ -80,6 +80,9 @@ bsd_write(lba_t imgsz, void *bootcode) } else memset(buf, 0, BBSIZE); + bsdparts = nparts + 1; /* Account for c partition */ + if (bsdparts < MAXPARTITIONS) + bsdparts = MAXPARTITIONS; imgsz = (lba_t)ncyls * nheads * nsecs; error = image_set_size(imgsz); if (error) { @@ -97,7 +100,7 @@ bsd_write(lba_t imgsz, void *bootcode) le32enc(&d->d_secperunit, imgsz); le16enc(&d->d_rpm, 3600); le32enc(&d->d_magic2, DISKMAGIC); - le16enc(&d->d_npartitions, (8 > nparts + 1) ? 8 : nparts + 1); + le16enc(&d->d_npartitions, bsdparts); le32enc(&d->d_bbsize, BBSIZE); dp = &d->d_partitions[RAW_PART]; @@ -110,9 +113,9 @@ bsd_write(lba_t imgsz, void *bootcode) dp->p_fstype = ALIAS_TYPE2INT(part->type); } - dp = &d->d_partitions[nparts + 1]; + dp = &d->d_partitions[bsdparts]; checksum = 0; - for (p = buf; p < (u_char *)dp; p += 2) + for (p = (void *)d; p < (u_char *)dp; p += 2) checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 22:17:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 821062DC; Thu, 18 Sep 2014 22:17:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C734CEC; Thu, 18 Sep 2014 22:17:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMHl7H098905; Thu, 18 Sep 2014 22:17:47 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMHloQ098904; Thu, 18 Sep 2014 22:17:47 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409182217.s8IMHloQ098904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Thu, 18 Sep 2014 22:17: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: r271844 - stable/10/contrib/openbsm/bin/auditdistd 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 22:17:47 -0000 Author: pjd Date: Thu Sep 18 22:17:46 2014 New Revision: 271844 URL: http://svnweb.freebsd.org/changeset/base/271844 Log: MFC r271577: Fix descriptors leak. PR: bin/191002 Reported by: Ryan Steinmetz Submitted by: mjg Approved by: re (gjb) Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/subr.c Thu Sep 18 22:16:20 2014 (r271843) +++ stable/10/contrib/openbsm/bin/auditdistd/subr.c Thu Sep 18 22:17:46 2014 (r271844) @@ -228,6 +228,11 @@ wait_for_file_init(int fd) PJDLOG_ASSERT(fd != -1); #ifdef HAVE_KQUEUE + if (wait_for_file_kq != -1) { + close(wait_for_file_kq); + wait_for_file_kq = -1; + } + kq = kqueue(); if (kq == -1) { pjdlog_errno(LOG_WARNING, "kqueue() failed"); From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 22:22:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71B30560; Thu, 18 Sep 2014 22:22:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5166FDA6; Thu, 18 Sep 2014 22:22:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMMFC1002970; Thu, 18 Sep 2014 22:22:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMMEaF002967; Thu, 18 Sep 2014 22:22:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409182222.s8IMMEaF002967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Sep 2014 22:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271845 - in head/sys/cam: ctl 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 22:22:15 -0000 Author: mav Date: Thu Sep 18 22:22:14 2014 New Revision: 271845 URL: http://svnweb.freebsd.org/changeset/base/271845 Log: Allow more commands to pass persistent reservation according to SPC-4 r37. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Sep 18 22:17:46 2014 (r271844) +++ head/sys/cam/ctl/ctl.c Thu Sep 18 22:22:14 2014 (r271845) @@ -7888,7 +7888,7 @@ retry: res_cap = (struct scsi_per_res_cap *)ctsio->kern_data_ptr; scsi_ulto2b(sizeof(*res_cap), res_cap->length); - res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_3; + res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_5; type_mask = SPRI_TM_WR_EX_AR | SPRI_TM_EX_AC_RO | SPRI_TM_WR_EX_RO | Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Thu Sep 18 22:17:46 2014 (r271844) +++ head/sys/cam/ctl/ctl_cmd_table.c Thu Sep 18 22:22:14 2014 (r271845) @@ -304,7 +304,8 @@ const struct ctl_cmd_entry ctl_cmd_table /* 00 RECEIVE COPY STATUS (LID1) */ {ctl_receive_copy_status_lid1, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x00, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -320,14 +321,16 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 04 RECEIVE COPY FAILURE DETAILS (LID1) */ {ctl_receive_copy_failure_details, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x04, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -470,7 +473,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0c, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -479,7 +483,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0d, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Sep 18 22:17:46 2014 (r271844) +++ head/sys/cam/scsi/scsi_all.h Thu Sep 18 22:22:14 2014 (r271845) @@ -317,6 +317,7 @@ struct scsi_per_res_cap #define SPRI_ALLOW_2 0x20 #define SPRI_ALLOW_3 0x30 #define SPRI_ALLOW_4 0x40 +#define SPRI_ALLOW_5 0x50 #define SPRI_PTPL_A 0x01 uint8_t type_mask[2]; #define SPRI_TM_WR_EX_AR 0x8000 From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 22:27:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6C47770; Thu, 18 Sep 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96CB4DD3; Thu, 18 Sep 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMR2AA003623; Thu, 18 Sep 2014 22:27:02 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMR212003622; Thu, 18 Sep 2014 22:27:02 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409182227.s8IMR212003622@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 18 Sep 2014 22:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271846 - stable/10/usr.bin/mkimg 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 22:27:02 -0000 Author: marcel Date: Thu Sep 18 22:27:02 2014 New Revision: 271846 URL: http://svnweb.freebsd.org/changeset/base/271846 Log: Be compatible with boot code that starts right after the disk label in the second sector by only clearing the amount of bytes needed for the disklabel in the second sector. Previously we were clearing exactly 1 sector worth of bytes and as such writing over boot code that may have been there. Since we do support more than 8 partitions, make sure to set all fields in d_partitions. For the first 8 partitions this is unneeded, but for partitioons 9 and up this compensates for the fact that we don't clear an entire sector anymore. Obviously, one cannot use more than 8 partitions when using boot code that starts right after the disk label. Relevant GRNs: 107879 - Employ unused bytes after the disklabel in the second sector. 189500 - Revert the part of change 107879 that employs the unused bytes after the disklabel in the 2nd sector for boot code. Obtained from: Juniper Networks, Inc. Approved by: re@ (gjb) Modified: stable/10/usr.bin/mkimg/bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/bsd.c ============================================================================== --- stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:22:14 2014 (r271845) +++ stable/10/usr.bin/mkimg/bsd.c Thu Sep 18 22:27:02 2014 (r271846) @@ -76,7 +76,7 @@ bsd_write(lba_t imgsz, void *bootcode) return (ENOMEM); if (bootcode != NULL) { memcpy(buf, bootcode, BBSIZE); - memset(buf + secsz, 0, secsz); + memset(buf + secsz, 0, sizeof(struct disklabel)); } else memset(buf, 0, BBSIZE); @@ -110,7 +110,10 @@ bsd_write(lba_t imgsz, void *bootcode) dp = &d->d_partitions[n]; le32enc(&dp->p_size, part->size); le32enc(&dp->p_offset, part->block); + le32enc(&dp->p_fsize, 0); dp->p_fstype = ALIAS_TYPE2INT(part->type); + dp->p_frag = 0; + le16enc(&dp->p_cpg, 0); } dp = &d->d_partitions[bsdparts]; From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 22:34:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85F7F9F1; Thu, 18 Sep 2014 22:34:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 716A8EAE; Thu, 18 Sep 2014 22:34:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IMYrVC007967; Thu, 18 Sep 2014 22:34:53 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IMYr75007966; Thu, 18 Sep 2014 22:34:53 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409182234.s8IMYr75007966@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Thu, 18 Sep 2014 22:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271847 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 18 Sep 2014 22:34:53 -0000 Author: pjd Date: Thu Sep 18 22:34:52 2014 New Revision: 271847 URL: http://svnweb.freebsd.org/changeset/base/271847 Log: Don't use nvl in case of a failure. Reported by: Coverity CID: 1238922 Modified: head/lib/libnv/nvpair.c Modified: head/lib/libnv/nvpair.c ============================================================================== --- head/lib/libnv/nvpair.c Thu Sep 18 22:27:02 2014 (r271846) +++ head/lib/libnv/nvpair.c Thu Sep 18 22:34:52 2014 (r271847) @@ -963,7 +963,8 @@ nvpair_createv_nvlist(const nvlist_t *va namefmt, nameap); if (nvp == NULL) nvlist_destroy(nvl); - nvlist_set_parent(nvl, nvp); + else + nvlist_set_parent(nvl, nvp); return (nvp); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 00:03:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A01DCCEE; Fri, 19 Sep 2014 00:03:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B85C9D1; Fri, 19 Sep 2014 00:03:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J03PoR050345; Fri, 19 Sep 2014 00:03:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J03Ph6050344; Fri, 19 Sep 2014 00:03:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409190003.s8J03Ph6050344@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 19 Sep 2014 00:03: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: r271848 - stable/10/sys/conf 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 00:03:25 -0000 Author: gjb Date: Fri Sep 19 00:03:25 2014 New Revision: 271848 URL: http://svnweb.freebsd.org/changeset/base/271848 Log: Update stable/10 to -BETA2 as part of the 10.1-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Sep 18 22:34:52 2014 (r271847) +++ stable/10/sys/conf/newvers.sh Fri Sep 19 00:03:25 2014 (r271848) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="BETA1" +BRANCH="BETA2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 01:54:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18BD1E20; Fri, 19 Sep 2014 01:54:02 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B140339F; Fri, 19 Sep 2014 01:54:01 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s8J1qTdY012500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Sep 2014 09:52:30 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.8/8.14.8/Submit) id s8J1qTjU012499; Fri, 19 Sep 2014 09:52:29 +0800 (CST) (envelope-from kevlo) Date: Fri, 19 Sep 2014 09:52:28 +0800 From: Kevin Lo To: "Pedro F. Giffuni" Subject: Re: svn commit: r271792 - head/include Message-ID: <20140919015228.GA12490@ns.kevlo.org> References: <201409181718.s8IHIhNL052969@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409181718.s8IHIhNL052969@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 01:54:02 -0000 On Thu, Sep 18, 2014 at 05:18:43PM +0000, Pedro F. Giffuni wrote: > > Author: pfg > Date: Thu Sep 18 17:18:42 2014 > New Revision: 271792 > URL: http://svnweb.freebsd.org/changeset/base/271792 > > Log: > unistd: move setpgrp(2) to the __BSD_VISIBLE section > > Our setpgrp(2) differs from the specified by POSIX, which > only has one argument, and is only meant for compatibility > with BSD. > > Reference: > http://pubs.opengroup.org/onlinepubs/009695399/functions/setpgrp.html > > Pointed-out in: openbsd-tech (2014-09-16) > MFC after: 6 weeks > > Modified: > head/include/unistd.h > > Modified: head/include/unistd.h > ============================================================================== > --- head/include/unistd.h Thu Sep 18 17:15:38 2014 (r271791) > +++ head/include/unistd.h Thu Sep 18 17:18:42 2014 (r271792) > @@ -453,7 +453,6 @@ int encrypt(char *, int); > long gethostid(void); > int lockf(int, int, off_t); > int nice(int); > -int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ > int setregid(gid_t, gid_t); > int setreuid(uid_t, uid_t); > > @@ -567,6 +566,7 @@ int setkey(const char *); > int setlogin(const char *); > int setloginclass(const char *); > void *setmode(const char *); > +int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ > void setproctitle(const char *_fmt, ...) __printf0like(1, 2); > int setresgid(gid_t, gid_t, gid_t); > int setresuid(uid_t, uid_t, uid_t); Since there are no prototypes in unistd.h include arguments, I'd be inclined to drop them for consistency. Kevin From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 03:51:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A781960; Fri, 19 Sep 2014 03:51:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12419F47; Fri, 19 Sep 2014 03:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J3pUKl055937; Fri, 19 Sep 2014 03:51:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J3pRlr055922; Fri, 19 Sep 2014 03:51:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190351.s8J3pRlr055922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 03:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271849 - in head/sys/dev: ae altera/atse an bwi bwn cadence ce cm cp ctau cx dc de ed en ex fatm firewire gxemul/ether hatm hyperv/netvsc if_ndis iicbus ipw iwi iwn le lge malo mge 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 03:51:30 -0000 Author: glebius Date: Fri Sep 19 03:51:26 2014 New Revision: 271849 URL: http://svnweb.freebsd.org/changeset/base/271849 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/ae/if_ae.c head/sys/dev/altera/atse/if_atse.c head/sys/dev/an/if_an.c head/sys/dev/bwi/if_bwi.c head/sys/dev/bwn/if_bwn.c head/sys/dev/cadence/if_cgem.c head/sys/dev/ce/if_ce.c head/sys/dev/cm/smc90cx6.c head/sys/dev/cp/if_cp.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/if_cx.c head/sys/dev/dc/if_dc.c head/sys/dev/de/if_de.c head/sys/dev/ed/if_ed.c head/sys/dev/en/midway.c head/sys/dev/ex/if_ex.c head/sys/dev/fatm/if_fatm.c head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c head/sys/dev/gxemul/ether/if_gx.c head/sys/dev/hatm/if_hatm_rx.c head/sys/dev/hatm/if_hatm_tx.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iicbus/if_ic.c head/sys/dev/ipw/if_ipw.c head/sys/dev/iwi/if_iwi.c head/sys/dev/iwn/if_iwn.c head/sys/dev/le/am7990.c head/sys/dev/le/am79900.c head/sys/dev/le/lance.c head/sys/dev/lge/if_lge.c head/sys/dev/malo/if_malo.c head/sys/dev/mge/if_mge.c head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/oce/oce_if.c head/sys/dev/patm/if_patm_rx.c head/sys/dev/patm/if_patm_tx.c head/sys/dev/ppbus/if_plip.c head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxge/qls_isr.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/re/if_re.c head/sys/dev/rt/if_rt.c head/sys/dev/sbni/if_sbni.c head/sys/dev/sge/if_sge.c head/sys/dev/sk/if_sk.c head/sys/dev/sn/if_sn.c head/sys/dev/ste/if_ste.c head/sys/dev/tsec/if_tsec.c head/sys/dev/vx/if_vx.c head/sys/dev/vxge/vxge.c head/sys/dev/wb/if_wb.c head/sys/dev/wl/if_wl.c head/sys/dev/wpi/if_wpi.c head/sys/dev/wtap/if_wtap.c head/sys/dev/xe/if_xe.c head/sys/dev/xen/netback/netback.c head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/ae/if_ae.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1852,9 +1852,9 @@ ae_tx_intr(ae_softc_t *sc) sizeof(ae_txs_t) + 3) & ~3) % AE_TXD_BUFSIZE_DEFAULT; if ((flags & AE_TXS_SUCCESS) != 0) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); sc->tx_inproc--; } @@ -1897,13 +1897,13 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) size = le16toh(rxd->len) - ETHER_CRC_LEN; if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) { if_printf(ifp, "Runt frame received."); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return; } @@ -1913,7 +1913,7 @@ ae_rxeof(ae_softc_t *sc, ae_rxd_t *rxd) m->m_flags |= M_VLANTAG; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* * Pass it through. */ @@ -1959,7 +1959,7 @@ ae_rx_intr(ae_softc_t *sc) if ((flags & AE_RXD_SUCCESS) != 0) ae_rxeof(sc, rxd); else - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } if (count > 0) { @@ -1989,7 +1989,7 @@ ae_watchdog(ae_softc_t *sc) else if_printf(ifp, "watchdog timeout - resetting.\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/altera/atse/if_atse.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1159,7 +1159,7 @@ atse_watchdog(struct atse_softc *sc) return; device_printf(sc->atse_dev, "watchdog timeout\n"); - sc->atse_ifp->if_oerrors++; + if_inc_counter(sc->atse_ifp, IFCOUNTER_OERRORS, 1); atse_intr_debug(sc, "poll"); @@ -1263,7 +1263,7 @@ outer: atse_update_rx_err(sc, ((meta & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); sc->atse_rx_buf_len = 0; /* * Should still read till EOP or next SOP. @@ -1292,7 +1292,7 @@ outer: "without empty buffer: %u\n", __func__, sc->atse_rx_buf_len); /* XXX-BZ any better counter? */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } if ((sc->atse_flags & ATSE_FLAGS_SOP_SEEN) == 0) @@ -1311,7 +1311,7 @@ outer: * XXX-BZ Error. We need more mbufs and are * not setup for this yet. */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); sc->atse_flags |= ATSE_FLAGS_ERROR; } if ((sc->atse_flags & ATSE_FLAGS_ERROR) == 0) @@ -1330,7 +1330,7 @@ outer: A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT; sc->atse_rx_buf_len += (4 - empty); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); rx_npkts++; m = sc->atse_rx_m; @@ -1414,7 +1414,7 @@ atse_rx_intr(void *arg) atse_update_rx_err(sc, ((rxe & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } /* @@ -1469,7 +1469,7 @@ atse_tx_intr(void *arg) if (txe & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { /* XXX-BZ ERROR HANDLING. */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* @@ -1527,12 +1527,12 @@ atse_poll(struct ifnet *ifp, enum poll_c atse_update_rx_err(sc, ((rx & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } if (tx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { /* XXX-BZ ERROR HANDLING. */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } if (ATSE_TX_READ_FILL_LEVEL(sc) == 0) sc->atse_watchdog_timer = 0; Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/an/if_an.c Fri Sep 19 03:51:26 2014 (r271849) @@ -872,7 +872,7 @@ an_rxeof(struct an_softc *sc) /* read header */ if (an_read_data(sc, id, 0x0, (caddr_t)&rx_frame, sizeof(rx_frame))) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -895,7 +895,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -921,7 +921,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -940,13 +940,13 @@ an_rxeof(struct an_softc *sc) } else { MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m->m_pkthdr.rcvif = ifp; @@ -957,7 +957,7 @@ an_rxeof(struct an_softc *sc) if (an_read_data(sc, id, 0, (caddr_t)&rx_frame, sizeof(rx_frame))) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } #endif @@ -966,12 +966,12 @@ an_rxeof(struct an_softc *sc) (caddr_t)&rx_frame_802_3, sizeof(rx_frame_802_3))) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } if (rx_frame_802_3.an_rx_802_3_status != 0) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } /* Check for insane frame length */ @@ -981,7 +981,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m->m_pkthdr.len = m->m_len = @@ -1001,10 +1001,10 @@ an_rxeof(struct an_softc *sc) if (error) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* Receive packet. */ #ifdef ANCACHE @@ -1031,13 +1031,13 @@ an_rxeof(struct an_softc *sc) MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m->m_pkthdr.rcvif = ifp; @@ -1061,7 +1061,7 @@ an_rxeof(struct an_softc *sc) if_printf(ifp, "oversized packet " "received (%d, %d)\n", len, MCLBYTES); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -1073,7 +1073,7 @@ an_rxeof(struct an_softc *sc) bcopy(buf, (char *)eh, m->m_pkthdr.len); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* Receive packet. */ #if 0 @@ -1126,9 +1126,9 @@ an_txeof(struct an_softc *sc, int status id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350)); if (status & AN_EV_TX_EXC) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); for (i = 0; i < AN_TX_RING_CNT; i++) { if (id == sc->an_rdata.an_tx_ring[i]) { @@ -1142,9 +1142,9 @@ an_txeof(struct an_softc *sc, int status id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350)); if (!sc->an_rdata.an_tx_empty){ if (status & AN_EV_TX_EXC) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); AN_INC(sc->an_rdata.an_tx_cons, AN_MAX_TX_DESC); if (sc->an_rdata.an_tx_prod == sc->an_rdata.an_tx_cons) @@ -2962,7 +2962,7 @@ an_watchdog(struct an_softc *sc) an_init_mpi350_desc(sc); an_init_locked(sc); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } int Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/bwi/if_bwi.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1401,7 +1401,7 @@ bwi_start_locked(struct ifnet *ifp) if (k == NULL) { ieee80211_free_node(ni); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -1411,7 +1411,7 @@ bwi_start_locked(struct ifnet *ifp) /* 'm' is freed in bwi_encap() if we reach here */ if (ni != NULL) ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } @@ -1419,7 +1419,7 @@ bwi_start_locked(struct ifnet *ifp) tbd->tbd_used++; idx = (idx + 1) % BWI_TX_NDESC; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (tbd->tbd_used + BWI_TX_NSPRDESC >= BWI_TX_NDESC) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; @@ -1466,7 +1466,7 @@ bwi_raw_xmit(struct ieee80211_node *ni, error = bwi_encap_raw(sc, idx, m, ni, params); } if (error == 0) { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (++tbd->tbd_used + BWI_TX_NSPRDESC >= BWI_TX_NDESC) ifp->if_drv_flags |= IFF_DRV_OACTIVE; tbd->tbd_idx = (idx + 1) % BWI_TX_NDESC; @@ -1474,7 +1474,7 @@ bwi_raw_xmit(struct ieee80211_node *ni, } else { /* NB: m is reclaimed on encap failure */ ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } BWI_UNLOCK(sc); return error; @@ -1491,7 +1491,7 @@ bwi_watchdog(void *arg) BWI_ASSERT_LOCKED(sc); if (sc->sc_tx_timer != 0 && --sc->sc_tx_timer == 0) { if_printf(ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); taskqueue_enqueue(sc->sc_tq, &sc->sc_restart_task); } callout_reset(&sc->sc_watchdog_timer, hz, bwi_watchdog, sc); @@ -2639,7 +2639,7 @@ bwi_rxeof(struct bwi_softc *sc, int end_ BUS_DMASYNC_POSTREAD); if (bwi_newbuf(sc, idx, 0)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto next; } @@ -2655,7 +2655,7 @@ bwi_rxeof(struct bwi_softc *sc, int end_ if (buflen < BWI_FRAME_MIN_LEN(wh_ofs)) { if_printf(ifp, "%s: zero length data, hdr_extra %d\n", __func__, hdr_extra); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); goto next; } Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/bwn/if_bwn.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1311,7 +1311,7 @@ bwn_start_locked(struct ifnet *ifp) if (ni == NULL) { device_printf(sc->sc_dev, "unexpected NULL ni\n"); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } KASSERT(ni != NULL, ("%s:%d: fail", __func__, __LINE__)); @@ -1321,7 +1321,7 @@ bwn_start_locked(struct ifnet *ifp) if (k == NULL) { ieee80211_free_node(ni); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -1330,7 +1330,7 @@ bwn_start_locked(struct ifnet *ifp) if (bwn_tx_start(sc, ni, m) != 0) { if (ni != NULL) ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } @@ -1587,7 +1587,7 @@ bwn_watchdog(void *arg) if (sc->sc_watchdog_timer != 0 && --sc->sc_watchdog_timer == 0) { if_printf(ifp, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } callout_schedule(&sc->sc_watchdog_ch, hz); } @@ -2748,7 +2748,7 @@ bwn_raw_xmit(struct ieee80211_node *ni, if (bwn_tx_isfull(sc, m)) { ieee80211_free_node(ni); m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); BWN_UNLOCK(sc); return (ENOBUFS); } @@ -2756,7 +2756,7 @@ bwn_raw_xmit(struct ieee80211_node *ni, if (bwn_tx_start(sc, ni, m) != 0) { if (ni != NULL) ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } sc->sc_watchdog_timer = 5; BWN_UNLOCK(sc); @@ -8929,14 +8929,14 @@ bwn_dma_rxeof(struct bwn_dma_ring *dr, i m = meta->mt_m; if (bwn_dma_newbuf(dr, desc, meta, 0)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } rxhdr = mtod(m, struct bwn_rxhdr4 *); len = le16toh(rxhdr->frame_len); if (len <= 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } if (bwn_dma_check_redzone(dr, m)) { @@ -9366,7 +9366,7 @@ bwn_rxeof(struct bwn_mac *mac, struct mb rssi = rxhdr->phy.abg.rssi; /* XXX incorrect RSSI calculation? */ noise = mac->mac_stats.link_noise; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); BWN_UNLOCK(sc); @@ -9441,7 +9441,7 @@ bwn_dma_handle_txeof(struct bwn_mac *mac dr->dr_usedslot--; if (meta->mt_islast) { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); break; } slot = bwn_dma_nextslot(dr, slot); @@ -9487,7 +9487,7 @@ bwn_pio_handle_txeof(struct bwn_mac *mac tp->tp_m = NULL; TAILQ_INSERT_TAIL(&tq->tq_pktlist, tp, tp_list); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->sc_watchdog_timer = 0; if (tq->tq_stop) { Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cadence/if_cgem.c Fri Sep 19 03:51:26 2014 (r271849) @@ -558,7 +558,7 @@ cgem_recv(struct cgem_softc *sc) (CGEM_RXDESC_SOF | CGEM_RXDESC_EOF)) { /* discard. */ m_free(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } @@ -604,7 +604,7 @@ cgem_recv(struct cgem_softc *sc) m = m_hd; m_hd = m_hd->m_next; m->m_next = NULL; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } CGEM_LOCK(sc); @@ -646,9 +646,9 @@ cgem_clean_tx(struct cgem_softc *sc) sc->txring[sc->txring_tl_ptr].addr); } else if ((ctl & (CGEM_TXDESC_RETRY_ERR | CGEM_TXDESC_LATE_COLL)) != 0) { - sc->ifp->if_oerrors++; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); } else - sc->ifp->if_opackets++; + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); /* If the packet spanned more than one tx descriptor, * skip descriptors until we find the end so that only @@ -821,16 +821,16 @@ cgem_poll_hw_stats(struct cgem_softc *sc n = RD4(sc, CGEM_SINGLE_COLL_FRAMES); sc->stats.tx_single_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); n = RD4(sc, CGEM_MULTI_COLL_FRAMES); sc->stats.tx_multi_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); n = RD4(sc, CGEM_EXCESSIVE_COLL_FRAMES); sc->stats.tx_excsv_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); n = RD4(sc, CGEM_LATE_COLL); sc->stats.tx_late_collisn += n; - sc->ifp->if_collisions += n; + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, n); sc->stats.tx_deferred_frames += RD4(sc, CGEM_DEFERRED_TX_FRAMES); sc->stats.tx_carrier_sense_errs += RD4(sc, CGEM_CARRIER_SENSE_ERRS); Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/ce/if_ce.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1097,7 +1097,7 @@ static void ce_transmit (ce_chan_t *c, v d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); #if __FreeBSD_version >= 600034 d->ifp->if_flags &= ~IFF_DRV_OACTIVE; #else @@ -1119,7 +1119,7 @@ static void ce_receive (ce_chan_t *c, un if (! m) { CE_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -1129,7 +1129,7 @@ static void ce_receive (ce_chan_t *c, un m->m_pkthdr.rcvif = 0; IF_ENQUEUE(&d->rqueue, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -1151,33 +1151,33 @@ static void ce_error (ce_chan_t *c, int case CE_FRAME: CE_DEBUG (d, ("frame error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_CRC: CE_DEBUG (d, ("crc error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_OVERRUN: CE_DEBUG (d, ("overrun error\n")); #ifndef NETGRAPH - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_OVERFLOW: CE_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CE_UNDERRUN: CE_DEBUG (d, ("underrun error\n")); d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); #if __FreeBSD_version >= 600034 d->ifp->if_flags &= ~IFF_DRV_OACTIVE; #else Modified: head/sys/dev/cm/smc90cx6.c ============================================================================== --- head/sys/dev/cm/smc90cx6.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cm/smc90cx6.c Fri Sep 19 03:51:26 2014 (r271849) @@ -512,7 +512,7 @@ cm_srint_locked(vsc) * count it as input error (we dont have any other * detectable) */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto cleanup; } @@ -544,13 +544,13 @@ cm_srint_locked(vsc) /* Insist on getting a cluster */ if ((m->m_flags & M_EXT) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto cleanup; } } if (m == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto cleanup; } @@ -572,7 +572,7 @@ cm_srint_locked(vsc) CM_LOCK(sc); m = NULL; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); cleanup: @@ -620,7 +620,7 @@ cm_tint_locked(sc, isr) */ if (isr & CM_TMA || sc->sc_broadcast[buffer]) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); #ifdef CMRETRANSMIT else if (ifp->if_flags & IFF_LINK2 && sc->sc_timer > 0 && --sc->sc_retransmits[buffer] > 0) { @@ -630,7 +630,7 @@ cm_tint_locked(sc, isr) } #endif else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* We know we can accept another buffer at this point. */ @@ -730,7 +730,7 @@ cmintr(arg) * PUTREG(CMCMD, CM_CONF(CONF_LONG)); */ PUTREG(CMCMD, CM_CLR(CLR_RECONFIG)); - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); /* * If less than 2 seconds per reconfig: Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cp/if_cp.c Fri Sep 19 03:51:26 2014 (r271849) @@ -867,7 +867,7 @@ static void cp_transmit (cp_chan_t *c, v d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cp_start (d); @@ -888,7 +888,7 @@ static void cp_receive (cp_chan_t *c, un if (! m) { CP_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -898,7 +898,7 @@ static void cp_receive (cp_chan_t *c, un m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -915,33 +915,33 @@ static void cp_error (cp_chan_t *c, int case CP_FRAME: CP_DEBUG (d, ("frame error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_CRC: CP_DEBUG (d, ("crc error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_OVERRUN: CP_DEBUG (d, ("overrun error\n")); #ifndef NETGRAPH - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_OVERFLOW: CP_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_UNDERRUN: CP_DEBUG (d, ("underrun error\n")); d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cp_start (d); Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/ctau/if_ct.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1082,7 +1082,7 @@ static void ct_transmit (ct_chan_t *c, v return; d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif ct_start (d); @@ -1106,7 +1106,7 @@ static void ct_receive (ct_chan_t *c, ch if (! m) { CT_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -1116,7 +1116,7 @@ static void ct_receive (ct_chan_t *c, ch m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -1139,33 +1139,33 @@ static void ct_error (ct_chan_t *c, int case CT_FRAME: CT_DEBUG (d, ("frame error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_CRC: CT_DEBUG (d, ("crc error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_OVERRUN: CT_DEBUG (d, ("overrun error\n")); #ifndef NETGRAPH - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_OVERFLOW: CT_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CT_UNDERRUN: CT_DEBUG (d, ("underrun error\n")); d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif ct_start (d); Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/cx/if_cx.c Fri Sep 19 03:51:26 2014 (r271849) @@ -1251,7 +1251,7 @@ static void cx_transmit (cx_chan_t *c, v } d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cx_start (d); @@ -1304,7 +1304,7 @@ static void cx_receive (cx_chan_t *c, ch if (! m) { CX_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -1314,7 +1314,7 @@ static void cx_receive (cx_chan_t *c, ch m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -1357,7 +1357,7 @@ static void cx_error (cx_chan_t *c, int } #ifndef NETGRAPH else - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CX_CRC: @@ -1374,7 +1374,7 @@ static void cx_error (cx_chan_t *c, int } #ifndef NETGRAPH else - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CX_OVERRUN: @@ -1391,8 +1391,8 @@ static void cx_error (cx_chan_t *c, int #endif #ifndef NETGRAPH else { - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); } #endif break; @@ -1400,7 +1400,7 @@ static void cx_error (cx_chan_t *c, int CX_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH if (c->mode != M_ASYNC) - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CX_UNDERRUN: @@ -1408,7 +1408,7 @@ static void cx_error (cx_chan_t *c, int if (c->mode != M_ASYNC) { d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cx_start (d); @@ -1427,7 +1427,7 @@ static void cx_error (cx_chan_t *c, int } #ifndef NETGRAPH else - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; default: Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/dc/if_dc.c Fri Sep 19 03:51:26 2014 (r271849) @@ -2915,9 +2915,9 @@ dc_rxeof(struct dc_softc *sc) (rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE | DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN | DC_RXSTAT_RUNT | DC_RXSTAT_DE))) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (rxstat & DC_RXSTAT_COLLSEEN) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); dc_discard_rxbuf(sc, i); if (rxstat & DC_RXSTAT_CRCERR) continue; @@ -2943,7 +2943,7 @@ dc_rxeof(struct dc_softc *sc) */ if (dc_newbuf(sc, i) != 0) { dc_discard_rxbuf(sc, i); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); continue; } m->m_pkthdr.rcvif = ifp; @@ -2956,14 +2956,14 @@ dc_rxeof(struct dc_softc *sc) ETHER_ALIGN, ifp, NULL); dc_discard_rxbuf(sc, i); if (m0 == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); continue; } m = m0; } #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); DC_UNLOCK(sc); (*ifp->if_input)(ifp, m); DC_LOCK(sc); @@ -3054,19 +3054,19 @@ dc_txeof(struct dc_softc *sc) } if (txstat & DC_TXSTAT_ERRSUM) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (txstat & DC_TXSTAT_EXCESSCOLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (txstat & DC_TXSTAT_LATECOLL) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); if (!(txstat & DC_TXSTAT_UNDERRUN)) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; dc_init_locked(sc); return; } } else - ifp->if_opackets++; - ifp->if_collisions += (txstat & DC_TXSTAT_COLLCNT) >> 3; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (txstat & DC_TXSTAT_COLLCNT) >> 3); bus_dmamap_sync(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], BUS_DMASYNC_POSTWRITE); @@ -3261,7 +3261,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd if (status & (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF)) { uint32_t r = CSR_READ_4(sc, DC_FRAMESDISCARDED); - ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff); + if_inc_counter(ifp, IFCOUNTER_IERRORS, (r & 0xffff) + ((r >> 17) & 0x7ff)); if (dc_rx_resync(sc)) dc_rxeof(sc); @@ -3343,7 +3343,7 @@ dc_intr(void *arg) if ((status & DC_ISR_RX_WATDOGTIMEO) || (status & DC_ISR_RX_NOBUF)) { r = CSR_READ_4(sc, DC_FRAMESDISCARDED); - ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff); + if_inc_counter(ifp, IFCOUNTER_IERRORS, (r & 0xffff) + ((r >> 17) & 0x7ff)); if (dc_rxeof(sc) == 0) { while (dc_rx_resync(sc)) dc_rxeof(sc); @@ -3941,7 +3941,7 @@ dc_watchdog(void *xsc) } ifp = sc->dc_ifp; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); device_printf(sc->dc_dev, "watchdog timeout\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Fri Sep 19 00:03:25 2014 (r271848) +++ head/sys/dev/de/if_de.c Fri Sep 19 03:51:26 2014 (r271849) @@ -3439,7 +3439,7 @@ tulip_rx_intr(tulip_softc_t * const sc) } else { CTR1(KTR_TULIP, "tulip_rx_intr: bad packet; status %08x", DESC_STATUS(eop)); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (DESC_STATUS(eop) & (TULIP_DSTS_RxBADLENGTH|TULIP_DSTS_RxOVERFLOW|TULIP_DSTS_RxWATCHDOG)) { sc->tulip_dot3stats.dot3StatsInternalMacReceiveErrors++; } else { @@ -3479,7 +3479,7 @@ tulip_rx_intr(tulip_softc_t * const sc) #if defined(TULIP_DEBUG) cnt++; #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if (++eop == ri->ri_last) eop = ri->ri_first; ri->ri_nextin = eop; @@ -3501,7 +3501,7 @@ tulip_rx_intr(tulip_softc_t * const sc) */ m0 = m_devget(mtod(ms, caddr_t), total_len, ETHER_ALIGN, ifp, NULL); if (m0 == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto skip_input; } #else @@ -3675,7 +3675,7 @@ tulip_tx_intr(tulip_softc_t * const sc) if (d_status & TULIP_DSTS_ERRSUM) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 03:53:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28665AC0; Fri, 19 Sep 2014 03:53:07 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FDB2FDE; Fri, 19 Sep 2014 03:53:05 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8J3r1wD005128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Sep 2014 07:53:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8J3r1Qn005127; Fri, 19 Sep 2014 07:53:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Sep 2014 07:53:01 +0400 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r271841 - head/sys/dev/smc Message-ID: <20140919035301.GF884@FreeBSD.org> References: <201409182210.s8IMAoiO097104@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409182210.s8IMAoiO097104@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 03:53:07 -0000 On Thu, Sep 18, 2014 at 10:10:50PM +0000, Bjoern A. Zeeb wrote: B> Author: bz B> Date: Thu Sep 18 22:10:49 2014 B> New Revision: 271841 B> URL: http://svnweb.freebsd.org/changeset/base/271841 B> B> Log: B> Fx a type from r271817; it's IFCOUNTER_* not IFNET_*. Thanks! -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 03:55:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79A28C2D; Fri, 19 Sep 2014 03:55:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64F3BFE9; Fri, 19 Sep 2014 03:55:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J3tKXg056944; Fri, 19 Sep 2014 03:55:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J3tKVf056943; Fri, 19 Sep 2014 03:55:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190355.s8J3tKVf056943@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 03:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271850 - head/sys/dev/sf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 03:55:20 -0000 Author: glebius Date: Fri Sep 19 03:55:19 2014 New Revision: 271850 URL: http://svnweb.freebsd.org/changeset/base/271850 Log: Fix typo. Submitted by: jkim Modified: head/sys/dev/sf/if_sf.c Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Fri Sep 19 03:51:26 2014 (r271849) +++ head/sys/dev/sf/if_sf.c Fri Sep 19 03:55:19 2014 (r271850) @@ -1566,7 +1566,7 @@ sf_rxeof(struct sf_softc *sc) m = rxd->rx_m; /* - * Note, IFCOUNTER_IPACKETS and ICOUNTER_IERRORS + * Note, IFCOUNTER_IPACKETS and IFCOUNTER_IERRORS * are handled in sf_stats_update(). */ if ((status & SF_RXSTAT1_OK) == 0) { From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 04:12:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C140BE85; Fri, 19 Sep 2014 04:12:42 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90A251E7; Fri, 19 Sep 2014 04:12:41 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id hi2so424156wib.4 for ; Thu, 18 Sep 2014 21:12:39 -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:date:message-id :subject:from:to:cc:content-type; bh=ocVfJ0lVfxguyISmjl76qnluKOVdeyO+vxVQNoL1MRY=; b=QS4FQEd58TpSqK1MuuoQEdT63ZT3gTVFEV4uBj6IGvrn3j4UsUiuzT9M+T7QmOdElh KdDL7fE1SLoSR4EP/0Ey8dBtvY9br72jJb1nZIAIYrS2jv3ewPJoJI9aqpj81DsMFX1M ffAM5nbSyJhXiLtHK9azYCm52V16+14kMCbkAPiDf4SP2fY0pW5MSUmtH6/W4sB35A0x Vuf5hJgCO1XB0zv7JjCIkhAo8JVyi/CtXzGF1ksKhfed7Kvlr/6mdDDI0e4jw2EKltIM 8cqVMveyWrntk9+Jfiq+Z5ohzdTxYlNk3jDKoT4ysv3hb4h51R4sP4ntdeoZ8HjtpRDM zDVA== MIME-Version: 1.0 X-Received: by 10.194.249.164 with SMTP id yv4mr9786483wjc.34.1411099959631; Thu, 18 Sep 2014 21:12:39 -0700 (PDT) Received: by 10.216.159.193 with HTTP; Thu, 18 Sep 2014 21:12:39 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: References: <201409180309.s8I39Zmh045601@svn.freebsd.org> <20140918051834.GD89442@FreeBSD.org> <20140918060435.GA5856@ns.kevlo.org> <1411024874.128099.168895241.4A95DCA1@webmail.messagingengine.com> Date: Fri, 19 Sep 2014 12:12:39 +0800 Message-ID: Subject: Re: svn commit: r271735 - head/sys/net From: Marcelo Araujo To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Bruce Simpson , Gleb Smirnoff , "svn-src-head@freebsd.org" , Kevin Lo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 04:12:42 -0000 Hello, I made some tests with the implementation from pfsense and it works like a charm with very few modifications. I'm gonna try to make it in two steps. 1) First only submit the vlan(4) and ifconfig(8) changes. 2) Submit the changes on pf(4) and ipfw(8) in a second stage. I'm going to use phabricator to make easier the follow up, byt the way, the patch from pfsense partially was made by rwatson@. I'm gonna add rwatson to the review. Best Regards, 2014-09-18 23:41 GMT+08:00 Marcelo Araujo : > Hello Adrian, > > I have a patch, but it is a hack on PF and some very ugly code. Not > generic at all. > As my hands are dirty now with it, if you don't have too much time, I can > take a look on pfsense implementation. > > Best Regards, > > 2014-09-18 22:32 GMT+08:00 Adrian Chadd : > >> There is in pfsense. >> >> Let me see about twisting some arms again... :) >> >> >> -a >> >> >> On 18 September 2014 00:21, Bruce Simpson wrote: >> > On Thu, 18 Sep 2014, at 07:04, Kevin Lo wrote: >> >> Sorry, I overlooked that. Marcelo has a patch with 802.1p tagging >> >> support, >> >> I thought the patch was committed. >> > >> > I agree the comment change should be reverted. I changed if_ethersubr.c >> > many years ago to decode 802.1p tags into the mbuf packet header if they >> > are present. >> > >> > However, to my knowledge, there is no support (e.g. in the form of a >> > DiffServ / IntServ mapping) further up in the stack. If someone plans to >> > add this, great -- that would be needed for any form of tangible 802.1p >> > support. >> > >> > -- >> > BMS (sent via webmail) >> > >> > > > > -- > > -- > Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ > Power To Server. .\. /_) > > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 04:35:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2B67173 for ; Fri, 19 Sep 2014 04:35:00 +0000 (UTC) Received: from nm39-vm3.bullet.mail.bf1.yahoo.com (nm39-vm3.bullet.mail.bf1.yahoo.com [72.30.239.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2F3837E for ; Fri, 19 Sep 2014 04:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1411100960; bh=4+h9lSFDvOIpZRkFJLKtYOpDttr7kEhZ3h2XbZmGgPo=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer:From:Subject; b=Ojih1llSWtLferrGcfBlo0unsdTn881NpUfzRn2aC7FkZmyPP2DXnG+hVkWu+xB7qahRbnFQ4CXhkga9PYxVQi6YOiDXGgR4maJNVhEbmrFhS9loC+f5zWg0YsUdpo4Iu0FSKQF8KKcr/w/3CZ1YAg2s2pDdiSTA6DHbNvbmTiHd4oJJ63ves5ssFuOyIGvtH/6AoI9WHESvqSXab0Zo9bl064V11naNe2JERgq0jiZSmCVUBf6Y56m96gcxuyPBTKK/C8V1AsQ2kjeUzHbFQe7DyZW13KiaMYwrHBXjtqwMDhT0zEYCi51ZN63ZlTKBDtJtTIxsS/zKGTZVRJTOFA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=b6ldSqX6fOVTnxBr+O3TFP1LL3a6W4wlkejLPAyqXHdmzIMVUOKGTekapVa9fovY5DM9Z4HTCTMmSHPcjM5Mr+cL69JWQi7QZnYRGQilCLuKBAkLrkobpGvtq8yHzT9dCWt1PPpZ2O6rdvhtiqKvq6eJWkN6uOtw4pz97R4xt71EshSY+YYqaSVpHxgXGZffiq6M0Ba6e2zeilaN3PKEs1W6CxyzKemfcaJUmIVUYM5NXNg1YBSYnDYXK50CRRBckH9PTGmyfRBC8PYqcKiAT0DTNh7kbjmQij45Yums0X6l0Cd6SxkxTY949OamFmDGZsS2XX7pFoexDlJxRqaDOQ==; Received: from [98.139.215.143] by nm39.bullet.mail.bf1.yahoo.com with NNFMP; 19 Sep 2014 04:29:20 -0000 Received: from [68.142.230.71] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 19 Sep 2014 04:29:20 -0000 Received: from [127.0.0.1] by smtp228.mail.bf1.yahoo.com with NNFMP; 19 Sep 2014 04:29:20 -0000 X-Yahoo-Newman-Id: 649465.26501.bm@smtp228.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: OfCFE2gVM1nAYsioEUTvdirDmC1w8DM.NtDMBE5SpeoHg5b XdU3tQ7Cyn8Al9LUVmN6WZw1JW6Vd81YDC4YElimp25NVvo6ABXbWtiqW42z tEsiZGVWRCYU6Dep01XIlD6MH5JVL2gONwo.HmnkTRK9fp0mqpg_aUsQSEqp GnbF81bNZiBFLv.vBIYqKzRwGmAq67nG4v1izxqpngTtOhemYZpNr93wnODL 6fEvBuRRXURYNA3zRYVjOXsI6RBVLV8i69XCgvv2Un_GCCze8c5rISu7rCfM 78S20s8dkX3XjYPY.f0LRCs93iEUyGjIKkaMbyC.wXvtDW__FqWnm9vXoCE7 _g.J_AJSoEQdplrXk21CyLCHAXP1rsTn2rVAOKto5Cc77a7K0025keDH1bAh lSRs.g92sv5zaeeCRSptNOxDDi24wfl0ZR3c.63K8wEhiimFwjKfVFHToP7i SXHMRmSXzLYMxf8fPxegXb22NJocOIiMd77MBJnzAepmhUrXW2osaRRuuBGo uW8OgyBA7pYyASnEvEQ06073neYzPeB9TqdPgM8rDAbbj9gcnAdXNR0e_Yd. 2JZMJ4a7e7AFfsTEBFZWp5vNtz9.AsQDzuudaUQhUTOD.Lx0yqTPIpDlR7SK OiBd4IH7uwA0xY1ODnVJX7Na_9IdUlQArqJJ.EKXmtg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271792 - head/include From: Pedro Giffuni In-Reply-To: <20140919015228.GA12490@ns.kevlo.org> Date: Thu, 18 Sep 2014 23:28:52 -0500 Message-Id: References: <201409181718.s8IHIhNL052969@svn.freebsd.org> <20140919015228.GA12490@ns.kevlo.org> To: Kevin Lo X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 04:35:01 -0000 Il giorno 18/set/2014, alle ore 20:52, Kevin Lo ha = scritto: > On Thu, Sep 18, 2014 at 05:18:43PM +0000, Pedro F. Giffuni wrote: >>=20 >> Author: pfg >> Date: Thu Sep 18 17:18:42 2014 >> New Revision: 271792 >> URL: http://svnweb.freebsd.org/changeset/base/271792 >>=20 >> Log: >> unistd: move setpgrp(2) to the __BSD_VISIBLE section >>=20 >> Our setpgrp(2) differs from the specified by POSIX, which >> only has one argument, and is only meant for compatibility >> with BSD. >>=20 >> Reference: >> = http://pubs.opengroup.org/onlinepubs/009695399/functions/setpgrp.html >>=20 >> Pointed-out in: openbsd-tech (2014-09-16) >> MFC after: 6 weeks >>=20 >> Modified: >> head/include/unistd.h >>=20 >> Modified: head/include/unistd.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/include/unistd.h Thu Sep 18 17:15:38 2014 = (r271791) >> +++ head/include/unistd.h Thu Sep 18 17:18:42 2014 = (r271792) >> @@ -453,7 +453,6 @@ int encrypt(char *, int); >> long gethostid(void); >> int lockf(int, int, off_t); >> int nice(int); >> -int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ >> int setregid(gid_t, gid_t); >> int setreuid(uid_t, uid_t); >>=20 >> @@ -567,6 +566,7 @@ int setkey(const char *); >> int setlogin(const char *); >> int setloginclass(const char *); >> void *setmode(const char *); >> +int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ >> void setproctitle(const char *_fmt, ...) __printf0like(1, 2); >> int setresgid(gid_t, gid_t, gid_t); >> int setresuid(uid_t, uid_t, uid_t); >=20 > Since there are no prototypes in unistd.h include arguments,=20 > I'd be inclined to drop them for consistency. >=20 The effect on ports would have to be evaluated first, but TBH I don=92t = find having this extra function around for a while troublesome at all. FWIW, strtoq and strtouq, in stdlib.h, are more =93interesting=94. =20 Pedro. From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 05:03:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD8B64A9; Fri, 19 Sep 2014 05:03:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D71D7FB; Fri, 19 Sep 2014 05:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J53CgJ088361; Fri, 19 Sep 2014 05:03:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J53C8F088358; Fri, 19 Sep 2014 05:03:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190503.s8J53C8F088358@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 05:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271851 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 05:03:12 -0000 Author: glebius Date: Fri Sep 19 05:03:11 2014 New Revision: 271851 URL: http://svnweb.freebsd.org/changeset/base/271851 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_sppp.c Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Fri Sep 19 03:55:19 2014 (r271850) +++ head/sys/netgraph/ng_eiface.c Fri Sep 19 05:03:11 2014 (r271851) @@ -247,7 +247,7 @@ ng_eiface_start2(node_p node, hook_p hoo BPF_MTAP(ifp, m); if (ifp->if_flags & IFF_MONITOR) { - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m_freem(m); continue; } @@ -262,9 +262,9 @@ ng_eiface_start2(node_p node, hook_p hoo /* Update stats */ if (error == 0) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -597,7 +597,7 @@ ng_eiface_rcvdata(hook_p hook, item_p it m->m_pkthdr.rcvif = ifp; /* Update interface stats */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Fri Sep 19 03:55:19 2014 (r271850) +++ head/sys/netgraph/ng_iface.c Fri Sep 19 05:03:11 2014 (r271851) @@ -396,7 +396,7 @@ ng_iface_output(struct ifnet *ifp, struc IFQ_LOCK(&ifp->if_snd); IFQ_INC_DROPS(&ifp->if_snd); IFQ_UNLOCK(&ifp->if_snd); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } *(sa_family_t *)m->m_data = af; @@ -472,8 +472,8 @@ ng_iface_send(struct ifnet *ifp, struct /* Update stats. */ if (error == 0) { - ifp->if_obytes += len; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } return (error); @@ -736,8 +736,8 @@ ng_iface_rcvdata(hook_p hook, item_p ite } /* Update interface stats */ - ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); /* Note receiving interface */ m->m_pkthdr.rcvif = ifp; Modified: head/sys/netgraph/ng_sppp.c ============================================================================== --- head/sys/netgraph/ng_sppp.c Fri Sep 19 03:55:19 2014 (r271850) +++ head/sys/netgraph/ng_sppp.c Fri Sep 19 05:03:11 2014 (r271851) @@ -364,7 +364,7 @@ ng_sppp_rcvdata (hook_p hook, item_p ite } /* Update interface stats */ - SP2IFP(pp)->if_ipackets++; + if_inc_counter(SP2IFP(pp), IFCOUNTER_IPACKETS, 1); /* Note receiving interface */ m->m_pkthdr.rcvif = SP2IFP(pp); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 05:23:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54388847; Fri, 19 Sep 2014 05:23:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2698599E; Fri, 19 Sep 2014 05:23:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J5NmWH097841; Fri, 19 Sep 2014 05:23:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J5NmXI097840; Fri, 19 Sep 2014 05:23:48 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190523.s8J5NmXI097840@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 05:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271852 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 05:23:48 -0000 Author: glebius Date: Fri Sep 19 05:23:47 2014 New Revision: 271852 URL: http://svnweb.freebsd.org/changeset/base/271852 Log: Remove disabled code, that is very unlikely to be ever enabled again, as well as the comment that explains why is it disabled. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Sep 19 05:03:11 2014 (r271851) +++ head/sys/netinet/ip_output.c Fri Sep 19 05:23:47 2014 (r271852) @@ -446,43 +446,6 @@ again: } /* - * Both in the SMP world, pre-emption world if_transmit() world, - * the following code doesn't really function as intended any further. - * - * + There can and will be multiple CPUs running this code path - * in parallel, and we do no lock holding when checking the - * queue depth; - * + And since other threads can be running concurrently, even if - * we do pass this check, another thread may queue some frames - * before this thread does and it will end up partially or fully - * failing to send anyway; - * + if_transmit() based drivers don't necessarily set ifq_len - * at all. - * - * This should be replaced with a method of pushing an entire list - * of fragment frames to the driver and have the driver decide - * whether it can queue or not queue the entire set. - */ -#if 0 - /* - * Verify that we have any chance at all of being able to queue the - * packet or packet fragments, unless ALTQ is enabled on the given - * interface in which case packetdrop should be done by queueing. - */ - n = ip_len / mtu + 1; /* how many fragments ? */ - if ( -#ifdef ALTQ - (!ALTQ_IS_ENABLED(&ifp->if_snd)) && -#endif /* ALTQ */ - (ifp->if_snd.ifq_len + n) >= ifp->if_snd.ifq_maxlen ) { - error = ENOBUFS; - IPSTAT_INC(ips_odropped); - ifp->if_snd.ifq_drops += n; - goto bad; - } -#endif - - /* * Look for broadcast address and * verify user is allowed to send * such a packet. From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 05:43:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAA07A80; Fri, 19 Sep 2014 05:43:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB412B08; Fri, 19 Sep 2014 05:43:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J5hcmB007113; Fri, 19 Sep 2014 05:43:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J5hclw007112; Fri, 19 Sep 2014 05:43:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190543.s8J5hclw007112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 05:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271853 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 05:43:39 -0000 Author: glebius Date: Fri Sep 19 05:43:38 2014 New Revision: 271853 URL: http://svnweb.freebsd.org/changeset/base/271853 Log: Increase errors, not queue drops, in cases the module is supplied with a bad packet or if mbuf allocation failes. Modified: head/sys/net/if_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Fri Sep 19 05:23:47 2014 (r271852) +++ head/sys/net/if_gre.c Fri Sep 19 05:43:38 2014 (r271853) @@ -361,7 +361,7 @@ gre_output(struct ifnet *ifp, struct mbu * be encapsulated. */ if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) { - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EINVAL; /* is there better errno? */ goto end; @@ -390,7 +390,7 @@ gre_output(struct ifnet *ifp, struct mbu if ((m->m_data - msiz) < m->m_pktdat) { m0 = m_gethdr(M_NOWAIT, MT_DATA); if (m0 == NULL) { - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = ENOBUFS; goto end; @@ -415,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbu memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz); ip->ip_len = htons(ntohs(ip->ip_len) + msiz); } else { /* AF_INET */ - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EINVAL; goto end; @@ -440,7 +440,7 @@ gre_output(struct ifnet *ifp, struct mbu break; #endif default: - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EAFNOSUPPORT; goto end; @@ -452,14 +452,14 @@ gre_output(struct ifnet *ifp, struct mbu hdrlen += sizeof(uint32_t); M_PREPEND(m, hdrlen, M_NOWAIT); } else { - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EINVAL; goto end; } if (m == NULL) { /* mbuf allocation failed */ - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; error = ENOBUFS; goto end; } From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 07:18:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68426B35; Fri, 19 Sep 2014 07:18:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54083351; Fri, 19 Sep 2014 07:18:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J7IkAv048834; Fri, 19 Sep 2014 07:18:46 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J7IkSd048833; Fri, 19 Sep 2014 07:18:46 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409190718.s8J7IkSd048833@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Fri, 19 Sep 2014 07:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271854 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 07:18:46 -0000 Author: hrs Date: Fri Sep 19 07:18:45 2014 New Revision: 271854 URL: http://svnweb.freebsd.org/changeset/base/271854 Log: Fix cdev. It is a device node name, not a pathname. Modified: head/etc/devd/hyperv.conf Modified: head/etc/devd/hyperv.conf ============================================================================== --- head/etc/devd/hyperv.conf Fri Sep 19 05:43:38 2014 (r271853) +++ head/etc/devd/hyperv.conf Fri Sep 19 07:18:45 2014 (r271854) @@ -6,7 +6,7 @@ notify 10 { match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "CREATE"; - match "cdev" "/dev/hv_kvp_dev"; + match "cdev" "hv_kvp_dev"; action "/usr/sbin/hv_kvp_daemon"; }; @@ -14,6 +14,6 @@ notify 10 { match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "DESTROY"; - match "cdev" "/dev/hv_kvp_dev"; + match "cdev" "hv_kvp_dev"; action "pkill -x hv_kvp_daemon"; }; From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 07:44:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C07CA2CF; Fri, 19 Sep 2014 07:44:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABA0F80B; Fri, 19 Sep 2014 07:44:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J7inRP062417; Fri, 19 Sep 2014 07:44:49 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J7in0v062415; Fri, 19 Sep 2014 07:44:49 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201409190744.s8J7in0v062415@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Fri, 19 Sep 2014 07:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271855 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 07:44:49 -0000 Author: phk Date: Fri Sep 19 07:44:49 2014 New Revision: 271855 URL: http://svnweb.freebsd.org/changeset/base/271855 Log: This is a white-space/comment cleanup commit as a precursor for some upcoming work on the NTP kernel PLL. Modified: head/sys/sys/timex.h Modified: head/sys/sys/timex.h ============================================================================== --- head/sys/sys/timex.h Fri Sep 19 07:18:45 2014 (r271854) +++ head/sys/sys/timex.h Fri Sep 19 07:44:49 2014 (r271855) @@ -2,6 +2,7 @@ *********************************************************************** * * * Copyright (c) David L. Mills 1993-2001 * + * Copyright (c) Poul-Henning Kamp 2000-2001 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose and without fee is hereby * @@ -15,94 +16,30 @@ * purpose. It is provided "as is" without express or implied * * warranty. * * * - **********************************************************************/ - -/* - * Modification history timex.h - * - * 16 Aug 00 David L. Mills - * API Version 4. Added MOD_TAI and tai member of ntptimeval - * structure. - * - * 17 Nov 98 David L. Mills - * Revised for nanosecond kernel and user interface. - * - * 26 Sep 94 David L. Mills - * Added defines for hybrid phase/frequency-lock loop. + *********************************************************************** * - * 19 Mar 94 David L. Mills - * Moved defines from kernel routines to header file and added new - * defines for PPS phase-lock loop. + * $FreeBSD$ * - * 20 Feb 94 David L. Mills - * Revised status codes and structures for external clock and PPS - * signal discipline. + * This header file defines the Network Time Protocol (NTP) interfaces + * for user and daemon application programs. * - * 28 Nov 93 David L. Mills - * Adjusted parameters to improve stability and increase poll - * interval. + * This file was originally created 17 Sep 93 by David L. Mills, Professor + * of University of Delaware, building on work which had already been ongoing + * for a decade and a half at that point in time. * - * 17 Sep 93 David L. Mills - * Created file + * In 2000 the APIs got a upgrade from microseconds to nanoseconds, + * a joint work between Poul-Henning Kamp and David L. Mills. * - * $FreeBSD$ - */ -/* - * This header file defines the Network Time Protocol (NTP) interfaces - * for user and daemon application programs. These are implemented using - * defined syscalls and data structures and require specific kernel - * support. - * - * The original precision time kernels developed from 1993 have an - * ultimate resolution of one microsecond; however, the most recent - * kernels have an ultimate resolution of one nanosecond. In these - * kernels, a ntp_adjtime() syscalls can be used to determine which - * resolution is in use and to select either one at any time. The - * resolution selected affects the scaling of certain fields in the - * ntp_gettime() and ntp_adjtime() syscalls, as described below. - * - * NAME - * ntp_gettime - NTP user application interface - * - * SYNOPSIS - * #include - * - * int ntp_gettime(struct ntptimeval *ntv); - * - * DESCRIPTION - * The time returned by ntp_gettime() is in a timespec structure, - * but may be in either microsecond (seconds and microseconds) or - * nanosecond (seconds and nanoseconds) format. The particular - * format in use is determined by the STA_NANO bit of the status - * word returned by the ntp_adjtime() syscall. - * - * NAME - * ntp_adjtime - NTP daemon application interface - * - * SYNOPSIS - * #include - * #include - * - * int syscall(SYS_ntp_adjtime, tptr); - * int SYS_ntp_adjtime; - * struct timex *tptr; - * - * DESCRIPTION - * Certain fields of the timex structure are interpreted in either - * microseconds or nanoseconds according to the state of the - * STA_NANO bit in the status word. See the description below for - * further information. */ + #ifndef _SYS_TIMEX_H_ #define _SYS_TIMEX_H_ 1 -#define NTP_API 4 /* NTP API version */ + +#define NTP_API 4 /* NTP API version */ #ifdef __FreeBSD__ #include #endif /* __FreeBSD__ */ -#ifndef MSDOS /* Microsoft specific */ -#include -#endif /* MSDOS */ /* * The following defines establish the performance envelope of the @@ -113,112 +50,107 @@ * mode. Between these two limits the operating mode is selected by the * STA_FLL bit in the status word. */ -#define MAXPHASE 500000000L /* max phase error (ns) */ -#define MAXFREQ 500000L /* max freq error (ns/s) */ -#define MINSEC 256 /* min FLL update interval (s) */ -#define MAXSEC 2048 /* max PLL update interval (s) */ -#define NANOSECOND 1000000000L /* nanoseconds in one second */ -#define SCALE_PPM (65536 / 1000) /* crude ns/s to scaled PPM */ -#define MAXTC 10 /* max time constant */ + +#define MAXPHASE 500000000L /* max phase error (ns) */ +#define MAXFREQ 500000L /* max freq error (ns/s) */ +#define MINSEC 256 /* min FLL update interval (s) */ +#define MAXSEC 2048 /* max PLL update interval (s) */ +#define NANOSECOND 1000000000L /* nanoseconds in one second */ +#define SCALE_PPM (65536 / 1000) /* crude ns/s to scaled PPM */ +#define MAXTC 10 /* max time constant */ /* - * The following defines and structures define the user interface for - * the ntp_gettime() and ntp_adjtime() syscalls. - * * Control mode codes (timex.modes) */ -#define MOD_OFFSET 0x0001 /* set time offset */ -#define MOD_FREQUENCY 0x0002 /* set frequency offset */ -#define MOD_MAXERROR 0x0004 /* set maximum time error */ -#define MOD_ESTERROR 0x0008 /* set estimated time error */ -#define MOD_STATUS 0x0010 /* set clock status bits */ -#define MOD_TIMECONST 0x0020 /* set PLL time constant */ -#define MOD_PPSMAX 0x0040 /* set PPS maximum averaging time */ -#define MOD_TAI 0x0080 /* set TAI offset */ -#define MOD_MICRO 0x1000 /* select microsecond resolution */ -#define MOD_NANO 0x2000 /* select nanosecond resolution */ -#define MOD_CLKB 0x4000 /* select clock B */ -#define MOD_CLKA 0x8000 /* select clock A */ +#define MOD_OFFSET 0x0001 /* set time offset */ +#define MOD_FREQUENCY 0x0002 /* set frequency offset */ +#define MOD_MAXERROR 0x0004 /* set maximum time error */ +#define MOD_ESTERROR 0x0008 /* set estimated time error */ +#define MOD_STATUS 0x0010 /* set clock status bits */ +#define MOD_TIMECONST 0x0020 /* set PLL time constant */ +#define MOD_PPSMAX 0x0040 /* set PPS maximum averaging time */ +#define MOD_TAI 0x0080 /* set TAI offset */ +#define MOD_MICRO 0x1000 /* select microsecond resolution */ +#define MOD_NANO 0x2000 /* select nanosecond resolution */ +#define MOD_CLKB 0x4000 /* select clock B */ +#define MOD_CLKA 0x8000 /* select clock A */ /* * Status codes (timex.status) */ -#define STA_PLL 0x0001 /* enable PLL updates (rw) */ -#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */ -#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */ -#define STA_FLL 0x0008 /* enable FLL mode (rw) */ -#define STA_INS 0x0010 /* insert leap (rw) */ -#define STA_DEL 0x0020 /* delete leap (rw) */ -#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */ -#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */ -#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */ -#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */ -#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */ -#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ -#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ -#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ -#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ -#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ +#define STA_PLL 0x0001 /* enable PLL updates (rw) */ +#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */ +#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */ +#define STA_FLL 0x0008 /* enable FLL mode (rw) */ +#define STA_INS 0x0010 /* insert leap (rw) */ +#define STA_DEL 0x0020 /* delete leap (rw) */ +#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */ +#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */ +#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */ +#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */ +#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */ +#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ +#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ +#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ +#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ +#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) /* - * Clock states (time_state) + * Clock states (ntptimeval.time_state) */ -#define TIME_OK 0 /* no leap second warning */ -#define TIME_INS 1 /* insert leap second warning */ -#define TIME_DEL 2 /* delete leap second warning */ -#define TIME_OOP 3 /* leap second in progress */ -#define TIME_WAIT 4 /* leap second has occured */ -#define TIME_ERROR 5 /* error (see status word) */ +#define TIME_OK 0 /* no leap second warning */ +#define TIME_INS 1 /* insert leap second warning */ +#define TIME_DEL 2 /* delete leap second warning */ +#define TIME_OOP 3 /* leap second in progress */ +#define TIME_WAIT 4 /* leap second has occured */ +#define TIME_ERROR 5 /* error (see status word) */ /* - * NTP user interface (ntp_gettime()) - used to read kernel clock values - * - * Note: The time member is in microseconds if STA_NANO is zero and - * nanoseconds if not. + * NTP user interface -- ntp_gettime(2) - used to read kernel clock values */ struct ntptimeval { - struct timespec time; /* current time (ns) (ro) */ - long maxerror; /* maximum error (us) (ro) */ - long esterror; /* estimated error (us) (ro) */ - long tai; /* TAI offset */ - int time_state; /* time status */ + struct timespec time; /* current time (ns) (ro) */ + long maxerror; /* maximum error (us) (ro) */ + long esterror; /* estimated error (us) (ro) */ + long tai; /* TAI offset */ + int time_state; /* time status */ }; /* - * NTP daemon interface (ntp_adjtime()) - used to discipline CPU clock - * oscillator and determine status. + * NTP daemon interface -- ntp_adjtime(2) -- used to discipline CPU clock + * oscillator and control/determine status. * * Note: The offset, precision and jitter members are in microseconds if * STA_NANO is zero and nanoseconds if not. */ struct timex { - unsigned int modes; /* clock mode bits (wo) */ - long offset; /* time offset (ns/us) (rw) */ - long freq; /* frequency offset (scaled PPM) (rw) */ - long maxerror; /* maximum error (us) (rw) */ - long esterror; /* estimated error (us) (rw) */ - int status; /* clock status bits (rw) */ - long constant; /* poll interval (log2 s) (rw) */ - long precision; /* clock precision (ns/us) (ro) */ - long tolerance; /* clock frequency tolerance (scaled - * PPM) (ro) */ + unsigned int modes; /* clock mode bits (wo) */ + long offset; /* time offset (ns/us) (rw) */ + long freq; /* frequency offset (scaled PPM) (rw) */ + long maxerror; /* maximum error (us) (rw) */ + long esterror; /* estimated error (us) (rw) */ + int status; /* clock status bits (rw) */ + long constant; /* poll interval (log2 s) (rw) */ + long precision; /* clock precision (ns/us) (ro) */ + long tolerance; /* clock frequency tolerance (scaled + * PPM) (ro) */ /* * The following read-only structure members are implemented * only if the PPS signal discipline is configured in the * kernel. They are included in all configurations to insure * portability. */ - long ppsfreq; /* PPS frequency (scaled PPM) (ro) */ - long jitter; /* PPS jitter (ns/us) (ro) */ - int shift; /* interval duration (s) (shift) (ro) */ - long stabil; /* PPS stability (scaled PPM) (ro) */ - long jitcnt; /* jitter limit exceeded (ro) */ - long calcnt; /* calibration intervals (ro) */ - long errcnt; /* calibration errors (ro) */ - long stbcnt; /* stability limit exceeded (ro) */ + long ppsfreq; /* PPS frequency (scaled PPM) (ro) */ + long jitter; /* PPS jitter (ns/us) (ro) */ + int shift; /* interval duration (s) (shift) (ro) */ + long stabil; /* PPS stability (scaled PPM) (ro) */ + long jitcnt; /* jitter limit exceeded (ro) */ + long calcnt; /* calibration intervals (ro) */ + long errcnt; /* calibration errors (ro) */ + long stbcnt; /* stability limit exceeded (ro) */ }; #ifdef __FreeBSD__ From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 09:01:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC7697BB; Fri, 19 Sep 2014 09:01:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B3C6FD9; Fri, 19 Sep 2014 09:01:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J91OgY096792; Fri, 19 Sep 2014 09:01:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J91KvK096766; Fri, 19 Sep 2014 09:01:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190901.s8J91KvK096766@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 09:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271856 - in head: share/man/man9 sys/contrib/altq/altq sys/dev/ce sys/dev/cp sys/dev/ctau sys/dev/cx sys/dev/cxgb sys/dev/lmc sys/dev/mxge sys/net sys/netgraph sys/netgraph/bluetooth/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 09:01:24 -0000 Author: glebius Date: Fri Sep 19 09:01:19 2014 New Revision: 271856 URL: http://svnweb.freebsd.org/changeset/base/271856 Log: Remove ifq_drops from struct ifqueue. Now queue drops are accounted in struct ifnet if_oqdrops. Some netgraph modules used ifqueue w/o ifnet. Accounting of queue drops is simply removed from them. There were no API to read this statistic. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/share/man/man9/altq.9 head/sys/contrib/altq/altq/if_altq.h head/sys/dev/ce/if_ce.c head/sys/dev/cp/if_cp.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/if_cx.c head/sys/dev/cxgb/cxgb_main.c head/sys/dev/lmc/if_lmc.c head/sys/dev/mxge/if_mxge.c head/sys/net/if.c head/sys/net/if_debug.c head/sys/net/if_epair.c head/sys/net/if_mib.c head/sys/net/ifq.h head/sys/net/rtsock.c head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c head/sys/netgraph/ng_device.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_tty.c head/sys/netpfil/pf/if_pflog.c head/sys/netpfil/pf/if_pfsync.c Modified: head/share/man/man9/altq.9 ============================================================================== --- head/share/man/man9/altq.9 Fri Sep 19 07:44:49 2014 (r271855) +++ head/share/man/man9/altq.9 Fri Sep 19 09:01:19 2014 (r271856) @@ -256,7 +256,6 @@ still work with struct mbuf *ifq_tail; | struct mbuf *ifq_tail; int ifq_len; | int ifq_len; int ifq_maxlen; | int ifq_maxlen; - int ifq_drops; | int ifq_drops; }; | /* driver queue fields */ | ...... | /* altq related fields */ Modified: head/sys/contrib/altq/altq/if_altq.h ============================================================================== --- head/sys/contrib/altq/altq/if_altq.h Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/contrib/altq/altq/if_altq.h Fri Sep 19 09:01:19 2014 (r271856) @@ -50,7 +50,6 @@ struct ifaltq { struct mbuf *ifq_tail; int ifq_len; int ifq_maxlen; - int ifq_drops; #ifdef __FreeBSD__ struct mtx ifq_mtx; #endif Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/dev/ce/if_ce.c Fri Sep 19 09:01:19 2014 (r271856) @@ -2408,7 +2408,6 @@ static int ng_ce_rcvdata (hook_p hook, s #if __FreeBSD_version >= 500000 IF_LOCK (q); if (_IF_QFULL (q)) { - _IF_DROP (q); IF_UNLOCK (q); CE_UNLOCK (bd); splx (s); Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/dev/cp/if_cp.c Fri Sep 19 09:01:19 2014 (r271856) @@ -2141,7 +2141,6 @@ static int ng_cp_rcvdata (hook_p hook, i CP_LOCK (bd); IF_LOCK (q); if (_IF_QFULL (q)) { - _IF_DROP (q); IF_UNLOCK (q); CP_UNLOCK (bd); splx (s); Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/dev/ctau/if_ct.c Fri Sep 19 09:01:19 2014 (r271856) @@ -2083,7 +2083,6 @@ static int ng_ct_rcvdata (hook_p hook, i CT_LOCK (bd); IF_LOCK (q); if (_IF_QFULL (q)) { - _IF_DROP (q); IF_UNLOCK (q); CT_UNLOCK (bd); splx (s); Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/dev/cx/if_cx.c Fri Sep 19 09:01:19 2014 (r271856) @@ -2421,7 +2421,6 @@ static int ng_cx_rcvdata (hook_p hook, i CX_LOCK (bd); IF_LOCK (q); if (_IF_QFULL (q)) { - _IF_DROP (q); IF_UNLOCK (q); CX_UNLOCK (bd); splx (s); Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/dev/cxgb/cxgb_main.c Fri Sep 19 09:01:19 2014 (r271856) @@ -2357,7 +2357,7 @@ cxgb_tick_handler(void *arg, int count) drops = 0; for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; j++) drops += sc->sge.qs[j].txq[TXQ_ETH].txq_mr->br_drops; - ifp->if_snd.ifq_drops = drops; + ifp->if_oqdrops = drops; ifp->if_oerrors = mstats->tx_excess_collisions + Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/dev/lmc/if_lmc.c Fri Sep 19 09:01:19 2014 (r271856) @@ -4635,6 +4635,7 @@ lmc_raw_output(struct ifnet *ifp, struct { m_freem(m); sc->status.cntrs.odiscards++; + ifp->if_oqdrops++; if (DRIVER_DEBUG) printf("%s: lmc_raw_output: IFQ_ENQUEUE() failed; error %d\n", NAME_UNIT, error); Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/dev/mxge/if_mxge.c Fri Sep 19 09:01:19 2014 (r271856) @@ -4069,7 +4069,7 @@ mxge_update_stats(mxge_softc_t *sc) #ifdef IFNET_BUF_RING sc->ifp->if_obytes = obytes; sc->ifp->if_omcasts = omcasts; - sc->ifp->if_snd.ifq_drops = odrops; + sc->ifp->if_oqdrops = odrops; #endif sc->ifp->if_oerrors = oerrors; return pkts; Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/net/if.c Fri Sep 19 09:01:19 2014 (r271856) @@ -3521,8 +3521,8 @@ if_handoff(struct ifqueue *ifq, struct m IF_LOCK(ifq); if (_IF_QFULL(ifq)) { - _IF_DROP(ifq); IF_UNLOCK(ifq); + ifp->if_oqdrops++; m_freem(m); return (0); } Modified: head/sys/net/if_debug.c ============================================================================== --- head/sys/net/if_debug.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/net/if_debug.c Fri Sep 19 09:01:19 2014 (r271856) @@ -79,7 +79,6 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%p", if_snd.ifq_tail); IF_DB_PRINTF("%d", if_snd.ifq_len); IF_DB_PRINTF("%d", if_snd.ifq_maxlen); - IF_DB_PRINTF("%d", if_snd.ifq_drops); IF_DB_PRINTF("%p", if_snd.ifq_drv_head); IF_DB_PRINTF("%p", if_snd.ifq_drv_tail); IF_DB_PRINTF("%d", if_snd.ifq_drv_len); Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/net/if_epair.c Fri Sep 19 09:01:19 2014 (r271856) @@ -517,7 +517,7 @@ epair_transmit_locked(struct ifnet *ifp, if (ALTQ_IS_ENABLED(&ifp->if_snd)) { ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error); if (error) - ifp->if_snd.ifq_drops++; + ifp->if_oqdrops++; IF_UNLOCK(&ifp->if_snd); if (!error) { ifp->if_obytes += len; Modified: head/sys/net/if_mib.c ============================================================================== --- head/sys/net/if_mib.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/net/if_mib.c Fri Sep 19 09:01:19 2014 (r271856) @@ -105,7 +105,8 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX ifmd.ifmd_flags = ifp->if_flags | ifp->if_drv_flags; ifmd.ifmd_snd_len = ifp->if_snd.ifq_len; ifmd.ifmd_snd_maxlen = ifp->if_snd.ifq_maxlen; - ifmd.ifmd_snd_drops = ifp->if_snd.ifq_drops; + ifmd.ifmd_snd_drops = + ifp->if_get_counter(ifp, IFCOUNTER_OQDROPS); error = SYSCTL_OUT(req, &ifmd, sizeof ifmd); if (error) Modified: head/sys/net/ifq.h ============================================================================== --- head/sys/net/ifq.h Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/net/ifq.h Fri Sep 19 09:01:19 2014 (r271856) @@ -53,7 +53,6 @@ struct ifqueue { struct mbuf *ifq_tail; int ifq_len; int ifq_maxlen; - int ifq_drops; struct mtx ifq_mtx; }; @@ -68,7 +67,6 @@ struct ifqueue { #define IF_UNLOCK(ifq) mtx_unlock(&(ifq)->ifq_mtx) #define IF_LOCK_ASSERT(ifq) mtx_assert(&(ifq)->ifq_mtx, MA_OWNED) #define _IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen) -#define _IF_DROP(ifq) ((ifq)->ifq_drops++) #define _IF_QLEN(ifq) ((ifq)->ifq_len) #define _IF_ENQUEUE(ifq, m) do { \ @@ -171,8 +169,6 @@ do { \ (err) = 0; \ } \ } \ - if (err) \ - (ifq)->ifq_drops++; \ IF_UNLOCK(ifq); \ } while (0) @@ -234,7 +230,6 @@ do { \ #define IFQ_IS_EMPTY(ifq) ((ifq)->ifq_len == 0) #define IFQ_INC_LEN(ifq) ((ifq)->ifq_len++) #define IFQ_DEC_LEN(ifq) (--(ifq)->ifq_len) -#define IFQ_INC_DROPS(ifq) ((ifq)->ifq_drops++) #define IFQ_SET_MAXLEN(ifq, len) ((ifq)->ifq_maxlen = (len)) /* @@ -255,7 +250,8 @@ do { \ (ifp)->if_omcasts++; \ if (((ifp)->if_drv_flags & IFF_DRV_OACTIVE) == 0) \ if_start(ifp); \ - } \ + } else \ + ifp->if_oqdrops++; \ } while (0) #define IFQ_HANDOFF(ifp, m, err) \ @@ -321,6 +317,8 @@ drbr_enqueue(struct ifnet *ifp, struct b #ifdef ALTQ if (ALTQ_IS_ENABLED(&ifp->if_snd)) { IFQ_ENQUEUE(&ifp->if_snd, m, error); + if (error) + ifp->if_oqdrops++; return (error); } #endif Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/net/rtsock.c Fri Sep 19 09:01:19 2014 (r271856) @@ -1577,9 +1577,6 @@ sysctl_iflist_ifml(struct ifnet *ifp, st if_data_copy(ifp, ifd); - /* Some drivers still use ifqueue(9), add its stats. */ - ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; - return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } @@ -1612,9 +1609,6 @@ sysctl_iflist_ifm(struct ifnet *ifp, str if_data_copy(ifp, ifd); - /* Some drivers still use ifqueue(9), add its stats. */ - ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; - return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } Modified: head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Fri Sep 19 09:01:19 2014 (r271856) @@ -560,7 +560,6 @@ ng_bt3c_rcvdata(hook_p hook, item_p item NG_BT3C_ERR(sc->dev, "Outgoing queue is full. Dropping mbuf, len=%d\n", m->m_pkthdr.len); - _IF_DROP(&sc->outq); NG_BT3C_STAT_OERROR(sc->stat); NG_FREE_M(m); @@ -939,7 +938,6 @@ bt3c_receive(bt3c_softc_p sc) NG_BT3C_ERR(sc->dev, "Incoming queue is full. Dropping mbuf, len=%d\n", sc->m->m_pkthdr.len); - _IF_DROP(&sc->inq); NG_BT3C_STAT_IERROR(sc->stat); NG_FREE_M(sc->m); Modified: head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c Fri Sep 19 09:01:19 2014 (r271856) @@ -798,7 +798,6 @@ ng_h4_rcvdata(hook_p hook, item_p item) NG_NODE_NAME(sc->node), m->m_pkthdr.len); NG_H4_STAT_OERROR(sc->stat); - _IF_DROP(&sc->outq); NG_H4_UNLOCK(sc); Modified: head/sys/netgraph/ng_device.c ============================================================================== --- head/sys/netgraph/ng_device.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/netgraph/ng_device.c Fri Sep 19 09:01:19 2014 (r271856) @@ -270,7 +270,6 @@ ng_device_rcvdata(hook_p hook, item_p it IF_LOCK(&priv->readq); if (_IF_QFULL(&priv->readq)) { - _IF_DROP(&priv->readq); IF_UNLOCK(&priv->readq); NG_FREE_M(m); return (ENOBUFS); Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/netgraph/ng_iface.c Fri Sep 19 09:01:19 2014 (r271856) @@ -393,10 +393,7 @@ ng_iface_output(struct ifnet *ifp, struc if (ALTQ_IS_ENABLED(&ifp->if_snd)) { M_PREPEND(m, sizeof(sa_family_t), M_NOWAIT); if (m == NULL) { - IFQ_LOCK(&ifp->if_snd); - IFQ_INC_DROPS(&ifp->if_snd); - IFQ_UNLOCK(&ifp->if_snd); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); return (ENOBUFS); } *(sa_family_t *)m->m_data = af; Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/netgraph/ng_tty.c Fri Sep 19 09:01:19 2014 (r271856) @@ -327,7 +327,6 @@ ngt_rcvdata(hook_p hook, item_p item) IF_LOCK(&sc->outq); if (_IF_QFULL(&sc->outq)) { - _IF_DROP(&sc->outq); IF_UNLOCK(&sc->outq); NG_FREE_M(m); return (ENOBUFS); Modified: head/sys/netpfil/pf/if_pflog.c ============================================================================== --- head/sys/netpfil/pf/if_pflog.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/netpfil/pf/if_pflog.c Fri Sep 19 09:01:19 2014 (r271856) @@ -159,7 +159,6 @@ pflogstart(struct ifnet *ifp) for (;;) { IF_LOCK(&ifp->if_snd); - _IF_DROP(&ifp->if_snd); _IF_DEQUEUE(&ifp->if_snd, m); IF_UNLOCK(&ifp->if_snd); Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Sep 19 07:44:49 2014 (r271855) +++ head/sys/netpfil/pf/if_pfsync.c Fri Sep 19 09:01:19 2014 (r271856) @@ -1640,7 +1640,7 @@ pfsync_sendout(int schedswi) _IF_ENQUEUE(&sc->sc_ifp->if_snd, m); else { m_freem(m); - sc->sc_ifp->if_snd.ifq_drops++; + sc->sc_ifp->if_oqdrops++; } if (schedswi) swi_sched(V_pfsync_swi_cookie, 0); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 09:19:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B96FBAE; Fri, 19 Sep 2014 09:19:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0EA224D; Fri, 19 Sep 2014 09:19:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J9JUcl005390; Fri, 19 Sep 2014 09:19:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J9JUkl005388; Fri, 19 Sep 2014 09:19:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190919.s8J9JUkl005388@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 09:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271857 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 09:19:31 -0000 Author: glebius Date: Fri Sep 19 09:19:29 2014 New Revision: 271857 URL: http://svnweb.freebsd.org/changeset/base/271857 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/netpfil/pf/if_pflog.c head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pflog.c ============================================================================== --- head/sys/netpfil/pf/if_pflog.c Fri Sep 19 09:01:19 2014 (r271856) +++ head/sys/netpfil/pf/if_pflog.c Fri Sep 19 09:19:29 2014 (r271857) @@ -252,8 +252,8 @@ pflog_packet(struct pfi_kif *kif, struct } #endif /* INET */ - ifn->if_opackets++; - ifn->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifn, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifn, IFCOUNTER_OBYTES, m->m_pkthdr.len); BPF_MTAP2(ifn, &hdr, PFLOG_HDRLEN, m); return (0); Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Sep 19 09:01:19 2014 (r271856) +++ head/sys/netpfil/pf/if_pfsync.c Fri Sep 19 09:19:29 2014 (r271857) @@ -598,8 +598,8 @@ pfsync_input(struct mbuf **mp, int *offp goto done; } - sc->sc_ifp->if_ipackets++; - sc->sc_ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(sc->sc_ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); /* verify that the IP TTL is 255. */ if (ip->ip_ttl != PFSYNC_DFLTTL) { V_pfsyncstats.pfsyncs_badttl++; @@ -1525,7 +1525,7 @@ pfsync_sendout(int schedswi) m = m_get2(max_linkhdr + sc->sc_len, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); V_pfsyncstats.pfsyncs_onomem++; return; } @@ -1632,15 +1632,15 @@ pfsync_sendout(int schedswi) return; } - sc->sc_ifp->if_opackets++; - sc->sc_ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(sc->sc_ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); sc->sc_len = PFSYNC_MINPKT; if (!_IF_QFULL(&sc->sc_ifp->if_snd)) _IF_ENQUEUE(&sc->sc_ifp->if_snd, m); else { m_freem(m); - sc->sc_ifp->if_oqdrops++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OQDROPS, 1); } if (schedswi) swi_sched(V_pfsync_swi_cookie, 0); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 09:19:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD6CACEF; Fri, 19 Sep 2014 09:19:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6A01250; Fri, 19 Sep 2014 09:19:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J9Jpdq005478; Fri, 19 Sep 2014 09:19:51 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J9JnoM005466; Fri, 19 Sep 2014 09:19:49 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190919.s8J9JnoM005466@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 09:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271858 - in head/sys/mips: adm5120 atheros cavium cavium/octe idt nlm/dev/net rmi/dev/nlge rmi/dev/xlr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 09:19:51 -0000 Author: glebius Date: Fri Sep 19 09:19:49 2014 New Revision: 271858 URL: http://svnweb.freebsd.org/changeset/base/271858 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/mips/adm5120/if_admsw.c head/sys/mips/atheros/if_arge.c head/sys/mips/cavium/if_octm.c head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/idt/if_kr.c head/sys/mips/nlm/dev/net/xlpge.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/adm5120/if_admsw.c Fri Sep 19 09:19:49 2014 (r271858) @@ -925,7 +925,7 @@ admsw_txintr(struct admsw_softc *sc, int gotone = 1; /* printf("clear tx slot %d\n",i); */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->sc_txfree++; } @@ -1047,7 +1047,7 @@ admsw_rxintr(struct admsw_softc *sc, int m = ds->ds_mbuf; if (admsw_add_rxlbuf(sc, i) != 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); ADMSW_INIT_RXLDESC(sc, i); bus_dmamap_sync(sc->sc_bufs_dmat, ds->ds_dmamap, BUS_DMASYNC_PREREAD); @@ -1066,7 +1066,7 @@ admsw_rxintr(struct admsw_softc *sc, int /* Pass it on. */ (*ifp->if_input)(ifp, m); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); } /* Update the receive pointer. */ Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/atheros/if_arge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -2147,7 +2147,7 @@ arge_tx_locked(struct arge_softc *sc) txd = &sc->arge_cdata.arge_txdesc[cons]; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); bus_dmamap_sync(sc->arge_cdata.arge_tx_tag, txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); @@ -2209,7 +2209,7 @@ arge_rx_locked(struct arge_softc *sc) m->m_pkthdr.rcvif = ifp; /* Skip 4 bytes of CRC */ m->m_pkthdr.len = m->m_len = packet_len - ETHER_CRC_LEN; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); rx_npkts++; ARGE_UNLOCK(sc); Modified: head/sys/mips/cavium/if_octm.c ============================================================================== --- head/sys/mips/cavium/if_octm.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/cavium/if_octm.c Fri Sep 19 09:19:49 2014 (r271858) @@ -347,10 +347,10 @@ octm_transmit(struct ifnet *ifp, struct if (result == CVMX_MGMT_PORT_SUCCESS) { ETHER_BPF_MTAP(ifp, m); - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); } else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); @@ -517,7 +517,7 @@ octm_rx_intr(void *arg) m->m_pkthdr.rcvif = sc->sc_ifp; m->m_pkthdr.len = m->m_len = len; - sc->sc_ifp->if_ipackets++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); (*sc->sc_ifp->if_input)(sc->sc_ifp, m); @@ -529,7 +529,7 @@ octm_rx_intr(void *arg) if (len == 0) break; - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); } /* Acknowledge interrupts. */ Modified: head/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rx.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/cavium/octe/ethernet-rx.c Fri Sep 19 09:19:49 2014 (r271858) @@ -304,7 +304,7 @@ void cvm_oct_tasklet_rx(void *context, i m->m_pkthdr.csum_flags = 0; /* XXX */ } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } else { Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/cavium/octe/ethernet-tx.c Fri Sep 19 09:19:49 2014 (r271858) @@ -158,7 +158,7 @@ int cvm_oct_xmit(struct mbuf *m, struct work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); if (work == NULL) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return 1; } @@ -231,7 +231,7 @@ int cvm_oct_xmit(struct mbuf *m, struct if (__predict_false(dropped)) { m_freem(m); cvmx_fau_atomic_add32(priv->fau+qos*4, -1); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else { /* Put this packet on the queue to be freed later */ _IF_ENQUEUE(&priv->tx_free_queue[qos], m); @@ -239,8 +239,8 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Pass it to any BPF listeners. */ ETHER_BPF_MTAP(ifp, m); - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); } /* Free mbufs not in use by the hardware */ Modified: head/sys/mips/idt/if_kr.c ============================================================================== --- head/sys/mips/idt/if_kr.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/idt/if_kr.c Fri Sep 19 09:19:49 2014 (r271858) @@ -1395,13 +1395,13 @@ kr_tx(struct kr_softc *sc) txd = &sc->kr_cdata.kr_txdesc[cons]; if (devcs & KR_DMATX_DEVCS_TOK) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* collisions: medium busy, late collision */ if ((devcs & KR_DMATX_DEVCS_EC) || (devcs & KR_DMATX_DEVCS_LC)) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } bus_dmamap_sync(sc->kr_cdata.kr_tx_tag, txd->tx_dmamap, @@ -1460,11 +1460,11 @@ kr_rx(struct kr_softc *sc) error = 1; if (packet_len != count) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); else if (count < 64) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); else if ((cur_rx->kr_devcs & KR_DMARX_DEVCS_LD) == 0) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); else if ((cur_rx->kr_devcs & KR_DMARX_DEVCS_ROK) != 0) { error = 0; bus_dmamap_sync(sc->kr_cdata.kr_rx_tag, rxd->rx_dmamap, @@ -1474,7 +1474,7 @@ kr_rx(struct kr_softc *sc) m->m_pkthdr.rcvif = ifp; /* Skip 4 bytes of CRC */ m->m_pkthdr.len = m->m_len = packet_len - ETHER_CRC_LEN; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); KR_UNLOCK(sc); (*ifp->if_input)(ifp, m); Modified: head/sys/mips/nlm/dev/net/xlpge.c ============================================================================== --- head/sys/mips/nlm/dev/net/xlpge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/nlm/dev/net/xlpge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -897,8 +897,7 @@ fail: if (p2p) uma_zfree(nl_tx_desc_zone, p2p); m_freem(mbuf_chain); - /*atomic_incr_long(&ifp->if_iqdrops); */ - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (err); } @@ -1433,8 +1432,7 @@ nlm_xlpge_rx(struct nlm_xlpge_softc *sc, } else m->m_pkthdr.len = m->m_len = len; - /*atomic_incr_long(&ifp->if_ipackets);*/ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); #ifdef XLP_DRIVER_LOOPBACK if (port == 16 || port == 17) (*ifp->if_input)(ifp, m); @@ -1515,8 +1513,7 @@ nlm_xlpge_msgring_handler(int vc, int si nlm_xlpge_release_mbuf(phys_addr); - /*atomic_incr_long(&ifp->if_opackets);*/ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } else if (size > 1) { /* Recieve packet */ phys_addr = msg->msg[1] & 0xffffffffc0ULL; Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -697,7 +697,9 @@ nlge_msgring_handler(int bucket, int siz printf("ERROR: Tx fb error (%d) on port %d\n", tx_error, port); } - tx_error ? ifp->if_oerrors++ : ifp->if_opackets++; + tx_error ? + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1) : + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } else if (ctrl == CTRL_SNGL || ctrl == CTRL_START) { /* Rx Packet */ @@ -776,7 +778,7 @@ fail: NLGE_UNLOCK(sc); } m_freem(m); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); } return (error); } @@ -825,7 +827,7 @@ nlge_rx(struct nlge_softc *sc, vm_paddr_ m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/rmi/dev/xlr/rge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -2019,7 +2019,7 @@ rge_rx(struct rge_softc *sc, vm_paddr_t printf("\n"); } #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input) (ifp, m); } @@ -2116,7 +2116,7 @@ rge_start_locked(struct ifnet *ifp, int ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); xlr_rge_tx_done[vcpu]++; } } From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 09:20:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6BF3E30; Fri, 19 Sep 2014 09:20:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 904FE256; Fri, 19 Sep 2014 09:20:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J9KIca006121; Fri, 19 Sep 2014 09:20:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J9KHxC006114; Fri, 19 Sep 2014 09:20:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190920.s8J9KHxC006114@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 09:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271859 - in head/sys/arm: allwinner at91 cavium/cns11xx lpc ti/cpsw xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 09:20:18 -0000 Author: glebius Date: Fri Sep 19 09:20:16 2014 New Revision: 271859 URL: http://svnweb.freebsd.org/changeset/base/271859 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/arm/allwinner/if_emac.c head/sys/arm/at91/if_ate.c head/sys/arm/at91/if_macb.c head/sys/arm/cavium/cns11xx/if_ece.c head/sys/arm/lpc/if_lpe.c head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri Sep 19 09:19:49 2014 (r271858) +++ head/sys/arm/allwinner/if_emac.c Fri Sep 19 09:20:16 2014 (r271859) @@ -260,7 +260,7 @@ emac_txeof(struct emac_softc *sc) EMAC_ASSERT_LOCKED(sc); ifp = sc->emac_ifp; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Unarm watchdog timer if no TX */ @@ -340,12 +340,12 @@ emac_rxeof(struct emac_softc *sc, int co if_printf(ifp, "bad packet: len = %i status = %i\n", len, status); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } #if 0 if (status & (EMAC_CRCERR | EMAC_LENERR)) { good_packet = 0; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (status & EMAC_CRCERR) if_printf(ifp, "crc error\n"); if (status & EMAC_LENERR) @@ -393,18 +393,18 @@ emac_rxeof(struct emac_softc *sc, int co m0->m_next = m; m = m0; } else { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); m = NULL; continue; } } else if (m->m_len > EMAC_MAC_MAXF) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); m = NULL; continue; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); EMAC_UNLOCK(sc); (*ifp->if_input)(ifp, m); EMAC_LOCK(sc); @@ -431,7 +431,7 @@ emac_watchdog(struct emac_softc *sc) } else if_printf(sc->emac_ifp, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; emac_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Fri Sep 19 09:19:49 2014 (r271858) +++ head/sys/arm/at91/if_ate.c Fri Sep 19 09:20:16 2014 (r271859) @@ -776,19 +776,19 @@ ate_tick(void *xsc) sc->mibdata.dot3StatsAlignmentErrors += RD4(sc, ETH_ALE); sc->mibdata.dot3StatsFCSErrors += RD4(sc, ETH_SEQE); c = RD4(sc, ETH_SCOL); - ifp->if_collisions += c; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, c); sc->mibdata.dot3StatsSingleCollisionFrames += c; c = RD4(sc, ETH_MCOL); sc->mibdata.dot3StatsMultipleCollisionFrames += c; - ifp->if_collisions += c; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, c); sc->mibdata.dot3StatsSQETestErrors += RD4(sc, ETH_SQEE); sc->mibdata.dot3StatsDeferredTransmissions += RD4(sc, ETH_DTE); c = RD4(sc, ETH_LCOL); sc->mibdata.dot3StatsLateCollisions += c; - ifp->if_collisions += c; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, c); c = RD4(sc, ETH_ECOL); sc->mibdata.dot3StatsExcessiveCollisions += c; - ifp->if_collisions += c; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, c); sc->mibdata.dot3StatsCarrierSenseErrors += RD4(sc, ETH_CSE); sc->mibdata.dot3StatsFrameTooLongs += RD4(sc, ETH_ELR); sc->mibdata.dot3StatsInternalMacReceiveErrors += RD4(sc, ETH_DRFC); @@ -797,9 +797,9 @@ ate_tick(void *xsc) * Not sure where to lump these, so count them against the errors * for the interface. */ - sc->ifp->if_oerrors += RD4(sc, ETH_TUE); - sc->ifp->if_ierrors += RD4(sc, ETH_CDE) + RD4(sc, ETH_RJB) + - RD4(sc, ETH_USF); + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, RD4(sc, ETH_TUE)); + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, + RD4(sc, ETH_CDE) + RD4(sc, ETH_RJB) + RD4(sc, ETH_USF)); /* Schedule another timeout one second from now. */ callout_reset(&sc->tick_ch, hz, ate_tick, sc); @@ -914,7 +914,7 @@ ate_intr(void *xsc) mb = m_get2(remain + ETHER_ALIGN, M_NOWAIT, MT_DATA, M_PKTHDR); if (mb == NULL) { - sc->ifp->if_iqdrops++; + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); rxdhead->status = 0; continue; } @@ -957,7 +957,7 @@ ate_intr(void *xsc) } while (!done); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, mb); } } @@ -990,7 +990,7 @@ ate_intr(void *xsc) m_freem(sc->sent_mbuf[sc->txtail]); sc->tx_descs[sc->txtail].addr = 0; sc->sent_mbuf[sc->txtail] = NULL; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->txtail = NEXT_TX_IDX(sc, sc->txtail); } @@ -1162,7 +1162,7 @@ atestart_locked(struct ifnet *ifp) BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->mtag, sc->tx_map[sc->txtail]); m_free(sc->sent_mbuf[sc->txhead]); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } sc->sent_mbuf[sc->txhead] = m; Modified: head/sys/arm/at91/if_macb.c ============================================================================== --- head/sys/arm/at91/if_macb.c Fri Sep 19 09:19:49 2014 (r271858) +++ head/sys/arm/at91/if_macb.c Fri Sep 19 09:20:16 2014 (r271859) @@ -522,12 +522,12 @@ macb_watchdog(struct macb_softc *sc) ifp = sc->ifp; if ((sc->flags & MACB_FLAG_LINK) == 0) { if_printf(ifp, "watchdog timeout (missed link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return; } if_printf(ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; macbinit_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -677,7 +677,7 @@ macb_tx_cleanup(struct macb_softc *sc) td->dmamap); m_freem(td->buff); td->buff = NULL; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } do { @@ -732,7 +732,7 @@ macb_rx(struct macb_softc *sc) bus_dmamap_sync(sc->dmatag_ring_rx, sc->rx_desc[sc->rx_cons].dmamap, BUS_DMASYNC_POSTREAD); if (macb_new_rxbuf(sc, sc->rx_cons) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); first = sc->rx_cons; do { @@ -781,7 +781,7 @@ macb_rx(struct macb_softc *sc) m->m_flags |= M_PKTHDR; m->m_pkthdr.len = rxbytes; m->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); nsegs = 0; MACB_UNLOCK(sc); Modified: head/sys/arm/cavium/cns11xx/if_ece.c ============================================================================== --- head/sys/arm/cavium/cns11xx/if_ece.c Fri Sep 19 09:19:49 2014 (r271858) +++ head/sys/arm/cavium/cns11xx/if_ece.c Fri Sep 19 09:20:16 2014 (r271859) @@ -1379,7 +1379,7 @@ ece_intr_rx_locked(struct ece_softc *sc, if (desc->length < ETHER_MIN_LEN - ETHER_CRC_LEN || desc->length > ETHER_MAX_LEN - ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); desc->cown = 0; desc->length = MCLBYTES - 2; /* Invalid packet, skip and process next @@ -1389,7 +1389,7 @@ ece_intr_rx_locked(struct ece_softc *sc, } if (ece_new_rxbuf(sc, rxdesc) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); desc->cown = 0; desc->length = MCLBYTES - 2; break; @@ -1478,7 +1478,7 @@ ece_intr_status(void *xsc) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if ((stat & ERROR_MASK) != 0) - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); } } Modified: head/sys/arm/lpc/if_lpe.c ============================================================================== --- head/sys/arm/lpc/if_lpe.c Fri Sep 19 09:19:49 2014 (r271858) +++ head/sys/arm/lpc/if_lpe.c Fri Sep 19 09:20:16 2014 (r271859) @@ -754,7 +754,7 @@ lpe_rxintr(struct lpe_softc *sc) /* Check received frame for errors */ if (hws->lhs_info & LPE_HWDESC_RXERRS) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); lpe_discard_rxbuf(sc, cons); lpe_init_rxbuf(sc, cons); goto skip; @@ -764,7 +764,7 @@ lpe_rxintr(struct lpe_softc *sc) m->m_pkthdr.rcvif = ifp; m->m_data += 2; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); lpe_unlock(sc); (*ifp->if_input)(ifp, m); @@ -800,12 +800,12 @@ lpe_txintr(struct lpe_softc *sc) bus_dmamap_sync(sc->lpe_cdata.lpe_tx_buf_tag, txd->lpe_txdesc_dmamap, BUS_DMASYNC_POSTWRITE); - ifp->if_collisions += LPE_HWDESC_COLLISIONS(hws->lhs_info); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, LPE_HWDESC_COLLISIONS(hws->lhs_info)); if (hws->lhs_info & LPE_HWDESC_TXERRS) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); else - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (txd->lpe_txdesc_first) { bus_dmamap_unload(sc->lpe_cdata.lpe_tx_buf_tag, Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Fri Sep 19 09:19:49 2014 (r271858) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Sep 19 09:20:16 2014 (r271859) @@ -1837,7 +1837,7 @@ cpsw_tx_watchdog(struct cpsw_softc *sc) ++sc->watchdog.timer; if (sc->watchdog.timer > 2) { sc->watchdog.timer = 0; - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ++sc->watchdog.resets; cpsw_tx_watchdog_full_reset(sc); } Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Fri Sep 19 09:19:49 2014 (r271858) +++ head/sys/arm/xscale/ixp425/if_npe.c Fri Sep 19 09:20:16 2014 (r271859) @@ -906,20 +906,18 @@ npe_addstats(struct npe_softc *sc) be32toh(ns->RxOverrunDiscards) + be32toh(ns->RxUnderflowEntryDiscards); - ifp->if_oerrors += - be32toh(ns->dot3StatsInternalMacTransmitErrors) - + be32toh(ns->dot3StatsCarrierSenseErrors) - + be32toh(ns->TxVLANIdFilterDiscards) - ; - ifp->if_ierrors += be32toh(ns->dot3StatsFCSErrors) - + be32toh(ns->dot3StatsInternalMacReceiveErrors) - + be32toh(ns->RxOverrunDiscards) - + be32toh(ns->RxUnderflowEntryDiscards) - ; - ifp->if_collisions += - be32toh(ns->dot3StatsSingleCollisionFrames) - + be32toh(ns->dot3StatsMultipleCollisionFrames) - ; + if_inc_counter(ifp, IFCOUNTER_OERRORS, + be32toh(ns->dot3StatsInternalMacTransmitErrors) + + be32toh(ns->dot3StatsCarrierSenseErrors) + + be32toh(ns->TxVLANIdFilterDiscards)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, + be32toh(ns->dot3StatsFCSErrors) + + be32toh(ns->dot3StatsInternalMacReceiveErrors) + + be32toh(ns->RxOverrunDiscards) + + be32toh(ns->RxUnderflowEntryDiscards)); + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + be32toh(ns->dot3StatsSingleCollisionFrames) + + be32toh(ns->dot3StatsMultipleCollisionFrames)); #undef NPEADD #undef MIBADD } @@ -999,7 +997,7 @@ npe_txdone_finish(struct npe_softc *sc, * We're no longer busy, so clear the busy flag and call the * start routine to xmit more packets. */ - ifp->if_opackets += td->count; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, td->count); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->npe_watchdog_timer = 0; npestart_locked(ifp); @@ -1138,7 +1136,7 @@ npe_rxdone(int qid, void *arg) mrx->m_pkthdr.len = mrx->m_len; mrx->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); ifp->if_input(ifp, mrx); rx_npkts++; } else { @@ -1467,7 +1465,7 @@ npewatchdog(struct npe_softc *sc) return; device_printf(sc->sc_dev, "watchdog timeout\n"); - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); npeinit_locked(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 09:20:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6110DF72; Fri, 19 Sep 2014 09:20:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32513259; Fri, 19 Sep 2014 09:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J9KZtp008600; Fri, 19 Sep 2014 09:20:35 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J9KY2X008597; Fri, 19 Sep 2014 09:20:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190920.s8J9KY2X008597@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 09:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271860 - in head/sys/powerpc: ps3 pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 09:20:35 -0000 Author: glebius Date: Fri Sep 19 09:20:34 2014 New Revision: 271860 URL: http://svnweb.freebsd.org/changeset/base/271860 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/powerpc/ps3/if_glc.c head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/ps3/if_glc.c ============================================================================== --- head/sys/powerpc/ps3/if_glc.c Fri Sep 19 09:20:16 2014 (r271859) +++ head/sys/powerpc/ps3/if_glc.c Fri Sep 19 09:20:34 2014 (r271860) @@ -731,7 +731,7 @@ glc_rxintr(struct glc_softc *sc) restart_rxdma = 1; if (sc->sc_rxdmadesc[i].rxerror & GELIC_RXERRORS) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto requeue; } @@ -747,11 +747,11 @@ glc_rxintr(struct glc_softc *sc) } if (glc_add_rxbuf(sc, i)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto requeue; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; m->m_len = sc->sc_rxdmadesc[i].valid_size; m->m_pkthdr.len = m->m_len; @@ -810,7 +810,7 @@ glc_txintr(struct glc_softc *sc) != 0) { lv1_net_stop_tx_dma(sc->sc_bus, sc->sc_dev, 0); kickstart = 1; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } if (sc->sc_txdmadesc[txs->txs_lastdesc].cmd_stat & @@ -818,7 +818,7 @@ glc_txintr(struct glc_softc *sc) kickstart = 1; STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); progress = 1; } Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Fri Sep 19 09:20:16 2014 (r271859) +++ head/sys/powerpc/pseries/phyp_llan.c Fri Sep 19 09:20:34 2014 (r271860) @@ -345,13 +345,13 @@ llan_intr(void *xsc) /* llan_add_rxbuf does DMA sync and unload as well as requeue */ if (llan_add_rxbuf(sc, rx) != 0) { - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); phyp_hcall(H_ADD_LOGICAL_LAN_BUFFER, sc->unit, rx->rx_bufdesc); continue; } - sc->ifp->if_ipackets++; + if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1); m_adj(m, sc->rx_buf[sc->rx_dma_slot].offset); m->m_len = sc->rx_buf[sc->rx_dma_slot].length; m->m_pkthdr.rcvif = sc->ifp; From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 09:20:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3077A13D; Fri, 19 Sep 2014 09:20:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10875260; Fri, 19 Sep 2014 09:20:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J9Kvh5008706; Fri, 19 Sep 2014 09:20:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J9KtAc008696; Fri, 19 Sep 2014 09:20:55 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190920.s8J9KtAc008696@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 09:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271861 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 09:20:58 -0000 Author: glebius Date: Fri Sep 19 09:20:55 2014 New Revision: 271861 URL: http://svnweb.freebsd.org/changeset/base/271861 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_monitor.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211.c Fri Sep 19 09:20:55 2014 (r271861) @@ -238,7 +238,7 @@ static int null_transmit(struct ifnet *ifp, struct mbuf *m) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return EACCES; /* XXX EIO/EPERM? */ } Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_adhoc.c Fri Sep 19 09:20:55 2014 (r271861) @@ -653,7 +653,7 @@ adhoc_input(struct ieee80211_node *ni, s break; } err: - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); out: if (m != NULL) { if (need_tap && ieee80211_radiotap_active_vap(vap)) Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_hostap.c Fri Sep 19 09:20:55 2014 (r271861) @@ -368,7 +368,7 @@ hostap_deliver_data(struct ieee80211vap /* * Do accounting. */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); IEEE80211_NODE_STAT(ni, rx_data); IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len); if (ETHER_IS_MULTICAST(eh->ether_dhost)) { @@ -384,7 +384,7 @@ hostap_deliver_data(struct ieee80211vap if (m->m_flags & M_MCAST) { mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); else mcopy->m_flags |= M_MCAST; } else { @@ -422,7 +422,7 @@ hostap_deliver_data(struct ieee80211vap if (err) { /* NB: IFQ_HANDOFF reclaims mcopy */ } else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } } } @@ -909,7 +909,7 @@ hostap_input(struct ieee80211_node *ni, break; } err: - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); out: if (m != NULL) { if (need_tap && ieee80211_radiotap_active_vap(vap)) Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_input.c Fri Sep 19 09:20:55 2014 (r271861) @@ -261,7 +261,7 @@ ieee80211_deliver_data(struct ieee80211v /* * Do accounting. */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); IEEE80211_NODE_STAT(ni, rx_data); IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len); if (ETHER_IS_MULTICAST(eh->ether_dhost)) { Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_mesh.c Fri Sep 19 09:20:55 2014 (r271861) @@ -1047,7 +1047,7 @@ mesh_transmit_to_gate(struct ieee80211va ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest); if (ni == NULL) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return; } @@ -1183,7 +1183,7 @@ mesh_forward(struct ieee80211vap *vap, s IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, "%s", "frame not fwd'd, cannot dup"); vap->iv_stats.is_mesh_fwd_nobuf++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return; } mcopy = m_pullup(mcopy, ieee80211_hdrspace(ic, wh) + @@ -1192,7 +1192,7 @@ mesh_forward(struct ieee80211vap *vap, s IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, "%s", "frame not fwd'd, too short"); vap->iv_stats.is_mesh_fwd_tooshort++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(mcopy); return; } @@ -1250,7 +1250,7 @@ mesh_forward(struct ieee80211vap *vap, s /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); } else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } } @@ -1844,7 +1844,7 @@ mesh_input(struct ieee80211_node *ni, st break; } err: - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); out: if (m != NULL) { if (need_tap && ieee80211_radiotap_active_vap(vap)) @@ -3333,8 +3333,9 @@ mesh_airtime_calc(struct ieee80211_node ifp->if_mtu + IEEE80211_MESH_MAXOVERHEAD, rate, 0) << M_BITS; /* Error rate in percentage */ /* XXX assuming small failures are ok */ - errrate = (((ifp->if_oerrors + - ifp->if_ierrors) / 100) << M_BITS) / 100; + errrate = (((ifp->if_get_counter(ifp, IFCOUNTER_OERRORS) + + ifp->if_get_counter(ifp, IFCOUNTER_IERRORS)) / 100) << M_BITS) + / 100; res = (overhead + (nbits / rate)) * ((1 << S_FACTOR) / ((1 << M_BITS) - errrate)); Modified: head/sys/net80211/ieee80211_monitor.c ============================================================================== --- head/sys/net80211/ieee80211_monitor.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_monitor.c Fri Sep 19 09:20:55 2014 (r271861) @@ -130,7 +130,7 @@ monitor_input(struct ieee80211_node *ni, struct ieee80211vap *vap = ni->ni_vap; struct ifnet *ifp = vap->iv_ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if (ieee80211_radiotap_active_vap(vap)) ieee80211_radiotap_rx(vap, m); Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_output.c Fri Sep 19 09:20:55 2014 (r271861) @@ -157,7 +157,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 ni->ni_macaddr, NULL, "%s", "classification failure"); vap->iv_stats.is_tx_classify++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); ieee80211_free_node(ni); @@ -251,7 +251,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); } else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } ic->ic_lastdata = ticks; @@ -299,7 +299,7 @@ ieee80211_start_pkt(struct ieee80211vap IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "discard frame, %s\n", "m_pullup failed"); vap->iv_stats.is_tx_nobuf++; /* XXX */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } eh = mtod(m, struct ether_header *); @@ -332,7 +332,7 @@ ieee80211_start_pkt(struct ieee80211vap ni = ieee80211_find_txnode(vap, eh->ether_dhost); if (ni == NULL) { /* NB: ieee80211_find_txnode does stat+msg */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); /* XXX better status? */ return (ENOBUFS); @@ -344,7 +344,7 @@ ieee80211_start_pkt(struct ieee80211vap "sta not associated (type 0x%04x)", htons(eh->ether_type)); vap->iv_stats.is_tx_notassoc++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); ieee80211_free_node(ni); /* XXX better status? */ @@ -363,7 +363,7 @@ ieee80211_start_pkt(struct ieee80211vap eh->ether_dhost, NULL, "%s", "proxy not enabled"); vap->iv_stats.is_mesh_notproxy++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); /* XXX better status? */ return (ENOBUFS); @@ -380,7 +380,7 @@ ieee80211_start_pkt(struct ieee80211vap * NB: ieee80211_mesh_discover holds/disposes * frame (e.g. queueing on path discovery). */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* XXX better status? */ return (ENOBUFS); } @@ -608,7 +608,7 @@ ieee80211_output(struct ifnet *ifp, stru if (ieee80211_classify(ni, m)) senderr(EIO); /* XXX */ - ifp->if_opackets++; + 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); @@ -636,7 +636,7 @@ bad: m_freem(m); if (ni != NULL) ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return error; #undef senderr } Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_sta.c Fri Sep 19 09:20:55 2014 (r271861) @@ -938,7 +938,7 @@ sta_input(struct ieee80211_node *ni, str break; } err: - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); out: if (m != NULL) { if (need_tap && ieee80211_radiotap_active_vap(vap)) Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_superg.c Fri Sep 19 09:20:55 2014 (r271861) @@ -480,7 +480,7 @@ ff_transmit(struct ieee80211_node *ni, s /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); } else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } } else ieee80211_free_node(ni); Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Fri Sep 19 09:20:34 2014 (r271860) +++ head/sys/net80211/ieee80211_wds.c Fri Sep 19 09:20:55 2014 (r271861) @@ -258,14 +258,14 @@ ieee80211_dwds_mcast(struct ieee80211vap */ mcopy = m_copypacket(m, M_NOWAIT); if (mcopy == NULL) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* XXX stat + msg */ continue; } ni = ieee80211_find_txnode(vap, eh->ether_dhost); if (ni == NULL) { /* NB: ieee80211_find_txnode does stat+msg */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(mcopy); continue; } @@ -276,7 +276,7 @@ ieee80211_dwds_mcast(struct ieee80211vap eh->ether_dhost, NULL, "%s", "classification failure"); vap->iv_stats.is_tx_classify++; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(mcopy); ieee80211_free_node(ni); continue; @@ -299,10 +299,10 @@ ieee80211_dwds_mcast(struct ieee80211vap err = ieee80211_parent_xmitpkt(ic, mcopy); if (err) { /* NB: IFQ_HANDOFF reclaims mbuf */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_free_node(ni); } else - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } } @@ -730,7 +730,7 @@ wds_input(struct ieee80211_node *ni, str break; } err: - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); out: if (m != NULL) { if (need_tap && ieee80211_radiotap_active_vap(vap)) From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 10:18:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48A7A3E2; Fri, 19 Sep 2014 10:18:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A10EC93; Fri, 19 Sep 2014 10:18:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JAIEpU033643; Fri, 19 Sep 2014 10:18:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JAIEFY033637; Fri, 19 Sep 2014 10:18:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409191018.s8JAIEFY033637@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 10:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271862 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 10:18:15 -0000 Author: glebius Date: Fri Sep 19 10:18:14 2014 New Revision: 271862 URL: http://svnweb.freebsd.org/changeset/base/271862 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Fri Sep 19 09:20:55 2014 (r271861) +++ head/sys/netipsec/ipsec_input.c Fri Sep 19 10:18:14 2014 (r271862) @@ -376,8 +376,8 @@ ipsec4_common_input_cb(struct mbuf *m, s prot = ip->ip_p; #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; + if_inc_counter(encif, IFCOUNTER_IPACKETS, 1); + if_inc_counter(encif, IFCOUNTER_IBYTES, m->m_pkthdr.len); /* * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP @@ -663,8 +663,8 @@ ipsec6_common_input_cb(struct mbuf *m, s m_copydata(m, protoff, 1, (unsigned char *) &prot); #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; + if_inc_counter(encif, IFCOUNTER_IPACKETS, 1); + if_inc_counter(encif, IFCOUNTER_IBYTES, m->m_pkthdr.len); /* * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Fri Sep 19 09:20:55 2014 (r271861) +++ head/sys/netipsec/ipsec_output.c Fri Sep 19 10:18:14 2014 (r271862) @@ -441,8 +441,8 @@ ipsec4_process_packet( sav = isr->sav; #ifdef DEV_ENC - encif->if_opackets++; - encif->if_obytes += m->m_pkthdr.len; + if_inc_counter(encif, IFCOUNTER_OPACKETS, 1); + if_inc_counter(encif, IFCOUNTER_OBYTES, m->m_pkthdr.len); /* pass the mbuf to enc0 for bpf processing */ ipsec_bpf(m, sav, AF_INET, ENC_OUT|ENC_BEFORE); @@ -641,8 +641,8 @@ ipsec6_process_packet( dst = &sav->sah->saidx.dst; #ifdef DEV_ENC - encif->if_opackets++; - encif->if_obytes += m->m_pkthdr.len; + if_inc_counter(encif, IFCOUNTER_OPACKETS, 1); + if_inc_counter(encif, IFCOUNTER_OBYTES, m->m_pkthdr.len); /* pass the mbuf to enc0 for bpf processing */ ipsec_bpf(m, isr->sav, AF_INET6, ENC_OUT|ENC_BEFORE); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 10:19:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D129A7A3; Fri, 19 Sep 2014 10:19:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC92DCBE; Fri, 19 Sep 2014 10:19:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JAJpcs033867; Fri, 19 Sep 2014 10:19:51 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JAJpnn033866; Fri, 19 Sep 2014 10:19:51 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409191019.s8JAJpnn033866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 10:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271863 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 10:19:51 -0000 Author: glebius Date: Fri Sep 19 10:19:51 2014 New Revision: 271863 URL: http://svnweb.freebsd.org/changeset/base/271863 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/netinet/ip_gre.c Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Fri Sep 19 10:18:14 2014 (r271862) +++ head/sys/netinet/ip_gre.c Fri Sep 19 10:19:51 2014 (r271863) @@ -142,8 +142,8 @@ gre_input2(struct mbuf *m ,int hlen, u_c } gip = mtod(m, struct greip *); - GRE2IFP(sc)->if_ipackets++; - GRE2IFP(sc)->if_ibytes += m->m_pkthdr.len; + if_inc_counter(GRE2IFP(sc), IFCOUNTER_IPACKETS, 1); + if_inc_counter(GRE2IFP(sc), IFCOUNTER_IBYTES, m->m_pkthdr.len); switch (proto) { case IPPROTO_GRE: @@ -243,8 +243,8 @@ gre_mobile_input(struct mbuf **mp, int * ip = mtod(m, struct ip *); mip = mtod(m, struct mobip_h *); - GRE2IFP(sc)->if_ipackets++; - GRE2IFP(sc)->if_ibytes += m->m_pkthdr.len; + if_inc_counter(GRE2IFP(sc), IFCOUNTER_IPACKETS, 1); + if_inc_counter(GRE2IFP(sc), IFCOUNTER_IBYTES, m->m_pkthdr.len); if (ntohs(mip->mh.proto) & MOB_H_SBIT) { msiz = MOB_H_SIZ_L; From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 10:32:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C522A1D; Fri, 19 Sep 2014 10:32:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 157F3E4D; Fri, 19 Sep 2014 10:32:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JAWMgU042115; Fri, 19 Sep 2014 10:32:22 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JAWKJA042104; Fri, 19 Sep 2014 10:32:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409191032.s8JAWKJA042104@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 10:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271864 - in head/sys: conf dev/mii dev/re dev/rl modules/rl pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 10:32:22 -0000 Author: glebius Date: Fri Sep 19 10:32:20 2014 New Revision: 271864 URL: http://svnweb.freebsd.org/changeset/base/271864 Log: Move rl(4) to dev/rl. Added: head/sys/dev/rl/ head/sys/dev/rl/if_rl.c - copied, changed from r271861, head/sys/pci/if_rl.c head/sys/dev/rl/if_rlreg.h - copied unchanged from r271861, head/sys/pci/if_rlreg.h Deleted: head/sys/pci/if_rl.c head/sys/pci/if_rlreg.h Modified: head/sys/conf/files head/sys/dev/mii/rgephy.c head/sys/dev/mii/rlphy.c head/sys/dev/mii/rlswitch.c head/sys/dev/re/if_re.c head/sys/modules/rl/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Sep 19 10:19:51 2014 (r271863) +++ head/sys/conf/files Fri Sep 19 10:32:20 2014 (r271864) @@ -2151,6 +2151,7 @@ dev/random/hash.c optional random dev/random/rwfile.c optional random dev/rc/rc.c optional rc dev/re/if_re.c optional re +dev/rl/if_rl.c optional rl pci dev/rndtest/rndtest.c optional rndtest dev/rp/rp.c optional rp dev/rp/rp_isa.c optional rp isa @@ -3865,7 +3866,6 @@ opencrypto/xform.c optional crypto pci/alpm.c optional alpm pci pci/amdpm.c optional amdpm pci | nfpm pci pci/amdsmb.c optional amdsmb pci -pci/if_rl.c optional rl pci pci/intpm.c optional intpm pci pci/ncr.c optional ncr pci \ compile-with "${NORMAL_C} -Wno-unused" Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Fri Sep 19 10:19:51 2014 (r271863) +++ head/sys/dev/mii/rgephy.c Fri Sep 19 10:32:20 2014 (r271864) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" #include -#include +#include static int rgephy_probe(device_t); static int rgephy_attach(device_t); Modified: head/sys/dev/mii/rlphy.c ============================================================================== --- head/sys/dev/mii/rlphy.c Fri Sep 19 10:19:51 2014 (r271863) +++ head/sys/dev/mii/rlphy.c Fri Sep 19 10:32:20 2014 (r271864) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include -#include +#include #include "miibus_if.h" Modified: head/sys/dev/mii/rlswitch.c ============================================================================== --- head/sys/dev/mii/rlswitch.c Fri Sep 19 10:19:51 2014 (r271863) +++ head/sys/dev/mii/rlswitch.c Fri Sep 19 10:32:20 2014 (r271864) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include -#include +#include #include "miibus_if.h" Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Fri Sep 19 10:19:51 2014 (r271863) +++ head/sys/dev/re/if_re.c Fri Sep 19 10:32:20 2014 (r271864) @@ -148,7 +148,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include MODULE_DEPEND(re, pci, 1, 1, 1); MODULE_DEPEND(re, ether, 1, 1, 1); Copied and modified: head/sys/dev/rl/if_rl.c (from r271861, head/sys/pci/if_rl.c) ============================================================================== --- head/sys/pci/if_rl.c Fri Sep 19 09:20:55 2014 (r271861, copy source) +++ head/sys/dev/rl/if_rl.c Fri Sep 19 10:32:20 2014 (r271864) @@ -127,7 +127,7 @@ MODULE_DEPEND(rl, miibus, 1, 1, 1); /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" -#include +#include /* * Various supported device vendors/types and their names. Copied: head/sys/dev/rl/if_rlreg.h (from r271861, head/sys/pci/if_rlreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rl/if_rlreg.h Fri Sep 19 10:32:20 2014 (r271864, copy of r271861, head/sys/pci/if_rlreg.h) @@ -0,0 +1,1160 @@ +/*- + * Copyright (c) 1997, 1998-2003 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD + * 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$ + */ + +/* + * RealTek 8129/8139 register offsets + */ +#define RL_IDR0 0x0000 /* ID register 0 (station addr) */ +#define RL_IDR1 0x0001 /* Must use 32-bit accesses (?) */ +#define RL_IDR2 0x0002 +#define RL_IDR3 0x0003 +#define RL_IDR4 0x0004 +#define RL_IDR5 0x0005 + /* 0006-0007 reserved */ +#define RL_MAR0 0x0008 /* Multicast hash table */ +#define RL_MAR1 0x0009 +#define RL_MAR2 0x000A +#define RL_MAR3 0x000B +#define RL_MAR4 0x000C +#define RL_MAR5 0x000D +#define RL_MAR6 0x000E +#define RL_MAR7 0x000F + +#define RL_TXSTAT0 0x0010 /* status of TX descriptor 0 */ +#define RL_TXSTAT1 0x0014 /* status of TX descriptor 1 */ +#define RL_TXSTAT2 0x0018 /* status of TX descriptor 2 */ +#define RL_TXSTAT3 0x001C /* status of TX descriptor 3 */ + +#define RL_TXADDR0 0x0020 /* address of TX descriptor 0 */ +#define RL_TXADDR1 0x0024 /* address of TX descriptor 1 */ +#define RL_TXADDR2 0x0028 /* address of TX descriptor 2 */ +#define RL_TXADDR3 0x002C /* address of TX descriptor 3 */ + +#define RL_RXADDR 0x0030 /* RX ring start address */ +#define RL_RX_EARLY_BYTES 0x0034 /* RX early byte count */ +#define RL_RX_EARLY_STAT 0x0036 /* RX early status */ +#define RL_COMMAND 0x0037 /* command register */ +#define RL_CURRXADDR 0x0038 /* current address of packet read */ +#define RL_CURRXBUF 0x003A /* current RX buffer address */ +#define RL_IMR 0x003C /* interrupt mask register */ +#define RL_ISR 0x003E /* interrupt status register */ +#define RL_TXCFG 0x0040 /* transmit config */ +#define RL_RXCFG 0x0044 /* receive config */ +#define RL_TIMERCNT 0x0048 /* timer count register */ +#define RL_MISSEDPKT 0x004C /* missed packet counter */ +#define RL_EECMD 0x0050 /* EEPROM command register */ + +/* RTL8139/RTL8139C+ only */ +#define RL_8139_CFG0 0x0051 /* config register #0 */ +#define RL_8139_CFG1 0x0052 /* config register #1 */ +#define RL_8139_CFG3 0x0059 /* config register #3 */ +#define RL_8139_CFG4 0x005A /* config register #4 */ +#define RL_8139_CFG5 0x00D8 /* config register #5 */ + +#define RL_CFG0 0x0051 /* config register #0 */ +#define RL_CFG1 0x0052 /* config register #1 */ +#define RL_CFG2 0x0053 /* config register #2 */ +#define RL_CFG3 0x0054 /* config register #3 */ +#define RL_CFG4 0x0055 /* config register #4 */ +#define RL_CFG5 0x0056 /* config register #5 */ + /* 0057 reserved */ +#define RL_MEDIASTAT 0x0058 /* media status register (8139) */ + /* 0059-005A reserved */ +#define RL_MII 0x005A /* 8129 chip only */ +#define RL_HALTCLK 0x005B +#define RL_MULTIINTR 0x005C /* multiple interrupt */ +#define RL_PCIREV 0x005E /* PCI revision value */ + /* 005F reserved */ +#define RL_TXSTAT_ALL 0x0060 /* TX status of all descriptors */ + +/* Direct PHY access registers only available on 8139 */ +#define RL_BMCR 0x0062 /* PHY basic mode control */ +#define RL_BMSR 0x0064 /* PHY basic mode status */ +#define RL_ANAR 0x0066 /* PHY autoneg advert */ +#define RL_LPAR 0x0068 /* PHY link partner ability */ +#define RL_ANER 0x006A /* PHY autoneg expansion */ + +#define RL_DISCCNT 0x006C /* disconnect counter */ +#define RL_FALSECAR 0x006E /* false carrier counter */ +#define RL_NWAYTST 0x0070 /* NWAY test register */ +#define RL_RX_ER 0x0072 /* RX_ER counter */ +#define RL_CSCFG 0x0074 /* CS configuration register */ + +/* + * When operating in special C+ mode, some of the registers in an + * 8139C+ chip have different definitions. These are also used for + * the 8169 gigE chip. + */ +#define RL_DUMPSTATS_LO 0x0010 /* counter dump command register */ +#define RL_DUMPSTATS_HI 0x0014 /* counter dump command register */ +#define RL_TXLIST_ADDR_LO 0x0020 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HI 0x0024 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HPRIO_LO 0x0028 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HPRIO_HI 0x002C /* 64 bits, 256 byte alignment */ +#define RL_CFG2 0x0053 +#define RL_TIMERINT 0x0054 /* interrupt on timer expire */ +#define RL_TXSTART 0x00D9 /* 8 bits */ +#define RL_CPLUS_CMD 0x00E0 /* 16 bits */ +#define RL_RXLIST_ADDR_LO 0x00E4 /* 64 bits, 256 byte alignment */ +#define RL_RXLIST_ADDR_HI 0x00E8 /* 64 bits, 256 byte alignment */ +#define RL_EARLY_TX_THRESH 0x00EC /* 8 bits */ + +/* + * Registers specific to the 8169 gigE chip + */ +#define RL_GTXSTART 0x0038 /* 8 bits */ +#define RL_TIMERINT_8169 0x0058 /* different offset than 8139 */ +#define RL_PHYAR 0x0060 +#define RL_TBICSR 0x0064 +#define RL_TBI_ANAR 0x0068 +#define RL_TBI_LPAR 0x006A +#define RL_GMEDIASTAT 0x006C /* 8 bits */ +#define RL_MACDBG 0x006D /* 8 bits, 8168C SPIN2 only */ +#define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ +#define RL_PMCH 0x006F /* 8 bits */ +#define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ +#define RL_INTRMOD 0x00E2 /* 16 bits */ +#define RL_MISC 0x00F0 + +/* + * TX config register bits + */ +#define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */ +#define RL_TXCFG_MAXDMA 0x00000700 /* max DMA burst size */ +#define RL_TXCFG_QUEUE_EMPTY 0x00000800 /* 8168E-VL or higher */ +#define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */ +#define RL_TXCFG_LOOPBKTST 0x00060000 /* loopback test */ +#define RL_TXCFG_IFG2 0x00080000 /* 8169 only */ +#define RL_TXCFG_IFG 0x03000000 /* interframe gap */ +#define RL_TXCFG_HWREV 0x7CC00000 + +#define RL_LOOPTEST_OFF 0x00000000 +#define RL_LOOPTEST_ON 0x00020000 +#define RL_LOOPTEST_ON_CPLUS 0x00060000 + +/* Known revision codes. */ +#define RL_HWREV_8169 0x00000000 +#define RL_HWREV_8169S 0x00800000 +#define RL_HWREV_8110S 0x04000000 +#define RL_HWREV_8169_8110SB 0x10000000 +#define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8401E 0x24000000 +#define RL_HWREV_8102EL 0x24800000 +#define RL_HWREV_8102EL_SPIN1 0x24C00000 +#define RL_HWREV_8168D 0x28000000 +#define RL_HWREV_8168DP 0x28800000 +#define RL_HWREV_8168E 0x2C000000 +#define RL_HWREV_8168E_VL 0x2C800000 +#define RL_HWREV_8168B_SPIN1 0x30000000 +#define RL_HWREV_8100E 0x30800000 +#define RL_HWREV_8101E 0x34000000 +#define RL_HWREV_8102E 0x34800000 +#define RL_HWREV_8103E 0x34C00000 +#define RL_HWREV_8168B_SPIN2 0x38000000 +#define RL_HWREV_8168B_SPIN3 0x38400000 +#define RL_HWREV_8168C 0x3C000000 +#define RL_HWREV_8168C_SPIN2 0x3C400000 +#define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8105E 0x40800000 +#define RL_HWREV_8105E_SPIN1 0x40C00000 +#define RL_HWREV_8402 0x44000000 +#define RL_HWREV_8106E 0x44800000 +#define RL_HWREV_8168F 0x48000000 +#define RL_HWREV_8411 0x48800000 +#define RL_HWREV_8168G 0x4C000000 +#define RL_HWREV_8168EP 0x50000000 +#define RL_HWREV_8168GU 0x50800000 +#define RL_HWREV_8411B 0x5C800000 +#define RL_HWREV_8139 0x60000000 +#define RL_HWREV_8139A 0x70000000 +#define RL_HWREV_8139AG 0x70800000 +#define RL_HWREV_8139B 0x78000000 +#define RL_HWREV_8130 0x7C000000 +#define RL_HWREV_8139C 0x74000000 +#define RL_HWREV_8139D 0x74400000 +#define RL_HWREV_8139CPLUS 0x74800000 +#define RL_HWREV_8101 0x74C00000 +#define RL_HWREV_8100 0x78800000 +#define RL_HWREV_8169_8110SBL 0x7CC00000 +#define RL_HWREV_8169_8110SCE 0x98000000 + +#define RL_TXDMA_16BYTES 0x00000000 +#define RL_TXDMA_32BYTES 0x00000100 +#define RL_TXDMA_64BYTES 0x00000200 +#define RL_TXDMA_128BYTES 0x00000300 +#define RL_TXDMA_256BYTES 0x00000400 +#define RL_TXDMA_512BYTES 0x00000500 +#define RL_TXDMA_1024BYTES 0x00000600 +#define RL_TXDMA_2048BYTES 0x00000700 + +/* + * Transmit descriptor status register bits. + */ +#define RL_TXSTAT_LENMASK 0x00001FFF +#define RL_TXSTAT_OWN 0x00002000 +#define RL_TXSTAT_TX_UNDERRUN 0x00004000 +#define RL_TXSTAT_TX_OK 0x00008000 +#define RL_TXSTAT_EARLY_THRESH 0x003F0000 +#define RL_TXSTAT_COLLCNT 0x0F000000 +#define RL_TXSTAT_CARR_HBEAT 0x10000000 +#define RL_TXSTAT_OUTOFWIN 0x20000000 +#define RL_TXSTAT_TXABRT 0x40000000 +#define RL_TXSTAT_CARRLOSS 0x80000000 + +/* + * Interrupt status register bits. + */ +#define RL_ISR_RX_OK 0x0001 +#define RL_ISR_RX_ERR 0x0002 +#define RL_ISR_TX_OK 0x0004 +#define RL_ISR_TX_ERR 0x0008 +#define RL_ISR_RX_OVERRUN 0x0010 +#define RL_ISR_PKT_UNDERRUN 0x0020 +#define RL_ISR_LINKCHG 0x0020 /* 8169 only */ +#define RL_ISR_FIFO_OFLOW 0x0040 /* 8139 only */ +#define RL_ISR_TX_DESC_UNAVAIL 0x0080 /* C+ only */ +#define RL_ISR_SWI 0x0100 /* C+ only */ +#define RL_ISR_CABLE_LEN_CHGD 0x2000 +#define RL_ISR_PCS_TIMEOUT 0x4000 /* 8129 only */ +#define RL_ISR_TIMEOUT_EXPIRED 0x4000 +#define RL_ISR_SYSTEM_ERR 0x8000 + +#define RL_INTRS \ + (RL_ISR_TX_OK|RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \ + RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ + RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR) + +#ifdef RE_TX_MODERATION +#define RL_INTRS_CPLUS \ + (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \ + RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ + RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED) +#else +#define RL_INTRS_CPLUS \ + (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR|RL_ISR_TX_OK| \ + RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ + RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED) +#endif + +/* + * Media status register. (8139 only) + */ +#define RL_MEDIASTAT_RXPAUSE 0x01 +#define RL_MEDIASTAT_TXPAUSE 0x02 +#define RL_MEDIASTAT_LINK 0x04 +#define RL_MEDIASTAT_SPEED10 0x08 +#define RL_MEDIASTAT_RXFLOWCTL 0x40 /* duplex mode */ +#define RL_MEDIASTAT_TXFLOWCTL 0x80 /* duplex mode */ + +/* + * Receive config register. + */ +#define RL_RXCFG_RX_ALLPHYS 0x00000001 /* accept all nodes */ +#define RL_RXCFG_RX_INDIV 0x00000002 /* match filter */ +#define RL_RXCFG_RX_MULTI 0x00000004 /* accept all multicast */ +#define RL_RXCFG_RX_BROAD 0x00000008 /* accept all broadcast */ +#define RL_RXCFG_RX_RUNT 0x00000010 +#define RL_RXCFG_RX_ERRPKT 0x00000020 +#define RL_RXCFG_WRAP 0x00000080 +#define RL_RXCFG_EARLYOFFV2 0x00000800 +#define RL_RXCFG_MAXDMA 0x00000700 +#define RL_RXCFG_BUFSZ 0x00001800 +#define RL_RXCFG_EARLYOFF 0x00003800 +#define RL_RXCFG_FIFOTHRESH 0x0000E000 +#define RL_RXCFG_EARLYTHRESH 0x07000000 + +#define RL_RXDMA_16BYTES 0x00000000 +#define RL_RXDMA_32BYTES 0x00000100 +#define RL_RXDMA_64BYTES 0x00000200 +#define RL_RXDMA_128BYTES 0x00000300 +#define RL_RXDMA_256BYTES 0x00000400 +#define RL_RXDMA_512BYTES 0x00000500 +#define RL_RXDMA_1024BYTES 0x00000600 +#define RL_RXDMA_UNLIMITED 0x00000700 + +#define RL_RXBUF_8 0x00000000 +#define RL_RXBUF_16 0x00000800 +#define RL_RXBUF_32 0x00001000 +#define RL_RXBUF_64 0x00001800 + +#define RL_RXFIFO_16BYTES 0x00000000 +#define RL_RXFIFO_32BYTES 0x00002000 +#define RL_RXFIFO_64BYTES 0x00004000 +#define RL_RXFIFO_128BYTES 0x00006000 +#define RL_RXFIFO_256BYTES 0x00008000 +#define RL_RXFIFO_512BYTES 0x0000A000 +#define RL_RXFIFO_1024BYTES 0x0000C000 +#define RL_RXFIFO_NOTHRESH 0x0000E000 + +/* + * Bits in RX status header (included with RX'ed packet + * in ring buffer). + */ +#define RL_RXSTAT_RXOK 0x00000001 +#define RL_RXSTAT_ALIGNERR 0x00000002 +#define RL_RXSTAT_CRCERR 0x00000004 +#define RL_RXSTAT_GIANT 0x00000008 +#define RL_RXSTAT_RUNT 0x00000010 +#define RL_RXSTAT_BADSYM 0x00000020 +#define RL_RXSTAT_BROAD 0x00002000 +#define RL_RXSTAT_INDIV 0x00004000 +#define RL_RXSTAT_MULTI 0x00008000 +#define RL_RXSTAT_LENMASK 0xFFFF0000 +#define RL_RXSTAT_UNFINISHED 0x0000FFF0 /* DMA still in progress */ + +/* + * Command register. + */ +#define RL_CMD_EMPTY_RXBUF 0x0001 +#define RL_CMD_TX_ENB 0x0004 +#define RL_CMD_RX_ENB 0x0008 +#define RL_CMD_RESET 0x0010 +#define RL_CMD_STOPREQ 0x0080 + +/* + * Twister register values. These are completely undocumented and derived + * from public sources. + */ +#define RL_CSCFG_LINK_OK 0x0400 +#define RL_CSCFG_CHANGE 0x0800 +#define RL_CSCFG_STATUS 0xf000 +#define RL_CSCFG_ROW3 0x7000 +#define RL_CSCFG_ROW2 0x3000 +#define RL_CSCFG_ROW1 0x1000 +#define RL_CSCFG_LINK_DOWN_OFF_CMD 0x03c0 +#define RL_CSCFG_LINK_DOWN_CMD 0xf3c0 + +#define RL_NWAYTST_RESET 0 +#define RL_NWAYTST_CBL_TEST 0x20 + +#define RL_PARA78 0x78 +#define RL_PARA78_DEF 0x78fa8388 +#define RL_PARA7C 0x7C +#define RL_PARA7C_DEF 0xcb38de43 +#define RL_PARA7C_RETUNE 0xfb38de03 + +/* + * EEPROM control register + */ +#define RL_EE_DATAOUT 0x01 /* Data out */ +#define RL_EE_DATAIN 0x02 /* Data in */ +#define RL_EE_CLK 0x04 /* clock */ +#define RL_EE_SEL 0x08 /* chip select */ +#define RL_EE_MODE (0x40|0x80) + +#define RL_EEMODE_OFF 0x00 +#define RL_EEMODE_AUTOLOAD 0x40 +#define RL_EEMODE_PROGRAM 0x80 +#define RL_EEMODE_WRITECFG (0x80|0x40) + +/* 9346 EEPROM commands */ +#define RL_9346_ADDR_LEN 6 /* 93C46 1K: 128x16 */ +#define RL_9356_ADDR_LEN 8 /* 93C56 2K: 256x16 */ + +#define RL_9346_WRITE 0x5 +#define RL_9346_READ 0x6 +#define RL_9346_ERASE 0x7 +#define RL_9346_EWEN 0x4 +#define RL_9346_EWEN_ADDR 0x30 +#define RL_9456_EWDS 0x4 +#define RL_9346_EWDS_ADDR 0x00 + +#define RL_EECMD_WRITE 0x140 +#define RL_EECMD_READ_6BIT 0x180 +#define RL_EECMD_READ_8BIT 0x600 +#define RL_EECMD_ERASE 0x1c0 + +#define RL_EE_ID 0x00 +#define RL_EE_PCI_VID 0x01 +#define RL_EE_PCI_DID 0x02 +/* Location of station address inside EEPROM */ +#define RL_EE_EADDR 0x07 + +/* + * MII register (8129 only) + */ +#define RL_MII_CLK 0x01 +#define RL_MII_DATAIN 0x02 +#define RL_MII_DATAOUT 0x04 +#define RL_MII_DIR 0x80 /* 0 == input, 1 == output */ + +/* + * Config 0 register + */ +#define RL_CFG0_ROM0 0x01 +#define RL_CFG0_ROM1 0x02 +#define RL_CFG0_ROM2 0x04 +#define RL_CFG0_PL0 0x08 +#define RL_CFG0_PL1 0x10 +#define RL_CFG0_10MBPS 0x20 /* 10 Mbps internal mode */ +#define RL_CFG0_PCS 0x40 +#define RL_CFG0_SCR 0x80 + +/* + * Config 1 register + */ +#define RL_CFG1_PWRDWN 0x01 +#define RL_CFG1_PME 0x01 +#define RL_CFG1_SLEEP 0x02 +#define RL_CFG1_VPDEN 0x02 +#define RL_CFG1_IOMAP 0x04 +#define RL_CFG1_MEMMAP 0x08 +#define RL_CFG1_RSVD 0x10 +#define RL_CFG1_LWACT 0x10 +#define RL_CFG1_DRVLOAD 0x20 +#define RL_CFG1_LED0 0x40 +#define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */ +#define RL_CFG1_LED1 0x80 + +/* + * Config 2 register + */ +#define RL_CFG2_PCI33MHZ 0x00 +#define RL_CFG2_PCI66MHZ 0x01 +#define RL_CFG2_PCI64BIT 0x08 +#define RL_CFG2_AUXPWR 0x10 +#define RL_CFG2_MSI 0x20 + +/* + * Config 3 register + */ +#define RL_CFG3_GRANTSEL 0x80 +#define RL_CFG3_WOL_MAGIC 0x20 +#define RL_CFG3_WOL_LINK 0x10 +#define RL_CFG3_JUMBO_EN0 0x04 /* RTL8168C or later. */ +#define RL_CFG3_FAST_B2B 0x01 + +/* + * Config 4 register + */ +#define RL_CFG4_LWPTN 0x04 +#define RL_CFG4_LWPME 0x10 +#define RL_CFG4_JUMBO_EN1 0x02 /* RTL8168C or later. */ + +/* + * Config 5 register + */ +#define RL_CFG5_WOL_BCAST 0x40 +#define RL_CFG5_WOL_MCAST 0x20 +#define RL_CFG5_WOL_UCAST 0x10 +#define RL_CFG5_WOL_LANWAKE 0x02 +#define RL_CFG5_PME_STS 0x01 + +/* + * 8139C+ register definitions + */ + +/* RL_DUMPSTATS_LO register */ +#define RL_DUMPSTATS_START 0x00000008 + +/* Transmit start register */ +#define RL_TXSTART_SWI 0x01 /* generate TX interrupt */ +#define RL_TXSTART_START 0x40 /* start normal queue transmit */ +#define RL_TXSTART_HPRIO_START 0x80 /* start hi prio queue transmit */ + +/* + * Config 2 register, 8139C+/8169/8169S/8110S only + */ +#define RL_CFG2_BUSFREQ 0x07 +#define RL_CFG2_BUSWIDTH 0x08 +#define RL_CFG2_AUXPWRSTS 0x10 + +#define RL_BUSFREQ_33MHZ 0x00 +#define RL_BUSFREQ_66MHZ 0x01 + +#define RL_BUSWIDTH_32BITS 0x00 +#define RL_BUSWIDTH_64BITS 0x08 + +/* C+ mode command register */ +#define RL_CPLUSCMD_TXENB 0x0001 /* enable C+ transmit mode */ +#define RL_CPLUSCMD_RXENB 0x0002 /* enable C+ receive mode */ +#define RL_CPLUSCMD_PCI_MRW 0x0008 /* enable PCI multi-read/write */ +#define RL_CPLUSCMD_PCI_DAC 0x0010 /* PCI dual-address cycle only */ +#define RL_CPLUSCMD_RXCSUM_ENB 0x0020 /* enable RX checksum offload */ +#define RL_CPLUSCMD_VLANSTRIP 0x0040 /* enable VLAN tag stripping */ +#define RL_CPLUSCMD_MACSTAT_DIS 0x0080 /* 8168B/C/CP */ +#define RL_CPLUSCMD_ASF 0x0100 /* 8168C/CP */ +#define RL_CPLUSCMD_DBG_SEL 0x0200 /* 8168C/CP */ +#define RL_CPLUSCMD_FORCE_TXFC 0x0400 /* 8168C/CP */ +#define RL_CPLUSCMD_FORCE_RXFC 0x0800 /* 8168C/CP */ +#define RL_CPLUSCMD_FORCE_HDPX 0x1000 /* 8168C/CP */ +#define RL_CPLUSCMD_NORMAL_MODE 0x2000 /* 8168C/CP */ +#define RL_CPLUSCMD_DBG_ENB 0x4000 /* 8168C/CP */ +#define RL_CPLUSCMD_BIST_ENB 0x8000 /* 8168C/CP */ + +/* C+ early transmit threshold */ +#define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ + +/* Timer interrupt register */ +#define RL_TIMERINT_8169_VAL 0x00001FFF +#define RL_TIMER_MIN 0 +#define RL_TIMER_MAX 65 /* 65.528us */ +#define RL_TIMER_DEFAULT RL_TIMER_MAX +#define RL_TIMER_PCIE_CLK 125 /* 125MHZ */ +#define RL_USECS(x) ((x) * RL_TIMER_PCIE_CLK) + +/* + * Gigabit PHY access register (8169 only) + */ +#define RL_PHYAR_PHYDATA 0x0000FFFF +#define RL_PHYAR_PHYREG 0x001F0000 +#define RL_PHYAR_BUSY 0x80000000 + +/* + * Gigabit media status (8169 only) + */ +#define RL_GMEDIASTAT_FDX 0x01 /* full duplex */ +#define RL_GMEDIASTAT_LINK 0x02 /* link up */ +#define RL_GMEDIASTAT_10MBPS 0x04 /* 10mps link */ +#define RL_GMEDIASTAT_100MBPS 0x08 /* 100mbps link */ +#define RL_GMEDIASTAT_1000MBPS 0x10 /* gigE link */ +#define RL_GMEDIASTAT_RXFLOW 0x20 /* RX flow control on */ +#define RL_GMEDIASTAT_TXFLOW 0x40 /* TX flow control on */ +#define RL_GMEDIASTAT_TBI 0x80 /* TBI enabled */ + +/* + * The RealTek doesn't use a fragment-based descriptor mechanism. + * Instead, there are only four register sets, each or which represents + * one 'descriptor.' Basically, each TX descriptor is just a contiguous + * packet buffer (32-bit aligned!) and we place the buffer addresses in + * the registers so the chip knows where they are. + * + * We can sort of kludge together the same kind of buffer management + * used in previous drivers, but we have to do buffer copies almost all + * the time, so it doesn't really buy us much. + * + * For reception, there's just one large buffer where the chip stores + * all received packets. + */ +#define RL_RX_BUF_SZ RL_RXBUF_64 +#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) +#define RL_TX_LIST_CNT 4 +#define RL_MIN_FRAMELEN 60 +#define RL_TX_8139_BUF_ALIGN 4 +#define RL_RX_8139_BUF_ALIGN 8 +#define RL_RX_8139_BUF_RESERVE sizeof(int64_t) +#define RL_RX_8139_BUF_GUARD_SZ \ + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) +#define RL_TXTHRESH(x) ((x) << 11) +#define RL_TX_THRESH_INIT 96 +#define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH +#define RL_RX_MAXDMA RL_RXDMA_UNLIMITED +#define RL_TX_MAXDMA RL_TXDMA_2048BYTES + +#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_MAXDMA|RL_RX_BUF_SZ) +#define RL_TXCFG_CONFIG (RL_TXCFG_IFG|RL_TX_MAXDMA) + +#define RL_ETHER_ALIGN 2 + +/* + * re(4) hardware ip4csum-tx could be mangled with 28 bytes or less IP packets. + */ +#define RL_IP4CSUMTX_MINLEN 28 +#define RL_IP4CSUMTX_PADLEN (ETHER_HDR_LEN + RL_IP4CSUMTX_MINLEN) + +struct rl_chain_data { + uint16_t cur_rx; + uint8_t *rl_rx_buf; + uint8_t *rl_rx_buf_ptr; + + struct mbuf *rl_tx_chain[RL_TX_LIST_CNT]; + bus_dmamap_t rl_tx_dmamap[RL_TX_LIST_CNT]; + bus_dma_tag_t rl_tx_tag; + bus_dma_tag_t rl_rx_tag; + bus_dmamap_t rl_rx_dmamap; + bus_addr_t rl_rx_buf_paddr; + uint8_t last_tx; + uint8_t cur_tx; +}; + +#define RL_INC(x) (x = (x + 1) % RL_TX_LIST_CNT) +#define RL_CUR_TXADDR(x) ((x->rl_cdata.cur_tx * 4) + RL_TXADDR0) +#define RL_CUR_TXSTAT(x) ((x->rl_cdata.cur_tx * 4) + RL_TXSTAT0) +#define RL_CUR_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.cur_tx]) +#define RL_CUR_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.cur_tx]) +#define RL_LAST_TXADDR(x) ((x->rl_cdata.last_tx * 4) + RL_TXADDR0) +#define RL_LAST_TXSTAT(x) ((x->rl_cdata.last_tx * 4) + RL_TXSTAT0) +#define RL_LAST_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.last_tx]) +#define RL_LAST_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.last_tx]) + +struct rl_type { + uint16_t rl_vid; + uint16_t rl_did; + int rl_basetype; + const char *rl_name; +}; + +struct rl_hwrev { + uint32_t rl_rev; + int rl_type; + const char *rl_desc; + int rl_max_mtu; +}; + +#define RL_8129 1 +#define RL_8139 2 +#define RL_8139CPLUS 3 +#define RL_8169 4 + +#define RL_ISCPLUS(x) ((x)->rl_type == RL_8139CPLUS || \ + (x)->rl_type == RL_8169) + +/* + * The 8139C+ and 8160 gigE chips support descriptor-based TX + * and RX. In fact, they even support TCP large send. Descriptors + * must be allocated in contiguous blocks that are aligned on a + * 256-byte boundary. The rings can hold a maximum of 64 descriptors. + */ + +/* + * RX/TX descriptor definition. When large send mode is enabled, the + * lower 11 bits of the TX rl_cmdstat word are used to hold the MSS, and + * the checksum offload bits are disabled. The structure layout is + * the same for RX and TX descriptors + */ +struct rl_desc { + uint32_t rl_cmdstat; + uint32_t rl_vlanctl; + uint32_t rl_bufaddr_lo; + uint32_t rl_bufaddr_hi; +}; + +#define RL_TDESC_CMD_FRAGLEN 0x0000FFFF +#define RL_TDESC_CMD_TCPCSUM 0x00010000 /* TCP checksum enable */ +#define RL_TDESC_CMD_UDPCSUM 0x00020000 /* UDP checksum enable */ +#define RL_TDESC_CMD_IPCSUM 0x00040000 /* IP header checksum enable */ +#define RL_TDESC_CMD_MSSVAL 0x07FF0000 /* Large send MSS value */ +#define RL_TDESC_CMD_MSSVAL_SHIFT 16 /* Large send MSS value shift */ +#define RL_TDESC_CMD_LGSEND 0x08000000 /* TCP large send enb */ +#define RL_TDESC_CMD_EOF 0x10000000 /* end of frame marker */ +#define RL_TDESC_CMD_SOF 0x20000000 /* start of frame marker */ +#define RL_TDESC_CMD_EOR 0x40000000 /* end of ring marker */ +#define RL_TDESC_CMD_OWN 0x80000000 /* chip owns descriptor */ + +#define RL_TDESC_VLANCTL_TAG 0x00020000 /* Insert VLAN tag */ +#define RL_TDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ +/* RTL8168C/RTL8168CP/RTL8111C/RTL8111CP */ +#define RL_TDESC_CMD_UDPCSUMV2 0x80000000 +#define RL_TDESC_CMD_TCPCSUMV2 0x40000000 +#define RL_TDESC_CMD_IPCSUMV2 0x20000000 +#define RL_TDESC_CMD_MSSVALV2 0x1FFC0000 +#define RL_TDESC_CMD_MSSVALV2_SHIFT 18 + +/* + * Error bits are valid only on the last descriptor of a frame + * (i.e. RL_TDESC_CMD_EOF == 1) + */ +#define RL_TDESC_STAT_COLCNT 0x000F0000 /* collision count */ +#define RL_TDESC_STAT_EXCESSCOL 0x00100000 /* excessive collisions */ +#define RL_TDESC_STAT_LINKFAIL 0x00200000 /* link faulure */ +#define RL_TDESC_STAT_OWINCOL 0x00400000 /* out-of-window collision */ +#define RL_TDESC_STAT_TXERRSUM 0x00800000 /* transmit error summary */ +#define RL_TDESC_STAT_UNDERRUN 0x02000000 /* TX underrun occured */ +#define RL_TDESC_STAT_OWN 0x80000000 + +/* + * RX descriptor cmd/vlan definitions + */ +#define RL_RDESC_CMD_EOR 0x40000000 +#define RL_RDESC_CMD_OWN 0x80000000 +#define RL_RDESC_CMD_BUFLEN 0x00001FFF + +#define RL_RDESC_STAT_OWN 0x80000000 +#define RL_RDESC_STAT_EOR 0x40000000 +#define RL_RDESC_STAT_SOF 0x20000000 +#define RL_RDESC_STAT_EOF 0x10000000 +#define RL_RDESC_STAT_FRALIGN 0x08000000 /* frame alignment error */ +#define RL_RDESC_STAT_MCAST 0x04000000 /* multicast pkt received */ +#define RL_RDESC_STAT_UCAST 0x02000000 /* unicast pkt received */ +#define RL_RDESC_STAT_BCAST 0x01000000 /* broadcast pkt received */ +#define RL_RDESC_STAT_BUFOFLOW 0x00800000 /* out of buffer space */ +#define RL_RDESC_STAT_FIFOOFLOW 0x00400000 /* FIFO overrun */ +#define RL_RDESC_STAT_GIANT 0x00200000 /* pkt > 4096 bytes */ +#define RL_RDESC_STAT_RXERRSUM 0x00100000 /* RX error summary */ +#define RL_RDESC_STAT_RUNT 0x00080000 /* runt packet received */ +#define RL_RDESC_STAT_CRCERR 0x00040000 /* CRC error */ +#define RL_RDESC_STAT_PROTOID 0x00030000 /* Protocol type */ +#define RL_RDESC_STAT_UDP 0x00020000 /* UDP, 8168C/CP, 8111C/CP */ +#define RL_RDESC_STAT_TCP 0x00010000 /* TCP, 8168C/CP, 8111C/CP */ +#define RL_RDESC_STAT_IPSUMBAD 0x00008000 /* IP header checksum bad */ +#define RL_RDESC_STAT_UDPSUMBAD 0x00004000 /* UDP checksum bad */ +#define RL_RDESC_STAT_TCPSUMBAD 0x00002000 /* TCP checksum bad */ +#define RL_RDESC_STAT_FRAGLEN 0x00001FFF /* RX'ed frame/frag len */ +#define RL_RDESC_STAT_GFRAGLEN 0x00003FFF /* RX'ed frame/frag len */ +#define RL_RDESC_STAT_ERRS (RL_RDESC_STAT_GIANT|RL_RDESC_STAT_RUNT| \ + RL_RDESC_STAT_CRCERR) + +#define RL_RDESC_VLANCTL_TAG 0x00010000 /* VLAN tag available + (rl_vlandata valid)*/ +#define RL_RDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ +/* RTL8168C/RTL8168CP/RTL8111C/RTL8111CP */ +#define RL_RDESC_IPV6 0x80000000 +#define RL_RDESC_IPV4 0x40000000 + +#define RL_PROTOID_NONIP 0x00000000 +#define RL_PROTOID_TCPIP 0x00010000 +#define RL_PROTOID_UDPIP 0x00020000 +#define RL_PROTOID_IP 0x00030000 +#define RL_TCPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ + RL_PROTOID_TCPIP) +#define RL_UDPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ + RL_PROTOID_UDPIP) + +/* + * Statistics counter structure (8139C+ and 8169 only) + */ +struct rl_stats { + uint64_t rl_tx_pkts; + uint64_t rl_rx_pkts; + uint64_t rl_tx_errs; + uint32_t rl_rx_errs; + uint16_t rl_missed_pkts; + uint16_t rl_rx_framealign_errs; + uint32_t rl_tx_onecoll; + uint32_t rl_tx_multicolls; + uint64_t rl_rx_ucasts; + uint64_t rl_rx_bcasts; + uint32_t rl_rx_mcasts; + uint16_t rl_tx_aborts; + uint16_t rl_rx_underruns; +}; + +/* + * Rx/Tx descriptor parameters (8139C+ and 8169 only) + * + * 8139C+ + * Number of descriptors supported : up to 64 + * Descriptor alignment : 256 bytes + * Tx buffer : At least 4 bytes in length. + * Rx buffer : At least 8 bytes in length and 8 bytes alignment required. + * + * 8169 + * Number of descriptors supported : up to 1024 + * Descriptor alignment : 256 bytes + * Tx buffer : At least 4 bytes in length. + * Rx buffer : At least 8 bytes in length and 8 bytes alignment required. + */ +#ifndef __NO_STRICT_ALIGNMENT +#define RE_FIXUP_RX 1 +#endif + +#define RL_8169_TX_DESC_CNT 256 +#define RL_8169_RX_DESC_CNT 256 +#define RL_8139_TX_DESC_CNT 64 +#define RL_8139_RX_DESC_CNT 64 +#define RL_TX_DESC_CNT RL_8169_TX_DESC_CNT +#define RL_RX_DESC_CNT RL_8169_RX_DESC_CNT +#define RL_RX_JUMBO_DESC_CNT RL_RX_DESC_CNT +#define RL_NTXSEGS 35 + +#define RL_RING_ALIGN 256 +#define RL_DUMP_ALIGN 64 +#define RL_IFQ_MAXLEN 512 +#define RL_TX_DESC_NXT(sc,x) ((x + 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1)) +#define RL_TX_DESC_PRV(sc,x) ((x - 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1)) +#define RL_RX_DESC_NXT(sc,x) ((x + 1) & ((sc)->rl_ldata.rl_rx_desc_cnt - 1)) +#define RL_OWN(x) (le32toh((x)->rl_cmdstat) & RL_RDESC_STAT_OWN) +#define RL_RXBYTES(x) (le32toh((x)->rl_cmdstat) & sc->rl_rxlenmask) +#define RL_PKTSZ(x) ((x)/* >> 3*/) +#ifdef RE_FIXUP_RX +#define RE_ETHER_ALIGN sizeof(uint64_t) +#define RE_RX_DESC_BUFLEN (MCLBYTES - RE_ETHER_ALIGN) +#else +#define RE_ETHER_ALIGN 0 +#define RE_RX_DESC_BUFLEN MCLBYTES +#endif + +#define RL_MSI_MESSAGES 1 + +#define RL_ADDR_LO(y) ((uint64_t) (y) & 0xFFFFFFFF) +#define RL_ADDR_HI(y) ((uint64_t) (y) >> 32) + +/* + * The number of bits reserved for MSS in RealTek controllers is + * 11bits. This limits the maximum interface MTU size in TSO case + * as upper stack should not generate TCP segments with MSS greater + * than the limit. + */ +#define RL_TSO_MTU (2047 - ETHER_HDR_LEN - ETHER_CRC_LEN) + +/* see comment in dev/re/if_re.c */ +#define RL_JUMBO_FRAMELEN 7440 +#define RL_JUMBO_MTU \ + (RL_JUMBO_FRAMELEN-ETHER_VLAN_ENCAP_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN) +#define RL_JUMBO_MTU_6K \ + ((6 * 1024) - ETHER_VLAN_ENCAP_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) +#define RL_JUMBO_MTU_9K \ + ((9 * 1024) - ETHER_VLAN_ENCAP_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) +#define RL_MTU \ + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) + +struct rl_txdesc { + struct mbuf *tx_m; + bus_dmamap_t tx_dmamap; +}; + +struct rl_rxdesc { + struct mbuf *rx_m; + bus_dmamap_t rx_dmamap; + bus_size_t rx_size; +}; + +struct rl_list_data { + struct rl_txdesc rl_tx_desc[RL_TX_DESC_CNT]; + struct rl_rxdesc rl_rx_desc[RL_RX_DESC_CNT]; + struct rl_rxdesc rl_jrx_desc[RL_RX_JUMBO_DESC_CNT]; + int rl_tx_desc_cnt; + int rl_rx_desc_cnt; + int rl_tx_prodidx; + int rl_rx_prodidx; + int rl_tx_considx; + int rl_tx_free; + bus_dma_tag_t rl_tx_mtag; /* mbuf TX mapping tag */ + bus_dma_tag_t rl_rx_mtag; /* mbuf RX mapping tag */ + bus_dma_tag_t rl_jrx_mtag; /* mbuf RX mapping tag */ + bus_dmamap_t rl_rx_sparemap; + bus_dmamap_t rl_jrx_sparemap; + bus_dma_tag_t rl_stag; /* stats mapping tag */ + bus_dmamap_t rl_smap; /* stats map */ + struct rl_stats *rl_stats; + bus_addr_t rl_stats_addr; + bus_dma_tag_t rl_rx_list_tag; + bus_dmamap_t rl_rx_list_map; + struct rl_desc *rl_rx_list; + bus_addr_t rl_rx_list_addr; + bus_dma_tag_t rl_tx_list_tag; + bus_dmamap_t rl_tx_list_map; + struct rl_desc *rl_tx_list; + bus_addr_t rl_tx_list_addr; +}; + +enum rl_twist { DONE, CHK_LINK, FIND_ROW, SET_PARAM, RECHK_LONG, RETUNE }; + +struct rl_softc { + struct ifnet *rl_ifp; /* interface info */ + bus_space_handle_t rl_bhandle; /* bus space handle */ + bus_space_tag_t rl_btag; /* bus space tag */ + device_t rl_dev; + struct resource *rl_res; + int rl_res_id; + int rl_res_type; + struct resource *rl_res_pba; + struct resource *rl_irq[RL_MSI_MESSAGES]; + void *rl_intrhand[RL_MSI_MESSAGES]; + device_t rl_miibus; + bus_dma_tag_t rl_parent_tag; + uint8_t rl_type; + const struct rl_hwrev *rl_hwrev; + uint32_t rl_macrev; + int rl_eecmd_read; + int rl_eewidth; + int rl_expcap; + int rl_txthresh; + bus_size_t rl_cfg0; + bus_size_t rl_cfg1; + bus_size_t rl_cfg2; + bus_size_t rl_cfg3; + bus_size_t rl_cfg4; + bus_size_t rl_cfg5; + struct rl_chain_data rl_cdata; + struct rl_list_data rl_ldata; + struct callout rl_stat_callout; + int rl_watchdog_timer; + struct mtx rl_mtx; + struct mbuf *rl_head; + struct mbuf *rl_tail; + uint32_t rl_rxlenmask; + int rl_testmode; + int rl_if_flags; + int rl_twister_enable; + enum rl_twist rl_twister; + int rl_twist_row; + int rl_twist_col; + int suspended; /* 0 = normal 1 = suspended */ +#ifdef DEVICE_POLLING + int rxcycles; +#endif + + struct task rl_inttask; + + int rl_txstart; + int rl_int_rx_act; + int rl_int_rx_mod; + uint32_t rl_flags; +#define RL_FLAG_MSI 0x00000001 +#define RL_FLAG_AUTOPAD 0x00000002 +#define RL_FLAG_PHYWAKE_PM 0x00000004 +#define RL_FLAG_PHYWAKE 0x00000008 +#define RL_FLAG_JUMBOV2 0x00000010 +#define RL_FLAG_PAR 0x00000020 +#define RL_FLAG_DESCV2 0x00000040 +#define RL_FLAG_MACSTAT 0x00000080 +#define RL_FLAG_FASTETHER 0x00000100 +#define RL_FLAG_CMDSTOP 0x00000200 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 10:33:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22D28B83; Fri, 19 Sep 2014 10:33:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E89C7E5C; Fri, 19 Sep 2014 10:33:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JAXNFk042327; Fri, 19 Sep 2014 10:33:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JAXNY4042326; Fri, 19 Sep 2014 10:33:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409191033.s8JAXNY4042326@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 10:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271865 - head/sys/dev/rl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 10:33:24 -0000 Author: glebius Date: Fri Sep 19 10:33:23 2014 New Revision: 271865 URL: http://svnweb.freebsd.org/changeset/base/271865 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/rl/if_rl.c Modified: head/sys/dev/rl/if_rl.c ============================================================================== --- head/sys/dev/rl/if_rl.c Fri Sep 19 10:32:20 2014 (r271864) +++ head/sys/dev/rl/if_rl.c Fri Sep 19 10:33:23 2014 (r271865) @@ -1166,7 +1166,7 @@ rl_rxeof(struct rl_softc *sc) if (!(rxstat & RL_RXSTAT_RXOK) || total_len < ETHER_MIN_LEN || total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; rl_init_locked(sc); return (rx_npkts); @@ -1215,11 +1215,11 @@ rl_rxeof(struct rl_softc *sc) CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16); if (m == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); continue; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); RL_UNLOCK(sc); (*ifp->if_input)(ifp, m); RL_LOCK(sc); @@ -1254,7 +1254,7 @@ rl_txeof(struct rl_softc *sc) RL_TXSTAT_TX_UNDERRUN|RL_TXSTAT_TXABRT))) break; - ifp->if_collisions += (txstat & RL_TXSTAT_COLLCNT) >> 24; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (txstat & RL_TXSTAT_COLLCNT) >> 24); bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc), BUS_DMASYNC_POSTWRITE); @@ -1270,10 +1270,10 @@ rl_txeof(struct rl_softc *sc) (sc->rl_txthresh < 2016)) sc->rl_txthresh += 32; if (txstat & RL_TXSTAT_TX_OK) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else { int oldthresh; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if ((txstat & RL_TXSTAT_TXABRT) || (txstat & RL_TXSTAT_OUTOFWIN)) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); @@ -1897,7 +1897,7 @@ rl_watchdog(struct rl_softc *sc) return; device_printf(sc->rl_dev, "watchdog timeout\n"); - sc->rl_ifp->if_oerrors++; + if_inc_counter(sc->rl_ifp, IFCOUNTER_OERRORS, 1); rl_txeof(sc); rl_rxeof(sc); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 10:35:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53A14D2B; Fri, 19 Sep 2014 10:35:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39D0CE84; Fri, 19 Sep 2014 10:35:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JAZxjX042700; Fri, 19 Sep 2014 10:35:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JAZv2a042691; Fri, 19 Sep 2014 10:35:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409191035.s8JAZv2a042691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 10:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271866 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 10:35:59 -0000 Author: glebius Date: Fri Sep 19 10:35:56 2014 New Revision: 271866 URL: http://svnweb.freebsd.org/changeset/base/271866 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_rsu.c Fri Sep 19 10:35:56 2014 (r271866) @@ -1352,11 +1352,11 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 rxdw3 = le32toh(stat->rxdw3); if (__predict_false(rxdw0 & R92S_RXDW0_CRCERR)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return NULL; } if (__predict_false(pktlen < sizeof(*wh) || pktlen > MCLBYTES)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return NULL; } @@ -1374,7 +1374,7 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return NULL; } /* Finalize mbuf. */ @@ -1483,7 +1483,7 @@ rsu_rxeof(struct usb_xfer *xfer, struct if (__predict_false(len < sizeof(*stat))) { DPRINTF("xfer too short %d\n", len); - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); return (NULL); } /* Determine if it is a firmware C2H event or an 802.11 frame. */ @@ -1561,7 +1561,7 @@ tr_setup: } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } break; @@ -1596,7 +1596,7 @@ rsu_txeof(struct usb_xfer *xfer, struct ieee80211_free_node(data->ni); data->ni = NULL; } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } @@ -1640,7 +1640,7 @@ tr_setup: rsu_txeof(xfer, data); STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); } - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); @@ -1801,11 +1801,11 @@ rsu_start_locked(struct ifnet *ifp) bf = rsu_getbuf(sc); if (bf == NULL) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); m_freem(m); ieee80211_free_node(ni); } else if (rsu_tx_start(sc, ni, m, bf) != 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); ieee80211_free_node(ni); } @@ -2311,10 +2311,10 @@ rsu_raw_xmit(struct ieee80211_node *ni, RSU_UNLOCK(sc); return (ENOBUFS); } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (rsu_tx_start(sc, ni, m, bf) != 0) { ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); RSU_UNLOCK(sc); return (EIO); Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_rum.c Fri Sep 19 10:35:56 2014 (r271866) @@ -797,7 +797,7 @@ rum_bulk_write_callback(struct usb_xfer rum_tx_free(data, 0); usbd_xfer_set_priv(xfer, NULL); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ @@ -851,7 +851,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); data = usbd_xfer_get_priv(xfer); if (data != NULL) { rum_tx_free(data, error); @@ -897,7 +897,7 @@ rum_bulk_read_callback(struct usb_xfer * if (len < (int)(RT2573_RX_DESC_SIZE + IEEE80211_MIN_LEN)) { DPRINTF("%s: xfer too short %d\n", device_get_nameunit(sc->sc_dev), len); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } @@ -914,14 +914,14 @@ rum_bulk_read_callback(struct usb_xfer * * filled RUM_TXRX_CSR2: */ DPRINTFN(5, "PHY or CRC error\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { DPRINTF("could not allocate mbuf\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } usbd_copy_out(pc, RT2573_RX_DESC_SIZE, @@ -1321,7 +1321,7 @@ rum_start(struct ifnet *ifp) ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (rum_tx_data(sc, m, ni) != 0) { ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); break; } } @@ -2205,7 +2205,7 @@ rum_raw_xmit(struct ieee80211_node *ni, return EIO; } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (params == NULL) { /* @@ -2226,7 +2226,7 @@ rum_raw_xmit(struct ieee80211_node *ni, return 0; bad: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); RUM_UNLOCK(sc); ieee80211_free_node(ni); return EIO; @@ -2281,7 +2281,7 @@ rum_ratectl_task(void *arg, int pending) (void) ieee80211_ratectl_rate(ni, NULL, 0); ieee80211_free_node(ni); - ifp->if_oerrors += fail; /* count TX retry-fail as Tx errors */ + if_inc_counter(ifp, IFCOUNTER_OERRORS, fail); /* count TX retry-fail as Tx errors */ usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp); RUM_UNLOCK(sc); Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_run.c Fri Sep 19 10:35:56 2014 (r271866) @@ -2574,7 +2574,7 @@ run_drain_fifo(void *arg) if (stat & RT2860_TXQ_OK) (*wstat)[RUN_SUCCESS]++; else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* * Check if there were retries, ie if the Tx success rate is * different from the requested rate. Note that it works only @@ -2620,7 +2620,7 @@ run_iter_func(void *arg, struct ieee8021 goto fail; /* count failed TX as errors */ - ifp->if_oerrors += le16toh(sta[0].error.fail); + if_inc_counter(ifp, IFCOUNTER_OERRORS, le16toh(sta[0].error.fail)); retrycnt = le16toh(sta[1].tx.retry); success = le16toh(sta[1].tx.success); @@ -2786,7 +2786,7 @@ run_rx_frame(struct run_softc *sc, struc rxwisize += sizeof(uint32_t); if (__predict_false(len > dmalen)) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF("bad RXWI length %u > %u\n", len, dmalen); return; } @@ -2796,7 +2796,7 @@ run_rx_frame(struct run_softc *sc, struc if (__predict_false(flags & (RT2860_RX_CRCERR | RT2860_RX_ICVERR))) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF("%s error.\n", (flags & RT2860_RX_CRCERR)?"CRC":"ICV"); return; } @@ -2825,7 +2825,7 @@ run_rx_frame(struct run_softc *sc, struc ieee80211_notify_michael_failure(ni->ni_vap, wh, rxwi->keyidx); m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF("MIC error. Someone is lying.\n"); return; } @@ -2925,7 +2925,7 @@ tr_setup: } if (sc->rx_m == NULL) { DPRINTF("could not allocate mbuf - idle with stall\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); usbd_xfer_set_stall(xfer); usbd_xfer_set_frames(xfer, 0); } else { @@ -2949,7 +2949,7 @@ tr_setup: if (error == USB_ERR_TIMEOUT) device_printf(sc->sc_dev, "device timeout\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } @@ -2998,7 +2998,7 @@ tr_setup: m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m0 == NULL)) { DPRINTF("could not allocate mbuf\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } m_copydata(m, 4 /* skip 32-bit DMA-len header */, @@ -3070,7 +3070,7 @@ run_bulk_tx_callbackN(struct usb_xfer *x usbd_xfer_set_priv(xfer, NULL); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -3089,7 +3089,7 @@ tr_setup: DPRINTF("data overflow, %u bytes\n", m->m_pkthdr.len); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); run_tx_free(pq, data, 1); @@ -3144,7 +3144,7 @@ tr_setup: data = usbd_xfer_get_priv(xfer); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (data != NULL) { if(data->ni != NULL) @@ -3567,7 +3567,7 @@ run_sendprot(struct run_softc *sc, mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, dur); } if (mprot == NULL) { - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); DPRINTF("could not allocate mbuf\n"); return (ENOBUFS); } @@ -3703,20 +3703,20 @@ run_raw_xmit(struct ieee80211_node *ni, if (params == NULL) { /* tx mgt packet */ if ((error = run_tx_mgt(sc, m, ni)) != 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); DPRINTF("mgt tx failed\n"); goto done; } } else { /* tx raw packet with param */ if ((error = run_tx_param(sc, m, ni, params)) != 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); DPRINTF("tx with param failed\n"); goto done; } } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); done: RUN_UNLOCK(sc); Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_uath.c Fri Sep 19 10:35:56 2014 (r271866) @@ -1333,7 +1333,7 @@ uath_watchdog(void *arg) if (--sc->sc_tx_timer == 0) { device_printf(sc->sc_dev, "device timeout\n"); /*uath_init(ifp); XXX needs a process context! */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return; } callout_reset(&sc->watchdog_ch, hz, uath_watchdog, sc); @@ -1814,7 +1814,7 @@ uath_start(struct ifnet *ifp) next = m->m_nextpkt; if (uath_tx_start(sc, m, ni, bf) != 0) { bad: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); reclaim: STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); UATH_STAT_INC(sc, st_tx_inactive); @@ -1878,7 +1878,7 @@ uath_raw_xmit(struct ieee80211_node *ni, sc->sc_seqnum = 0; if (uath_tx_start(sc, m, ni, bf) != 0) { ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); UATH_STAT_INC(sc, st_tx_inactive); UATH_UNLOCK(sc); @@ -2553,14 +2553,14 @@ uath_data_rxeof(struct usb_xfer *xfer, s if (actlen < (int)UATH_MIN_RXBUFSZ) { DPRINTF(sc, UATH_DEBUG_RECV | UATH_DEBUG_RECV_ALL, "%s: wrong xfer size (len=%d)\n", __func__, actlen); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } chunk = (struct uath_chunk *)data->buf; if (chunk->seqnum == 0 && chunk->flags == 0 && chunk->length == 0) { device_printf(sc->sc_dev, "%s: strange response\n", __func__); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); UATH_RESET_INTRX(sc); return (NULL); } @@ -2593,7 +2593,7 @@ uath_data_rxeof(struct usb_xfer *xfer, s if ((sc->sc_intrx_len + sizeof(struct uath_rx_desc) + chunklen) > UATH_MAX_INTRX_SIZE) { UATH_STAT_INC(sc, st_invalidlen); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); if (sc->sc_intrx_head != NULL) m_freem(sc->sc_intrx_head); UATH_RESET_INTRX(sc); @@ -2618,7 +2618,7 @@ uath_data_rxeof(struct usb_xfer *xfer, s if (mnew == NULL) { DPRINTF(sc, UATH_DEBUG_RECV | UATH_DEBUG_RECV_ALL, "%s: can't get new mbuf, drop frame\n", __func__); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if (sc->sc_intrx_head != NULL) m_freem(sc->sc_intrx_head); UATH_RESET_INTRX(sc); @@ -2659,7 +2659,7 @@ uath_data_rxeof(struct usb_xfer *xfer, s DPRINTF(sc, UATH_DEBUG_RECV | UATH_DEBUG_RECV_ALL, "%s: bad descriptor (len=%d)\n", __func__, be32toh(desc->len)); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); UATH_STAT_INC(sc, st_toobigrxpkt); if (sc->sc_intrx_head != NULL) m_freem(sc->sc_intrx_head); @@ -2703,7 +2703,7 @@ uath_data_rxeof(struct usb_xfer *xfer, s tap->wr_antnoise = -95; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); UATH_RESET_INTRX(sc); return (m); @@ -2790,7 +2790,7 @@ setup: } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto setup; } break; @@ -2826,7 +2826,7 @@ uath_data_txeof(struct usb_xfer *xfer, s data->ni = NULL; } sc->sc_tx_timer = 0; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } @@ -2878,7 +2878,7 @@ setup: if ((sc->sc_flags & UATH_FLAG_INVALID) == 0) ieee80211_free_node(data->ni); data->ni = NULL; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_upgt.c Fri Sep 19 10:35:56 2014 (r271866) @@ -416,7 +416,7 @@ upgt_txeof(struct usb_xfer *xfer, struct ieee80211_free_node(data->ni); data->ni = NULL; } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } static void @@ -854,7 +854,7 @@ upgt_start(struct ifnet *ifp) STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, data_tx, next); UPGT_STAT_INC(sc, st_tx_inactive); ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } sc->sc_tx_timer = 5; @@ -891,7 +891,7 @@ upgt_raw_xmit(struct ieee80211_node *ni, STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, data_tx, next); UPGT_STAT_INC(sc, st_tx_inactive); ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); UPGT_UNLOCK(sc); return (EIO); } @@ -911,7 +911,7 @@ upgt_watchdog(void *arg) if (--sc->sc_tx_timer == 0) { device_printf(sc->sc_dev, "watchdog timeout\n"); /* upgt_init(ifp); XXX needs a process context ? */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return; } callout_reset(&sc->sc_watchdog_ch, hz, upgt_watchdog, sc); @@ -1552,7 +1552,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t * tap->wr_rate = upgt_rx_rate(sc, rxdesc->rate); tap->wr_antsignal = rxdesc->rssi; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); DPRINTF(sc, UPGT_DEBUG_RX_PROC, "%s: RX done\n", __func__); *rssi = rxdesc->rssi; @@ -2293,7 +2293,8 @@ done: * will stall. It's strange, but it works, so we keep reading * the statistics here. *shrug* */ - if (!(ifp->if_opackets % UPGT_TX_STAT_INTERVAL)) + if (!(ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS) % + UPGT_TX_STAT_INTERVAL)) upgt_get_stats(sc); return (error); @@ -2366,7 +2367,7 @@ setup: } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto setup; } break; @@ -2418,7 +2419,7 @@ setup: if (data->ni != NULL) { ieee80211_free_node(data->ni); data->ni = NULL; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_ural.c Fri Sep 19 10:35:56 2014 (r271866) @@ -805,7 +805,7 @@ ural_bulk_write_callback(struct usb_xfer ural_tx_free(data, 0); usbd_xfer_set_priv(xfer, NULL); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ @@ -859,7 +859,7 @@ tr_setup: DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); data = usbd_xfer_get_priv(xfer); if (data != NULL) { ural_tx_free(data, error); @@ -900,7 +900,7 @@ ural_bulk_read_callback(struct usb_xfer if (len < (int)(RAL_RX_DESC_SIZE + IEEE80211_MIN_LEN)) { DPRINTF("%s: xfer too short %d\n", device_get_nameunit(sc->sc_dev), len); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } @@ -919,14 +919,14 @@ ural_bulk_read_callback(struct usb_xfer * filled RAL_TXRX_CSR2: */ DPRINTFN(5, "PHY or CRC error\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { DPRINTF("could not allocate mbuf\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } usbd_copy_out(pc, 0, mtod(m, uint8_t *), len); @@ -1370,7 +1370,7 @@ ural_start(struct ifnet *ifp) ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (ural_tx_data(sc, m, ni) != 0) { ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); break; } } @@ -2210,7 +2210,7 @@ ural_raw_xmit(struct ieee80211_node *ni, return EIO; } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (params == NULL) { /* @@ -2230,7 +2230,7 @@ ural_raw_xmit(struct ieee80211_node *ni, RAL_UNLOCK(sc); return 0; bad: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); RAL_UNLOCK(sc); ieee80211_free_node(ni); return EIO; /* XXX */ @@ -2284,7 +2284,7 @@ ural_ratectl_task(void *arg, int pending ieee80211_ratectl_tx_update(vap, ni, &sum, &ok, &retrycnt); (void) ieee80211_ratectl_rate(ni, NULL, 0); - ifp->if_oerrors += fail; /* count TX retry-fail as Tx errors */ + if_inc_counter(ifp, IFCOUNTER_OERRORS, fail); /* count TX retry-fail as Tx errors */ usb_callout_reset(&uvp->ratectl_ch, hz, ural_ratectl_timeout, uvp); RAL_UNLOCK(sc); Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_urtw.c Fri Sep 19 10:35:56 2014 (r271866) @@ -1472,7 +1472,7 @@ urtw_start(struct ifnet *ifp) m->m_pkthdr.rcvif = NULL; if (urtw_tx_start(sc, ni, m, bf, URTW_PRIORITY_NORMAL) != 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); ieee80211_free_node(ni); break; @@ -1582,10 +1582,10 @@ urtw_raw_xmit(struct ieee80211_node *ni, return (ENOBUFS); /* XXX */ } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (urtw_tx_start(sc, ni, m, bf, URTW_PRIORITY_LOW) != 0) { ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); URTW_UNLOCK(sc); return (EIO); @@ -1918,7 +1918,7 @@ urtw_watchdog(void *arg) if (sc->sc_txtimer > 0) { if (--sc->sc_txtimer == 0) { device_printf(sc->sc_dev, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return; } callout_reset(&sc->sc_watchdog_ch, hz, urtw_watchdog, sc); @@ -3993,7 +3993,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); if (actlen < (int)URTW_MIN_RXBUFSZ) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } @@ -4004,7 +4004,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct (actlen - (sizeof(struct urtw_8187b_rxhdr)))); flen = le32toh(rx->flag) & 0xfff; if (flen > actlen) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } rate = (le32toh(rx->flag) >> URTW_RX_FLAG_RXRATE_SHIFT) & 0xf; @@ -4018,7 +4018,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct (actlen - (sizeof(struct urtw_8187l_rxhdr)))); flen = le32toh(rx->flag) & 0xfff; if (flen > actlen) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } @@ -4030,7 +4030,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mnew == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } @@ -4127,7 +4127,7 @@ setup: } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto setup; } break; @@ -4156,7 +4156,7 @@ urtw_txstatus_eof(struct usb_xfer *xfer) pktretry = val & 0xff; seq = (val >> 16) & 0xff; if (pktretry == URTW_TX_MAXRETRY) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); DPRINTF(sc, URTW_DEBUG_TXSTATUS, "pktretry %d seq %#x\n", pktretry, seq); } @@ -4184,7 +4184,7 @@ setup: default: if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto setup; } break; @@ -4218,7 +4218,7 @@ urtw_txeof(struct usb_xfer *xfer, struct data->ni = NULL; } sc->sc_txtimer = 0; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } @@ -4265,7 +4265,7 @@ setup: if (data->ni != NULL) { ieee80211_free_node(data->ni); data->ni = NULL; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Sep 19 10:35:56 2014 (r271866) @@ -657,11 +657,11 @@ urtwn_rx_frame(struct urtwn_softc *sc, u * This should not happen since we setup our Rx filter * to not receive these frames. */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } if (pktlen < sizeof(*wh) || pktlen > MCLBYTES) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } @@ -746,7 +746,7 @@ urtwn_rxeof(struct usb_xfer *xfer, struc usbd_xfer_status(xfer, &len, NULL, NULL, NULL); if (len < sizeof(*stat)) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return (NULL); } @@ -861,7 +861,7 @@ tr_setup: } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto tr_setup; } break; @@ -895,7 +895,7 @@ urtwn_txeof(struct usb_xfer *xfer, struc data->ni = NULL; } sc->sc_txtimer = 0; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } @@ -937,7 +937,7 @@ tr_setup: if (data->ni != NULL) { ieee80211_free_node(data->ni); data->ni = NULL; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); @@ -1668,7 +1668,7 @@ urtwn_watchdog(void *arg) if (sc->sc_txtimer > 0) { if (--sc->sc_txtimer == 0) { device_printf(sc->sc_dev, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return; } callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); @@ -1972,7 +1972,7 @@ urtwn_start_locked(struct ifnet *ifp, st m->m_pkthdr.rcvif = NULL; if (urtwn_tx_start(sc, ni, m, bf) != 0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); ieee80211_free_node(ni); break; @@ -3528,10 +3528,10 @@ urtwn_raw_xmit(struct ieee80211_node *ni return (ENOBUFS); } - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if (urtwn_tx_start(sc, ni, m, bf) != 0) { ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); URTWN_UNLOCK(sc); return (EIO); Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Fri Sep 19 10:33:23 2014 (r271865) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Sep 19 10:35:56 2014 (r271866) @@ -679,7 +679,7 @@ zyd_intr_read_callback(struct usb_xfer * ieee80211_free_node(ni); } if (le16toh(retry->count) & 0x100) - ifp->if_oerrors++; /* too many retries */ + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* too many retries */ break; } case ZYD_NOTIF_IORD: @@ -2188,7 +2188,7 @@ zyd_rx_data(struct usb_xfer *xfer, int o if (len < ZYD_MIN_FRAGSZ) { DPRINTF(sc, ZYD_DEBUG_RECV, "%s: frame too short (length=%d)\n", device_get_nameunit(sc->sc_dev), len); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } pc = usbd_xfer_get_frame(xfer, 0); @@ -2199,7 +2199,7 @@ zyd_rx_data(struct usb_xfer *xfer, int o DPRINTF(sc, ZYD_DEBUG_RECV, "%s: RX status indicated error (%x)\n", device_get_nameunit(sc->sc_dev), stat.flags); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -2211,7 +2211,7 @@ zyd_rx_data(struct usb_xfer *xfer, int o if (rlen > (int)MCLBYTES) { DPRINTF(sc, ZYD_DEBUG_RECV, "%s: frame too long (length=%d)\n", device_get_nameunit(sc->sc_dev), rlen); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } else if (rlen > (int)MHLEN) m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); @@ -2220,7 +2220,7 @@ zyd_rx_data(struct usb_xfer *xfer, int o if (m == NULL) { DPRINTF(sc, ZYD_DEBUG_RECV, "%s: could not allocate rx mbuf\n", device_get_nameunit(sc->sc_dev)); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } m->m_pkthdr.rcvif = ifp; @@ -2403,7 +2403,7 @@ zyd_bulk_write_callback(struct usb_xfer zyd_tx_free(data, 0); usbd_xfer_set_priv(xfer, NULL); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ @@ -2447,7 +2447,7 @@ tr_setup: DPRINTF(sc, ZYD_DEBUG_ANY, "transfer error, %s\n", usbd_errstr(error)); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); data = usbd_xfer_get_priv(xfer); usbd_xfer_set_priv(xfer, NULL); if (data != NULL) @@ -2608,7 +2608,7 @@ zyd_start(struct ifnet *ifp) ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; if (zyd_tx_start(sc, m, ni) != 0) { ieee80211_free_node(ni); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); break; } } @@ -2646,7 +2646,7 @@ zyd_raw_xmit(struct ieee80211_node *ni, */ if (zyd_tx_start(sc, m, ni) != 0) { ZYD_UNLOCK(sc); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_free_node(ni); return (EIO); } From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 10:40:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8117BFD; Fri, 19 Sep 2014 10:40:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0B4F79; Fri, 19 Sep 2014 10:40:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JAe224043326; Fri, 19 Sep 2014 10:40:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JAdx6D043231; Fri, 19 Sep 2014 10:39:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409191039.s8JAdx6D043231@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 10:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271867 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 10:40:02 -0000 Author: glebius Date: Fri Sep 19 10:39:58 2014 New Revision: 271867 URL: http://svnweb.freebsd.org/changeset/base/271867 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/net/if_arcsubr.c head/sys/net/if_atmsubr.c head/sys/net/if_bridge.c head/sys/net/if_disc.c head/sys/net/if_edsc.c head/sys/net/if_epair.c head/sys/net/if_ethersubr.c head/sys/net/if_faith.c head/sys/net/if_fddisubr.c head/sys/net/if_fwsubr.c head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_iso88025subr.c head/sys/net/if_loop.c head/sys/net/if_spppfr.c head/sys/net/if_spppsubr.c head/sys/net/if_stf.c head/sys/net/if_tap.c head/sys/net/if_tun.c head/sys/net/if_vlan.c Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_arcsubr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -357,7 +357,7 @@ arc_defrag(struct ifnet *ifp, struct mbu if (m->m_len < ARC_HDRNEWLEN) { m = m_pullup(m, ARC_HDRNEWLEN); if (m == NULL) { - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return NULL; } } @@ -377,7 +377,7 @@ arc_defrag(struct ifnet *ifp, struct mbu if (m->m_len < ARC_HDRNEWLEN) { m = m_pullup(m, ARC_HDRNEWLEN); if (m == NULL) { - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return NULL; } } @@ -530,11 +530,11 @@ arc_input(struct ifnet *ifp, struct mbuf return; } - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); if (ah->arc_dhost == arcbroadcastaddr) { m->m_flags |= M_BCAST|M_MCAST; - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); } atype = ah->arc_type; Modified: head/sys/net/if_atmsubr.c ============================================================================== --- head/sys/net/if_atmsubr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_atmsubr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -252,7 +252,7 @@ atm_input(struct ifnet *ifp, struct atm_ #ifdef MAC mac_ifnet_create_mbuf(ifp, m); #endif - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); if (ng_atm_input_p != NULL) { (*ng_atm_input_p)(ifp, &m, ah, rxhand); Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_bridge.c Fri Sep 19 10:39:58 2014 (r271867) @@ -1848,7 +1848,7 @@ bridge_enqueue(struct bridge_softc *sc, if (m == NULL) { if_printf(dst_ifp, "unable to prepend VLAN header\n"); - dst_ifp->if_oerrors++; + if_inc_counter(dst_ifp, IFCOUNTER_OERRORS, 1); continue; } m->m_flags &= ~M_VLANTAG; @@ -1856,14 +1856,14 @@ bridge_enqueue(struct bridge_softc *sc, if ((err = dst_ifp->if_transmit(dst_ifp, m))) { m_freem(m0); - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); break; } - sc->sc_ifp->if_opackets++; - sc->sc_ifp->if_obytes += len; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(sc->sc_ifp, IFCOUNTER_OBYTES, len); if (mflags & M_MCAST) - sc->sc_ifp->if_omcasts++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OMCASTS, 1); } return (err); @@ -1994,7 +1994,7 @@ bridge_output(struct ifnet *ifp, struct } else { mc = m_copypacket(m, M_NOWAIT); if (mc == NULL) { - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -2084,8 +2084,8 @@ bridge_forward(struct bridge_softc *sc, src_if = m->m_pkthdr.rcvif; ifp = sc->sc_ifp; - ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); vlan = VLANTAGOF(m); if ((sbif->bif_flags & IFBIF_STP) && @@ -2137,7 +2137,7 @@ bridge_forward(struct bridge_softc *sc, goto drop; /* ...forward it to all interfaces. */ - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); dst_if = NULL; } @@ -2245,8 +2245,8 @@ bridge_input(struct ifnet *ifp, struct m if ((bifp->if_flags & IFF_MONITOR) != 0) { m->m_pkthdr.rcvif = bifp; ETHER_BPF_MTAP(bifp, m); - bifp->if_ipackets++; - bifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(bifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(bifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); m_freem(m); return (NULL); } @@ -2347,8 +2347,8 @@ bridge_input(struct ifnet *ifp, struct m ) { \ if ((iface)->if_type == IFT_BRIDGE) { \ ETHER_BPF_MTAP(iface, m); \ - iface->if_ipackets++; \ - iface->if_ibytes += m->m_pkthdr.len; \ + if_inc_counter(iface, IFCOUNTER_IPACKETS, 1); \ + if_inc_counter(iface, IFCOUNTER_IBYTES, m->m_pkthdr.len); \ /* Filter on the physical interface. */ \ if (pfil_local_phys && \ (PFIL_HOOKED(&V_inet_pfil_hook) \ @@ -2478,7 +2478,7 @@ bridge_broadcast(struct bridge_softc *sc } else { mc = m_dup(m, M_NOWAIT); if (mc == NULL) { - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -2498,7 +2498,7 @@ bridge_broadcast(struct bridge_softc *sc i = min(mc->m_pkthdr.len, max_protohdr); mc = m_copyup(mc, i, ETHER_ALIGN); if (mc == NULL) { - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -2541,7 +2541,7 @@ bridge_span(struct bridge_softc *sc, str mc = m_copypacket(m, M_NOWAIT); if (mc == NULL) { - sc->sc_ifp->if_oerrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); continue; } Modified: head/sys/net/if_disc.c ============================================================================== --- head/sys/net/if_disc.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_disc.c Fri Sep 19 10:39:58 2014 (r271867) @@ -174,8 +174,8 @@ discoutput(struct ifnet *ifp, struct mbu m->m_pkthdr.rcvif = ifp; - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); m_freem(m); return (0); Modified: head/sys/net/if_edsc.c ============================================================================== --- head/sys/net/if_edsc.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_edsc.c Fri Sep 19 10:39:58 2014 (r271867) @@ -291,8 +291,8 @@ edsc_start(struct ifnet *ifp) /* * Update the interface counters. */ - ifp->if_obytes += m->m_pkthdr.len; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* * Finally, just drop the packet. Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_epair.c Fri Sep 19 10:39:58 2014 (r271867) @@ -418,7 +418,7 @@ epair_start_locked(struct ifnet *ifp) */ if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (oifp->if_flags & IFF_UP) ==0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); continue; } @@ -434,15 +434,15 @@ epair_start_locked(struct ifnet *ifp) error = netisr_queue(NETISR_EPAIR, m); CURVNET_RESTORE(); if (!error) { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* Someone else received the packet. */ - oifp->if_ipackets++; + if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); } else { /* The packet was freed already. */ epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_OACTIVE; (void) epair_add_ifp_for_draining(ifp); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); EPAIR_REFCOUNT_RELEASE(&sc->refcount); EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, ("%s: ifp=%p sc->refcount not >= 1: %d", @@ -503,7 +503,7 @@ epair_transmit_locked(struct ifnet *ifp, oifp = sc->oifp; if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (oifp->if_flags & IFF_UP) ==0) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return (0); } @@ -517,12 +517,12 @@ epair_transmit_locked(struct ifnet *ifp, if (ALTQ_IS_ENABLED(&ifp->if_snd)) { ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error); if (error) - ifp->if_oqdrops++; + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); IF_UNLOCK(&ifp->if_snd); if (!error) { - ifp->if_obytes += len; + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); if (mflags & (M_BCAST|M_MCAST)) - ifp->if_omcasts++; + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) epair_start_locked(ifp); @@ -556,22 +556,22 @@ epair_transmit_locked(struct ifnet *ifp, error = netisr_queue(NETISR_EPAIR, m); CURVNET_RESTORE(); if (!error) { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* * IFQ_HANDOFF_ADJ/ip_handoff() update statistics, * but as we bypass all this we have to duplicate * the logic another time. */ - ifp->if_obytes += len; + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); if (mflags & (M_BCAST|M_MCAST)) - ifp->if_omcasts++; + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); /* Someone else received the packet. */ - oifp->if_ipackets++; + if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); } else { /* The packet was freed already. */ epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); EPAIR_REFCOUNT_RELEASE(&sc->refcount); EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1, ("%s: ifp=%p sc->refcount not >= 1: %d", Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_ethersubr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -306,7 +306,7 @@ ether_output(struct ifnet *ifp, struct m update_mbuf_csumflags(m, n); (void)if_simloop(ifp, n, dst->sa_family, hlen); } else - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); } else if (bcmp(eh->ether_dhost, eh->ether_shost, ETHER_ADDR_LEN) == 0) { update_mbuf_csumflags(m, m); @@ -404,7 +404,7 @@ ether_input_internal(struct ifnet *ifp, */ if ((m->m_flags & M_PKTHDR) == 0) { if_printf(ifp, "discard frame w/o packet header\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } @@ -413,7 +413,7 @@ ether_input_internal(struct ifnet *ifp, if_printf(ifp, "discard frame w/o leading ethernet " "header (len %u pkt len %u)\n", m->m_len, m->m_pkthdr.len); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } @@ -421,7 +421,7 @@ ether_input_internal(struct ifnet *ifp, etype = ntohs(eh->ether_type); if (m->m_pkthdr.rcvif == NULL) { if_printf(ifp, "discard frame w/o interface pointer\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } @@ -439,7 +439,7 @@ ether_input_internal(struct ifnet *ifp, m->m_flags |= M_BCAST; else m->m_flags |= M_MCAST; - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); } #ifdef MAC @@ -466,7 +466,7 @@ ether_input_internal(struct ifnet *ifp, } if (!(ifp->if_capenable & IFCAP_HWSTATS)) - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); /* Allow monitor mode to claim this frame, after stats are updated. */ if (ifp->if_flags & IFF_MONITOR) { @@ -502,7 +502,7 @@ ether_input_internal(struct ifnet *ifp, #ifdef DIAGNOSTIC if_printf(ifp, "cannot pullup VLAN header\n"); #endif - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); CURVNET_RESTORE(); return; @@ -715,7 +715,7 @@ ether_demux(struct ifnet *ifp, struct mb if ((m->m_flags & M_VLANTAG) && EVL_VLANOFTAG(m->m_pkthdr.ether_vtag) != 0) { if (ifp->if_vlantrunk == NULL) { - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); m_freem(m); return; } Modified: head/sys/net/if_faith.c ============================================================================== --- head/sys/net/if_faith.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_faith.c Fri Sep 19 10:39:58 2014 (r271867) @@ -211,8 +211,8 @@ faithoutput(struct ifnet *ifp, struct mb return (rt->rt_flags & RTF_BLACKHOLE ? 0 : rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); } - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); switch (af) { #ifdef INET case AF_INET: @@ -232,8 +232,8 @@ faithoutput(struct ifnet *ifp, struct mb /* XXX do we need more sanity checks? */ m->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); netisr_dispatch(isr, m); return (0); } Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_fddisubr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -288,12 +288,12 @@ fddi_output(struct ifnet *ifp, struct mb error = (ifp->if_transmit)(ifp, m); if (error) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (error); bad: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (m) m_freem(m); return (error); @@ -317,20 +317,20 @@ fddi_input(ifp, m) */ if ((m->m_flags & M_PKTHDR) == 0) { if_printf(ifp, "discard frame w/o packet header\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } if (m->m_pkthdr.rcvif == NULL) { if_printf(ifp, "discard frame w/o interface pointer\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } m = m_pullup(m, FDDI_HDR_LEN); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto dropanyway; } fh = mtod(m, struct fddi_header *); @@ -362,7 +362,7 @@ fddi_input(ifp, m) /* * Update interface statistics. */ - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); getmicrotime(&ifp->if_lastchange); /* @@ -383,7 +383,7 @@ fddi_input(ifp, m) m->m_flags |= M_BCAST; else m->m_flags |= M_MCAST; - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); } #ifdef M_LINK0 @@ -401,7 +401,7 @@ fddi_input(ifp, m) m = m_pullup(m, LLC_SNAPFRAMELEN); if (m == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto dropanyway; } l = mtod(m, struct llc *); @@ -412,13 +412,13 @@ fddi_input(ifp, m) u_int16_t type; if ((l->llc_control != LLC_UI) || (l->llc_ssap != LLC_SNAP_LSAP)) { - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; } if (l->llc_snap.org_code[0] != 0 || l->llc_snap.org_code[1] != 0 || l->llc_snap.org_code[2] != 0) { - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; } @@ -451,7 +451,7 @@ fddi_input(ifp, m) #endif default: /* printf("fddi_input: unknown protocol 0x%x\n", type); */ - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; } break; @@ -459,7 +459,7 @@ fddi_input(ifp, m) default: /* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */ - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; } M_SETFIB(m, ifp->if_fib); @@ -467,7 +467,7 @@ fddi_input(ifp, m) return; dropanyway: - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); if (m) m_freem(m); return; Modified: head/sys/net/if_fwsubr.c ============================================================================== --- head/sys/net/if_fwsubr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_fwsubr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -537,7 +537,7 @@ firewire_input(struct ifnet *ifp, struct if (m->m_pkthdr.rcvif == NULL) { if_printf(ifp, "discard frame w/o interface pointer\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } @@ -582,7 +582,7 @@ firewire_input(struct ifnet *ifp, struct return; } - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); /* Discard packet if interface is not up */ if ((ifp->if_flags & IFF_UP) == 0) { @@ -591,7 +591,7 @@ firewire_input(struct ifnet *ifp, struct } if (m->m_flags & (M_BCAST|M_MCAST)) - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); switch (type) { #ifdef INET Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_gif.c Fri Sep 19 10:39:58 2014 (r271867) @@ -377,10 +377,10 @@ gif_start(struct ifnet *ifp) af = AF_LINK; BPF_MTAP2(ifp, &af, sizeof(af), m); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* Done by IFQ_HANDOFF */ -/* ifp->if_obytes += m->m_pkthdr.len;*/ +/* if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);*/ /* override to IPPROTO_ETHERIP for bridged traffic */ M_SETFIB(m, sc->gif_fibnum); @@ -403,7 +403,7 @@ gif_start(struct ifnet *ifp) error = ENETDOWN; } if (error) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -513,7 +513,7 @@ gif_output(struct ifnet *ifp, struct mbu IFQ_HANDOFF(ifp, m, error); end: if (error) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (error); } @@ -544,8 +544,8 @@ gif_input(struct mbuf *m, int af, struct } if ((ifp->if_flags & IFF_MONITOR) != 0) { - ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); m_freem(m); return; } @@ -583,7 +583,7 @@ gif_input(struct mbuf *m, int af, struct if (n > m->m_len) { m = m_pullup(m, n); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } } @@ -622,7 +622,7 @@ gif_input(struct mbuf *m, int af, struct m->m_flags |= M_BCAST; else m->m_flags |= M_MCAST; - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); } BRIDGE_INPUT(ifp, m); @@ -647,8 +647,8 @@ gif_input(struct mbuf *m, int af, struct return; } - ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_gre.c Fri Sep 19 10:39:58 2014 (r271867) @@ -361,7 +361,7 @@ gre_output(struct ifnet *ifp, struct mbu * be encapsulated. */ if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); error = EINVAL; /* is there better errno? */ goto end; @@ -390,7 +390,7 @@ gre_output(struct ifnet *ifp, struct mbu if ((m->m_data - msiz) < m->m_pktdat) { m0 = m_gethdr(M_NOWAIT, MT_DATA); if (m0 == NULL) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); error = ENOBUFS; goto end; @@ -415,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbu memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz); ip->ip_len = htons(ntohs(ip->ip_len) + msiz); } else { /* AF_INET */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); error = EINVAL; goto end; @@ -440,7 +440,7 @@ gre_output(struct ifnet *ifp, struct mbu break; #endif default: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); error = EAFNOSUPPORT; goto end; @@ -452,14 +452,14 @@ gre_output(struct ifnet *ifp, struct mbu hdrlen += sizeof(uint32_t); M_PREPEND(m, hdrlen, M_NOWAIT); } else { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); error = EINVAL; goto end; } if (m == NULL) { /* mbuf allocation failed */ - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); error = ENOBUFS; goto end; } @@ -494,8 +494,8 @@ gre_output(struct ifnet *ifp, struct mbu gh->gi_len = htons(m->m_pkthdr.len); } - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); /* * Send it off and with IP_FORWARD flag to prevent it from * overwriting the ip_id again. ip_id is already set to the @@ -505,7 +505,7 @@ gre_output(struct ifnet *ifp, struct mbu (struct ip_moptions *)NULL, (struct inpcb *)NULL); end: if (error) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (error); } Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_iso88025subr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -381,12 +381,12 @@ iso88025_output(struct ifnet *ifp, struc IFQ_HANDOFF_ADJ(ifp, m, ISO88025_HDR_LEN + LLC_SNAPFRAMELEN, error); if (error) { printf("iso88025_output: packet dropped QFULL.\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } return (error); bad: - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); if (m) m_freem(m); return (error); @@ -411,20 +411,20 @@ iso88025_input(ifp, m) */ if ((m->m_flags & M_PKTHDR) == 0) { if_printf(ifp, "discard frame w/o packet header\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } if (m->m_pkthdr.rcvif == NULL) { if_printf(ifp, "discard frame w/o interface pointer\n"); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); return; } m = m_pullup(m, ISO88025_HDR_LEN); if (m == NULL) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto dropanyway; } th = mtod(m, struct iso88025_header *); @@ -456,7 +456,7 @@ iso88025_input(ifp, m) /* * Update interface statistics. */ - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); getmicrotime(&ifp->if_lastchange); /* @@ -478,7 +478,7 @@ iso88025_input(ifp, m) m->m_flags |= M_BCAST; else m->m_flags |= M_MCAST; - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); } mac_hdr_len = ISO88025_HDR_LEN; @@ -491,7 +491,7 @@ iso88025_input(ifp, m) m = m_pullup(m, LLC_SNAPFRAMELEN); if (m == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); goto dropanyway; } l = mtod(m, struct llc *); @@ -501,14 +501,14 @@ iso88025_input(ifp, m) u_int16_t type; if ((l->llc_control != LLC_UI) || (l->llc_ssap != LLC_SNAP_LSAP)) { - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; } if (l->llc_snap.org_code[0] != 0 || l->llc_snap.org_code[1] != 0 || l->llc_snap.org_code[2] != 0) { - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; } @@ -537,7 +537,7 @@ iso88025_input(ifp, m) #endif /* INET6 */ default: printf("iso88025_input: unexpected llc_snap ether_type 0x%02x\n", type); - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; } break; @@ -546,7 +546,7 @@ iso88025_input(ifp, m) case LLC_ISO_LSAP: switch (l->llc_control) { case LLC_UI: - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; break; case LLC_XID: @@ -595,7 +595,7 @@ iso88025_input(ifp, m) } default: printf("iso88025_input: unexpected llc control 0x%02x\n", l->llc_control); - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; break; } @@ -603,7 +603,7 @@ iso88025_input(ifp, m) #endif /* ISO */ default: printf("iso88025_input: unknown dsap 0x%x\n", l->llc_dsap); - ifp->if_noproto++; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto dropanyway; break; } @@ -613,7 +613,7 @@ iso88025_input(ifp, m) return; dropanyway: - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); if (m) m_freem(m); return; Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_loop.c Fri Sep 19 10:39:58 2014 (r271867) @@ -226,8 +226,8 @@ looutput(struct ifnet *ifp, struct mbuf rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH); } - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); /* BPF writes need to be handled specially. */ if (dst->sa_family == AF_UNSPEC) @@ -358,8 +358,8 @@ if_simloop(struct ifnet *ifp, struct mbu m_freem(m); return (EAFNOSUPPORT); } - ifp->if_ipackets++; - ifp->if_ibytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); netisr_queue(isr, m); /* mbuf is free'd on failure. */ return (0); } Modified: head/sys/net/if_spppfr.c ============================================================================== --- head/sys/net/if_spppfr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_spppfr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -250,9 +250,9 @@ bad: m_freem (m); switch (proto) { default: - ++ifp->if_noproto; -drop: ++ifp->if_ierrors; - ++ifp->if_iqdrops; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); +drop: if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); m_freem (m); return; #ifdef INET @@ -394,7 +394,7 @@ void sppp_fr_keepalive (struct sppp *sp) (u_char) sp->pp_rseq[IDX_LCP]); if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3)) - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* @@ -508,7 +508,7 @@ static void sppp_fr_arp (struct sppp *sp reply->ptarget2 = htonl (his_ip_address) >> 16; if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3)) - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Fri Sep 19 10:35:56 2014 (r271866) +++ head/sys/net/if_spppsubr.c Fri Sep 19 10:39:58 2014 (r271867) @@ -518,7 +518,7 @@ sppp_input(struct ifnet *ifp, struct mbu if (ifp->if_flags & IFF_UP) /* Count received bytes, add FCS and one flag */ - ifp->if_ibytes += m->m_pkthdr.len + 3; + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len + 3); if (m->m_pkthdr.len <= PPP_HEADER_LEN) { /* Too small packet, drop it. */ @@ -530,8 +530,8 @@ sppp_input(struct ifnet *ifp, struct mbu m_freem (m); SPPP_UNLOCK(sp); drop2: - ++ifp->if_ierrors; - ++ifp->if_iqdrops; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return; } @@ -570,7 +570,7 @@ sppp_input(struct ifnet *ifp, struct mbu sppp_cp_send (sp, PPP_LCP, PROTO_REJ, ++sp->pp_seq[IDX_LCP], m->m_pkthdr.len + 2, &h->protocol); - ++ifp->if_noproto; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto drop; case PPP_LCP: sppp_cp_input(&lcp, sp, m); @@ -682,7 +682,7 @@ sppp_input(struct ifnet *ifp, struct mbu } switch (ntohs (h->protocol)) { default: - ++ifp->if_noproto; + if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1); goto invalid; case CISCO_KEEPALIVE: sppp_cisco_input (sp, m); @@ -906,7 +906,7 @@ sppp_output(struct ifnet *ifp, struct mb nobufs: if (debug) log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n", SPP_ARGS(ifp)); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); SPPP_UNLOCK(sp); return (ENOBUFS); } @@ -966,7 +966,7 @@ nobufs: if (debug) #endif default: m_freem (m); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); SPPP_UNLOCK(sp); return (EAFNOSUPPORT); } @@ -981,7 +981,7 @@ out: else IFQ_HANDOFF_ADJ(ifp, m, 3, error); if (error) { - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); SPPP_UNLOCK(sp); return (rv? rv: ENOBUFS); } @@ -1393,7 +1393,7 @@ sppp_cisco_send(struct sppp *sp, int typ (u_long)ch->par2, (u_int)ch->rel, (u_int)ch->time0, (u_int)ch->time1); if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3)) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* @@ -1442,7 +1442,7 @@ sppp_cp_send(struct sppp *sp, u_short pr log(-1, ">\n"); } if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3)) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* @@ -1484,7 +1484,7 @@ sppp_cp_input(const struct cp *cp, struc log(-1, SPP_FMT "%s invalid conf-req length %d\n", SPP_ARGS(ifp), cp->name, len); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } /* handle states where RCR doesn't get a SCA/SCN */ @@ -1540,7 +1540,7 @@ sppp_cp_input(const struct cp *cp, struc SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case CONF_ACK: @@ -1549,7 +1549,7 @@ sppp_cp_input(const struct cp *cp, struc log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n", SPP_ARGS(ifp), cp->name, h->ident, sp->confid[cp->protoidx]); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } switch (sp->state[cp->protoidx]) { @@ -1584,7 +1584,7 @@ sppp_cp_input(const struct cp *cp, struc SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case CONF_NAK: @@ -1594,7 +1594,7 @@ sppp_cp_input(const struct cp *cp, struc log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n", SPP_ARGS(ifp), cp->name, h->ident, sp->confid[cp->protoidx]); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); break; } if (h->type == CONF_NAK) @@ -1634,7 +1634,7 @@ sppp_cp_input(const struct cp *cp, struc SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; @@ -1667,7 +1667,7 @@ sppp_cp_input(const struct cp *cp, struc SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case TERM_ACK: @@ -1698,7 +1698,7 @@ sppp_cp_input(const struct cp *cp, struc SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; case CODE_REJ: @@ -1725,7 +1725,7 @@ sppp_cp_input(const struct cp *cp, struc SPP_ARGS(ifp), cp->name, sppp_cp_type_name(h->type), sppp_state_name(sp->state[cp->protoidx])); - ++ifp->if_ierrors; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 11:02:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0928D6E9; Fri, 19 Sep 2014 11:02:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDE2A270; Fri, 19 Sep 2014 11:02:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JB2jKD056364; Fri, 19 Sep 2014 11:02:45 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JB2jmI056360; Fri, 19 Sep 2014 11:02:45 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409191102.s8JB2jmI056360@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Fri, 19 Sep 2014 11:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271868 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 11:02:46 -0000 Author: dumbbell Date: Fri Sep 19 11:02:44 2014 New Revision: 271868 URL: http://svnweb.freebsd.org/changeset/base/271868 Log: vt(4): Remove vt_buf->vb_dirtymask This structure and the associated functions were unused since the implementation of vd_bitblt_text_t callbacks. MFC after: 3 days Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_buf.c head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri Sep 19 10:39:58 2014 (r271867) +++ head/sys/dev/vt/vt.h Fri Sep 19 11:02:44 2014 (r271868) @@ -172,11 +172,6 @@ struct vt_device { * been modified. */ -struct vt_bufmask { - uint64_t vbm_row, vbm_col; -#define VBM_DIRTY UINT64_MAX -}; - struct vt_buf { struct mtx vb_lock; /* Buffer lock. */ term_pos_t vb_scr_size; /* (b) Screen dimensions. */ @@ -195,7 +190,6 @@ struct vt_buf { term_pos_t vb_mark_end; /* (b) Copy region end. */ int vb_mark_last; /* Last mouse event. */ term_rect_t vb_dirtyrect; /* (b) Dirty rectangle. */ - struct vt_bufmask vb_dirtymask; /* (b) Dirty bitmasks. */ term_char_t *vb_buffer; /* (u) Data buffer. */ term_char_t **vb_rows; /* (u) Array of rows */ }; @@ -209,7 +203,7 @@ void vtbuf_putchar(struct vt_buf *, cons void vtbuf_cursor_position(struct vt_buf *, const term_pos_t *); void vtbuf_scroll_mode(struct vt_buf *vb, int yes); void vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area); -void vtbuf_undirty(struct vt_buf *, term_rect_t *, struct vt_bufmask *); +void vtbuf_undirty(struct vt_buf *, term_rect_t *); void vtbuf_sethistory_size(struct vt_buf *, int); int vtbuf_iscursor(const struct vt_buf *vb, int row, int col); void vtbuf_cursor_visibility(struct vt_buf *, int); Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Fri Sep 19 10:39:58 2014 (r271867) +++ head/sys/dev/vt/vt_buf.c Fri Sep 19 11:02:44 2014 (r271868) @@ -195,39 +195,6 @@ vtbuf_iscursor(const struct vt_buf *vb, return (0); } -static inline uint64_t -vtbuf_dirty_axis(unsigned int begin, unsigned int end) -{ - uint64_t left, right, mask; - - /* - * Mark all bits between begin % 64 and end % 64 dirty. - * This code is functionally equivalent to: - * - * for (i = begin; i < end; i++) - * mask |= (uint64_t)1 << (i % 64); - */ - - /* Obvious case. Mark everything dirty. */ - if (end - begin >= 64) - return (VBM_DIRTY); - - /* 1....0; used bits on the left. */ - left = VBM_DIRTY << begin % 64; - /* 0....1; used bits on the right. */ - right = VBM_DIRTY >> -end % 64; - - /* - * Only take the intersection. If the result of that is 0, it - * means that the selection crossed a 64 bit boundary along the - * way, which means we have to take the complement. - */ - mask = left & right; - if (mask == 0) - mask = left | right; - return (mask); -} - static inline void vtbuf_dirty_locked(struct vt_buf *vb, const term_rect_t *area) { @@ -240,10 +207,6 @@ vtbuf_dirty_locked(struct vt_buf *vb, co vb->vb_dirtyrect.tr_end.tp_row = area->tr_end.tp_row; if (vb->vb_dirtyrect.tr_end.tp_col < area->tr_end.tp_col) vb->vb_dirtyrect.tr_end.tp_col = area->tr_end.tp_col; - vb->vb_dirtymask.vbm_row |= - vtbuf_dirty_axis(area->tr_begin.tp_row, area->tr_end.tp_row); - vb->vb_dirtymask.vbm_col |= - vtbuf_dirty_axis(area->tr_begin.tp_col, area->tr_end.tp_col); } void @@ -272,16 +235,14 @@ vtbuf_make_undirty(struct vt_buf *vb) vb->vb_dirtyrect.tr_begin = vb->vb_scr_size; vb->vb_dirtyrect.tr_end.tp_row = vb->vb_dirtyrect.tr_end.tp_col = 0; - vb->vb_dirtymask.vbm_row = vb->vb_dirtymask.vbm_col = 0; } void -vtbuf_undirty(struct vt_buf *vb, term_rect_t *r, struct vt_bufmask *m) +vtbuf_undirty(struct vt_buf *vb, term_rect_t *r) { VTBUF_LOCK(vb); *r = vb->vb_dirtyrect; - *m = vb->vb_dirtymask; vtbuf_make_undirty(vb); VTBUF_UNLOCK(vb); } Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Sep 19 10:39:58 2014 (r271867) +++ head/sys/dev/vt/vt_core.c Fri Sep 19 11:02:44 2014 (r271868) @@ -992,7 +992,6 @@ vt_flush(struct vt_device *vd) { struct vt_window *vw; struct vt_font *vf; - struct vt_bufmask tmask; term_rect_t tarea; term_pos_t size; #ifndef SC_NO_CUTPASTE @@ -1048,14 +1047,13 @@ vt_flush(struct vt_device *vd) vt_mark_mouse_position_as_dirty(vd); #endif - vtbuf_undirty(&vw->vw_buf, &tarea, &tmask); + vtbuf_undirty(&vw->vw_buf, &tarea); vt_termsize(vd, vf, &size); /* Force a full redraw when the screen contents are invalid. */ if (vd->vd_flags & VDF_INVALID) { tarea.tr_begin.tp_row = tarea.tr_begin.tp_col = 0; tarea.tr_end = size; - tmask.vbm_row = tmask.vbm_col = VBM_DIRTY; vd->vd_flags &= ~VDF_INVALID; } From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 11:15:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33DD291B; Fri, 19 Sep 2014 11:15:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F9DE38E; Fri, 19 Sep 2014 11:15:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JBFUkH061415; Fri, 19 Sep 2014 11:15:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JBFUPx061414; Fri, 19 Sep 2014 11:15:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409191115.s8JBFUPx061414@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 19 Sep 2014 11:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271869 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 11:15:31 -0000 Author: mav Date: Fri Sep 19 11:15:30 2014 New Revision: 271869 URL: http://svnweb.freebsd.org/changeset/base/271869 Log: Fix inverted expression to report block size in mode page block descriptor. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Sep 19 11:02:44 2014 (r271868) +++ head/sys/cam/ctl/ctl.c Fri Sep 19 11:15:30 2014 (r271869) @@ -7074,7 +7074,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) * descriptor. Otherwise, just set it to 0. */ if (dbd == 0) { - if (control_dev != 0) + if (control_dev == 0) scsi_ulto3b(lun->be_lun->blocksize, block_desc->block_len); else From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 11:49:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA57BFE3; Fri, 19 Sep 2014 11:49:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D59DD884; Fri, 19 Sep 2014 11:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JBnf3R075725; Fri, 19 Sep 2014 11:49:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JBnfmh075724; Fri, 19 Sep 2014 11:49:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409191149.s8JBnfmh075724@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 11:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271870 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 11:49:42 -0000 Author: glebius Date: Fri Sep 19 11:49:41 2014 New Revision: 271870 URL: http://svnweb.freebsd.org/changeset/base/271870 Log: - Provide igb_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Sep 19 11:15:30 2014 (r271869) +++ head/sys/dev/e1000/if_igb.c Fri Sep 19 11:49:41 2014 (r271870) @@ -204,6 +204,7 @@ static void igb_start(struct ifnet *); static void igb_start_locked(struct tx_ring *, struct ifnet *ifp); #endif static int igb_ioctl(struct ifnet *, u_long, caddr_t); +static uint64_t igb_get_counter(if_t, ift_counter); static void igb_init(void *); static void igb_init_locked(struct adapter *); static void igb_stop(void *); @@ -1045,9 +1046,9 @@ igb_mq_start_locked(struct ifnet *ifp, s } drbr_advance(ifp, txr->br); enq++; - ifp->if_obytes += next->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len); if (next->m_flags & M_MCAST) - ifp->if_omcasts++; + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; @@ -3211,6 +3212,7 @@ igb_setup_interface(device_t dev, struct ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = igb_ioctl; + ifp->if_get_counter = igb_get_counter; #ifndef IGB_LEGACY_TX ifp->if_transmit = igb_mq_start; ifp->if_qflush = igb_qflush; @@ -4127,7 +4129,7 @@ igb_txeof(struct tx_ring *txr) } ++txr->packets; ++processed; - ++ifp->if_opackets; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); txr->watchdog_time = ticks; /* Try the next packet */ @@ -5121,7 +5123,7 @@ igb_rxeof(struct igb_queue *que, int cou if (eop) { rxr->fmp->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); rxr->rx_packets++; /* capture data for AIM */ rxr->packets++; @@ -5548,6 +5550,30 @@ igb_led_func(void *arg, int onoff) IGB_CORE_UNLOCK(adapter); } +static uint64_t +igb_get_counter(if_t ifp, ift_counter cnt) +{ + struct adapter *adapter; + struct e1000_hw_stats *stats; + + adapter = if_getsoftc(ifp); + stats = (struct e1000_hw_stats *)adapter->stats; + + switch (cnt) { + case IFCOUNTER_IERRORS: + return (adapter->dropped_pkts + stats->rxerrc + + stats->crcerrs + stats->algnerrc + + stats->ruc + stats->roc + stats->mpc + stats->cexterr); + case IFCOUNTER_OERRORS: + return (stats->ecol + stats->latecol + + adapter->watchdog_events); + case IFCOUNTER_COLLISIONS: + return (stats->colc); + default: + return (if_get_counter_default(ifp, cnt)); + } +} + /********************************************************************** * * Update the board statistics counters. @@ -5556,7 +5582,6 @@ igb_led_func(void *arg, int onoff) static void igb_update_stats_counters(struct adapter *adapter) { - struct ifnet *ifp; struct e1000_hw *hw = &adapter->hw; struct e1000_hw_stats *stats; @@ -5674,18 +5699,6 @@ igb_update_stats_counters(struct adapter stats->tsctc += E1000_READ_REG(hw, E1000_TSCTC); stats->tsctfc += E1000_READ_REG(hw, E1000_TSCTFC); - ifp = adapter->ifp; - ifp->if_collisions = stats->colc; - - /* Rx Errors */ - ifp->if_ierrors = adapter->dropped_pkts + stats->rxerrc + - stats->crcerrs + stats->algnerrc + - stats->ruc + stats->roc + stats->mpc + stats->cexterr; - - /* Tx Errors */ - ifp->if_oerrors = stats->ecol + - stats->latecol + adapter->watchdog_events; - /* Driver specific counters */ adapter->device_control = E1000_READ_REG(hw, E1000_CTRL); adapter->rx_control = E1000_READ_REG(hw, E1000_RCTL); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 12:20:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECCAE61D; Fri, 19 Sep 2014 12:20:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD1A2B36; Fri, 19 Sep 2014 12:20:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JCKhaG090544; Fri, 19 Sep 2014 12:20:43 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JCKhra090542; Fri, 19 Sep 2014 12:20:43 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409191220.s8JCKhra090542@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Fri, 19 Sep 2014 12:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271871 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 12:20:44 -0000 Author: dumbbell Date: Fri Sep 19 12:20:43 2014 New Revision: 271871 URL: http://svnweb.freebsd.org/changeset/base/271871 Log: vt(4): Rewrite history scrolling It's now possible to scroll up the 500 hard-coded lines of history, not just a fraction of them. For instance, one can reach the top of the boot process. Sometimes, when scrolling or when changing the screen size (by changing the font or loading a KMS driver for instance), one could see the history cycling (old content appeared below latest lines). This is fixed. Now, when the resolution changes are more lines can be shown, the displayed area is adjusted so that, if the screen was filled with content before, it's filled with content after as well: more history is visible, instead of having blank lines below the previously visible content. MFC after: 3 days Modified: head/sys/dev/vt/vt_buf.c head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Fri Sep 19 11:49:41 2014 (r271870) +++ head/sys/dev/vt/vt_buf.c Fri Sep 19 12:20:43 2014 (r271871) @@ -76,44 +76,46 @@ vthistory_seek(struct vt_buf *vb, int of } return (0); /* No changes */ } - top = (vb->vb_flags & VBF_HISTORY_FULL)? - (vb->vb_curroffset + vb->vb_scr_size.tp_row):vb->vb_history_size; - bottom = vb->vb_curroffset + vb->vb_history_size; - /* - * Operate on copy of offset value, since it temporary can be bigger - * than amount of rows in buffer. - */ - roffset = vb->vb_roffset + vb->vb_history_size; + /* "top" may be a negative integer. */ + bottom = vb->vb_curroffset; + top = (vb->vb_flags & VBF_HISTORY_FULL) ? + bottom + vb->vb_scr_size.tp_row - vb->vb_history_size : + 0; + switch (whence) { case VHS_SET: - roffset = offset + vb->vb_history_size; + if (offset < 0) + offset = 0; + roffset = top + offset; break; case VHS_CUR: + /* + * Operate on copy of offset value, since it temporary + * can be bigger than amount of rows in buffer. + */ + roffset = vb->vb_roffset; + if (roffset >= bottom + vb->vb_scr_size.tp_row) + roffset -= vb->vb_history_size; + roffset += offset; + roffset = MAX(roffset, top); + roffset = MIN(roffset, bottom); + + if (roffset < 0) + roffset = vb->vb_history_size + roffset; + break; case VHS_END: /* Go to current offset. */ - roffset = vb->vb_curroffset + vb->vb_history_size; + roffset = vb->vb_curroffset; break; } - roffset = (roffset < top)?top:roffset; - roffset = (roffset > bottom)?bottom:roffset; - - roffset %= vb->vb_history_size; + diff = vb->vb_roffset != roffset; + vb->vb_roffset = roffset; - if (vb->vb_roffset != roffset) { - diff = vb->vb_roffset - roffset; - vb->vb_roffset = roffset; - /* - * Offset changed, please update Nth lines on sceen. - * +N - Nth lines at top; - * -N - Nth lines at bottom. - */ - return (diff); - } - return (0); /* No changes */ + return (diff); } void @@ -123,6 +125,8 @@ vthistory_addlines(struct vt_buf *vb, in vb->vb_curroffset += offset; if (vb->vb_curroffset < 0) vb->vb_curroffset = 0; + if (vb->vb_curroffset + vb->vb_scr_size.tp_row >= vb->vb_history_size) + vb->vb_flags |= VBF_HISTORY_FULL; vb->vb_curroffset %= vb->vb_history_size; if ((vb->vb_flags & VBF_SCROLL) == 0) { vb->vb_roffset = vb->vb_curroffset; @@ -414,71 +418,155 @@ vtbuf_sethistory_size(struct vt_buf *vb, void vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, unsigned int history_size) { - term_char_t *old, *new, **rows, **oldrows, **copyrows, *row; - int bufsize, rowssize, w, h, c, r; + term_char_t *old, *new, **rows, **oldrows, **copyrows, *row, *oldrow; + int bufsize, rowssize, w, h, c, r, history_was_full; + unsigned int old_history_size; term_rect_t rect; history_size = MAX(history_size, p->tp_row); - /* If new screen/history size bigger or buffer is VBF_STATIC. */ - if ((history_size > vb->vb_history_size) || (p->tp_col > - vb->vb_scr_size.tp_col) || (vb->vb_flags & VBF_STATIC)) { - /* Allocate new buffer. */ - bufsize = history_size * p->tp_col * sizeof(term_char_t); - new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO); - rowssize = history_size * sizeof(term_pos_t *); - rows = malloc(rowssize, M_VTBUF, M_WAITOK | M_ZERO); + /* Allocate new buffer. */ + bufsize = history_size * p->tp_col * sizeof(term_char_t); + new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO); + rowssize = history_size * sizeof(term_pos_t *); + rows = malloc(rowssize, M_VTBUF, M_WAITOK | M_ZERO); - /* Toggle it. */ - VTBUF_LOCK(vb); - old = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_buffer; - oldrows = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_rows; - copyrows = vb->vb_rows; - w = vb->vb_scr_size.tp_col; - h = vb->vb_history_size; - - vb->vb_history_size = history_size; - vb->vb_buffer = new; - vb->vb_rows = rows; - vb->vb_flags &= ~VBF_STATIC; - vb->vb_scr_size = *p; - vtbuf_init_rows(vb); + /* Toggle it. */ + VTBUF_LOCK(vb); + old = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_buffer; + oldrows = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_rows; + copyrows = vb->vb_rows; + + w = vb->vb_scr_size.tp_col; + h = vb->vb_scr_size.tp_row; + old_history_size = vb->vb_history_size; + history_was_full = vb->vb_flags & VBF_HISTORY_FULL; + + vb->vb_history_size = history_size; + vb->vb_buffer = new; + vb->vb_rows = rows; + vb->vb_flags &= ~VBF_STATIC; + vb->vb_scr_size = *p; + vtbuf_init_rows(vb); + + /* Copy history and fill extra space if needed. */ + if (history_size > old_history_size) { + /* + * Copy rows to the new buffer. The first row in the history + * is back to index 0, ie. the new buffer doesn't cycle. + * + * The rest of the new buffer is initialized with blank + * content. + */ + for (r = 0; r < old_history_size; r ++) { + row = rows[r]; + + /* Compute the corresponding row in the old buffer. */ + if (history_was_full) + /* + * The buffer is full, the "top" row is + * the one just after the viewable area + * (curroffset + viewable height) in the + * cycling buffer. The corresponding row + * is computed from this top row. + */ + oldrow = copyrows[ + (vb->vb_curroffset + h + r) % + old_history_size]; + else + /* + * The buffer is not full, therefore, + * we didn't cycle already. The + * corresponding rows are the same in + * both buffers. + */ + oldrow = copyrows[r]; + + memmove(row, oldrow, + MIN(p->tp_col, w) * sizeof(term_char_t)); - /* Copy history and fill extra space. */ - for (r = 0; r < history_size; r ++) { /* * XXX VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR) will * extended lines of kernel text using the wrong * background color. */ - row = rows[r]; - if (r < h) { /* Copy. */ - memmove(rows[r], copyrows[r], - MIN(p->tp_col, w) * sizeof(term_char_t)); - for (c = MIN(p->tp_col, w); c < p->tp_col; - c++) { - row[c] = VTBUF_SPACE_CHAR( - TERMINAL_NORM_ATTR); - } - } else { /* Just fill. */ - rect.tr_begin.tp_col = 0; - rect.tr_begin.tp_row = r; - rect.tr_end.tp_col = p->tp_col; - rect.tr_end.tp_row = p->tp_row; - vtbuf_fill(vb, &rect, - VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); - break; + for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { + row[c] = VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR); } } - vtbuf_make_undirty(vb); - VTBUF_UNLOCK(vb); - /* Deallocate old buffer. */ - free(old, M_VTBUF); - free(oldrows, M_VTBUF); + + /* Fill remaining rows. */ + rect.tr_begin.tp_col = 0; + rect.tr_begin.tp_row = old_history_size; + rect.tr_end.tp_col = p->tp_col; + rect.tr_end.tp_row = p->tp_row; + vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); + + vb->vb_flags &= ~VBF_HISTORY_FULL; } else { - /* Just update the size. */ - vb->vb_scr_size = *p; + /* + * Copy rows to the new buffer. The first row in the history + * is back to index 0, ie. the new buffer doesn't cycle. + * + * (old_history_size - history_size) lines of history are + * dropped. + */ + for (r = 0; r < history_size; r ++) { + row = rows[r]; + + /* + * Compute the corresponding row in the old buffer. + * + * See the equivalent if{} block above for an + * explanation. + */ + if (history_was_full) + oldrow = copyrows[ + (vb->vb_curroffset + h + r + + (old_history_size - history_size)) % + old_history_size]; + else + oldrow = copyrows[ + (r + (old_history_size - history_size)) % + old_history_size]; + + memmove(row, oldrow, + MIN(p->tp_col, w) * sizeof(term_char_t)); + + /* + * XXX VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR) will + * extended lines of kernel text using the wrong + * background color. + */ + for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { + row[c] = VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR); + } + } + + if (!history_was_full && + (vb->vb_curroffset + h) >= history_size) + vb->vb_flags |= VBF_HISTORY_FULL; } + + /* + * If the screen is already filled (there are non-visible lines + * above the current viewable area), adjust curroffset to the + * new viewable area. + */ + if (!history_was_full && vb->vb_curroffset > 0) { + vb->vb_curroffset = vb->vb_curroffset + h - p->tp_row; + if (vb->vb_curroffset < 0) + vb->vb_curroffset += vb->vb_history_size; + vb->vb_curroffset %= vb->vb_history_size; + vb->vb_roffset = vb->vb_curroffset; + } + + vtbuf_make_undirty(vb); + VTBUF_UNLOCK(vb); + + /* Deallocate old buffer. */ + free(old, M_VTBUF); + free(oldrows, M_VTBUF); } void Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Sep 19 11:49:41 2014 (r271870) +++ head/sys/dev/vt/vt_core.c Fri Sep 19 12:20:43 2014 (r271871) @@ -484,18 +484,8 @@ vt_scroll(struct vt_window *vw, int offs vt_termsize(vw->vw_device, vw->vw_font, &size); diff = vthistory_seek(&vw->vw_buf, offset, whence); - /* - * Offset changed, please update Nth lines on screen. - * +N - Nth lines at top; - * -N - Nth lines at bottom. - */ - - if (diff < -size.tp_row || diff > size.tp_row) { + if (diff) vw->vw_device->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vw->vw_device, 0); - return; - } - vw->vw_device->vd_flags |= VDF_INVALID; /*XXX*/ vt_resume_flush_timer(vw->vw_device, 0); } @@ -1181,6 +1171,13 @@ vtterm_cnprobe(struct terminal *tm, stru vt_compute_drawable_area(vw); } + /* + * The original screen size was faked (_VTDEFW x _VTDEFH). Now + * that we have the real viewable size, fix the it in the static + * buffer. + */ + vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); + vtbuf_init_early(&vw->vw_buf); vt_winsize(vd, vw->vw_font, &wsz); c = (boothowto & RB_MUTE) == 0 ? TERMINAL_KERN_ATTR : From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 12:38:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ADC6ABF; Fri, 19 Sep 2014 12:38:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA9F4CD3; Fri, 19 Sep 2014 12:38:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JCch0Z098797; Fri, 19 Sep 2014 12:38:43 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JCchmp098796; Fri, 19 Sep 2014 12:38:43 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409191238.s8JCchmp098796@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Fri, 19 Sep 2014 12:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271872 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 12:38:44 -0000 Author: dumbbell Date: Fri Sep 19 12:38:43 2014 New Revision: 271872 URL: http://svnweb.freebsd.org/changeset/base/271872 Log: vt(4): Remove superfluous word in comment Submitted by: brueffer@ MFC after: 3 days MFC with: 271871 Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Sep 19 12:20:43 2014 (r271871) +++ head/sys/dev/vt/vt_core.c Fri Sep 19 12:38:43 2014 (r271872) @@ -1173,7 +1173,7 @@ vtterm_cnprobe(struct terminal *tm, stru /* * The original screen size was faked (_VTDEFW x _VTDEFH). Now - * that we have the real viewable size, fix the it in the static + * that we have the real viewable size, fix it in the static * buffer. */ vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 13:55:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3921FCEC; Fri, 19 Sep 2014 13:55:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2469A797; Fri, 19 Sep 2014 13:55:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JDtTKq035787; Fri, 19 Sep 2014 13:55:29 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JDtTte035786; Fri, 19 Sep 2014 13:55:29 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409191355.s8JDtTte035786@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 19 Sep 2014 13:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271873 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 13:55:29 -0000 Author: smh Date: Fri Sep 19 13:55:28 2014 New Revision: 271873 URL: http://svnweb.freebsd.org/changeset/base/271873 Log: Fix static kernel build with options ZFS This was broken by r271802. MFC after: 1 week X-MFC-With: r271802 Sponsored by: Multiplay Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Sep 19 12:38:43 2014 (r271872) +++ head/sys/conf/files Fri Sep 19 13:55:28 2014 (r271873) @@ -111,6 +111,7 @@ cddl/compat/opensolaris/kern/opensolaris cddl/compat/opensolaris/kern/opensolaris_sunddi.c optional zfs compile-with "${ZFS_C}" # zfs specific cddl/compat/opensolaris/kern/opensolaris_acl.c optional zfs compile-with "${ZFS_C}" +cddl/compat/opensolaris/kern/opensolaris_dtrace.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_kobj.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_kstat.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_lookup.c optional zfs compile-with "${ZFS_C}" From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 14:48:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 448DBD91; Fri, 19 Sep 2014 14:48:57 +0000 (UTC) Received: from mail-in-05.arcor-online.net (mail-in-05.arcor-online.net [151.189.21.45]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx.arcor.de", Issuer "Thawte SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED47CCF7; Fri, 19 Sep 2014 14:48:56 +0000 (UTC) Received: from mail-in-03-z2.arcor-online.net (mail-in-03-z2.arcor-online.net [151.189.8.15]) by mx.arcor.de (Postfix) with ESMTP id DD105E3C88; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) Received: from mail-in-05.arcor-online.net (mail-in-05.arcor-online.net [151.189.21.45]) by mail-in-03-z2.arcor-online.net (Postfix) with ESMTP id D61C0562E91; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) X-Greylist: Passed host: 188.105.81.235 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-05.arcor-online.net 9C41EE3C88 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 X-Greylist: Passed host: 188.105.81.235 Received: from lorvorc.mips.inka.de (dslb-188-105-081-235.188.105.pools.vodafone-ip.de [188.105.81.235]) by mail-in-05.arcor-online.net (Postfix) with ESMTPS id 9C41EE3C88; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.14.9/8.14.7) with ESMTP id s8JEmlnV052801; Fri, 19 Sep 2014 16:48:47 +0200 (CEST) (envelope-from naddy@lorvorc.mips.inka.de) Received: (from naddy@localhost) by lorvorc.mips.inka.de (8.14.9/8.14.9/Submit) id s8JEmjlb052798; Fri, 19 Sep 2014 16:48:45 +0200 (CEST) (envelope-from naddy) From: Christian Weisgerber Message-Id: <201409191448.s8JEmjlb052798@lorvorc.mips.inka.de> To: jhay@meraka.org.za (John Hay) Subject: Re: svn commit: r269800 - stable/10/sbin/ping6 In-Reply-To: <20140915181126.GA22013@zibbi.meraka.csir.co.za> References: <53e8688f.2851.32479e23@svn.freebsd.org> <20140915181126.GA22013@zibbi.meraka.csir.co.za> Date: Fri, 19 Sep 2014 16:48:36 +0200 User-Agent: slrn/1.0.1 (FreeBSD) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, delphij@FreeBSD.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 14:48:57 -0000 In list.freebsd.svn.src.all, you wrote: > I have just upgraded one of my boxes to 10-stable and found one of my > scripts just hangs. I traced it to this change in ping6. If you do > "ping6 -c 3 ", ping6 will hang until you > ^C it. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193176 -- Christian "naddy" Weisgerber naddy@mips.inka.de From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 16:06:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB32B8D2; Fri, 19 Sep 2014 16:06:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C67A18BA; Fri, 19 Sep 2014 16:06:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JG6sdb096720; Fri, 19 Sep 2014 16:06:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JG6s69096715; Fri, 19 Sep 2014 16:06:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409191606.s8JG6s69096715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 19 Sep 2014 16:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271874 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 16:06:55 -0000 Author: hselasky Date: Fri Sep 19 16:06:54 2014 New Revision: 271874 URL: http://svnweb.freebsd.org/changeset/base/271874 Log: Add new USB IDs. PR: 193775 MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Sep 19 13:55:28 2014 (r271873) +++ head/sys/dev/usb/serial/u3g.c Fri Sep 19 16:06:54 2014 (r271874) @@ -242,6 +242,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), + U3G_DEV(HP, UN2420_QDL, 0), + U3G_DEV(HP, UN2420, 0), U3G_DEV(HUAWEI, E1401, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1402, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1403, U3GINIT_HUAWEI), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Sep 19 13:55:28 2014 (r271873) +++ head/sys/dev/usb/usbdevs Fri Sep 19 16:06:54 2014 (r271874) @@ -2229,6 +2229,8 @@ product HP 3300C 0x0205 ScanJet 3300C product HP CDW8200 0x0207 CD-Writer Plus 8200e product HP MMKEYB 0x020c Multimedia keyboard product HP 1220C 0x0212 DeskJet 1220C +product HP UN2420_QDL 0x241d UN2420 QDL Firmware Loader +product HP UN2420 0x251d UN2420 WWAN/GPS Module product HP 810C 0x0304 DeskJet 810C/812C product HP 4300C 0x0305 Scanjet 4300C product HP CDW4E 0x0307 CD-Writer+ CD-4e From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 16:23:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0FDDDE0; Fri, 19 Sep 2014 16:23:59 +0000 (UTC) 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 88A09AB6; Fri, 19 Sep 2014 16:23:59 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 103FAB94C; Fri, 19 Sep 2014 12:23:58 -0400 (EDT) From: John Baldwin To: Jean-Sebastien Pedron Subject: Re: svn commit: r271871 - head/sys/dev/vt Date: Fri, 19 Sep 2014 12:08:56 -0400 Message-ID: <22834020.0KE7Ifz8kz@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409191220.s8JCKhra090542@svn.freebsd.org> References: <201409191220.s8JCKhra090542@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 19 Sep 2014 12:23:58 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 16:23:59 -0000 On Friday, September 19, 2014 12:20:43 PM Jean-Sebastien Pedron wrote: > Author: dumbbell > Date: Fri Sep 19 12:20:43 2014 > New Revision: 271871 > URL: http://svnweb.freebsd.org/changeset/base/271871 > > Log: > vt(4): Rewrite history scrolling > > It's now possible to scroll up the 500 hard-coded lines of history, not > just a fraction of them. For instance, one can reach the top of the boot > process. > > Sometimes, when scrolling or when changing the screen size (by changing > the font or loading a KMS driver for instance), one could see the > history cycling (old content appeared below latest lines). This is > fixed. > > Now, when the resolution changes are more lines can be shown, the > displayed area is adjusted so that, if the screen was filled with > content before, it's filled with content after as well: more history > is visible, instead of having blank lines below the previously visible > content. > > MFC after: 3 days Thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 16:24:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 141CEDE2; Fri, 19 Sep 2014 16:24:00 +0000 (UTC) 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 DF686AB7; Fri, 19 Sep 2014 16:23:59 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A2B62B97C; Fri, 19 Sep 2014 12:23:58 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r271864 - in head/sys: conf dev/mii dev/re dev/rl modules/rl pci Date: Fri, 19 Sep 2014 12:07:26 -0400 Message-ID: <4248629.XhysbtGMm9@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409191032.s8JAWKJA042104@svn.freebsd.org> References: <201409191032.s8JAWKJA042104@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 19 Sep 2014 12:23:58 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 16:24:00 -0000 On Friday, September 19, 2014 10:32:20 AM Gleb Smirnoff wrote: > Author: glebius > Date: Fri Sep 19 10:32:20 2014 > New Revision: 271864 > URL: http://svnweb.freebsd.org/changeset/base/271864 > > Log: > Move rl(4) to dev/rl. Thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 17:18:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BE40FE8; Fri, 19 Sep 2014 17:18:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1906FA7; Fri, 19 Sep 2014 17:18:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JHIRK7032278; Fri, 19 Sep 2014 17:18:27 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JHIRvW032274; Fri, 19 Sep 2014 17:18:27 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201409191718.s8JHIRvW032274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Fri, 19 Sep 2014 17:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271875 - in head/contrib/atf: . atf-c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 17:18:28 -0000 Author: rodrigc Date: Fri Sep 19 17:18:27 2014 New Revision: 271875 URL: http://svnweb.freebsd.org/changeset/base/271875 Log: Reference the test case "packs" to fix warnings Put the various atf_tc_pack_t variables generated by ATF_TC to use in the macros_h_test.c file so that we prevent some build warnings (and thus some build errors) with clang and -Wunused. Obtained from: atf (git 70126d013db25c72539803f19f7e00baddacdf51) Modified: head/contrib/atf/NEWS head/contrib/atf/atf-c/macros_h_test.c Modified: head/contrib/atf/NEWS ============================================================================== --- head/contrib/atf/NEWS Fri Sep 19 16:06:54 2014 (r271874) +++ head/contrib/atf/NEWS Fri Sep 19 17:18:27 2014 (r271875) @@ -14,6 +14,9 @@ the 'tools' directory for your own consu * Removed the deprecated tools. This includes atf-config, atf-report, atf-run and atf-version. +* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang + that ships with FreeBSD 11.0-CURRENT. + Changes in version 0.19 *********************** Modified: head/contrib/atf/atf-c/macros_h_test.c ============================================================================== --- head/contrib/atf/atf-c/macros_h_test.c Fri Sep 19 16:06:54 2014 (r271874) +++ head/contrib/atf/atf-c/macros_h_test.c Fri Sep 19 17:18:27 2014 (r271875) @@ -87,6 +87,7 @@ ATF_TC(TEST_MACRO_1); ATF_TC_HEAD(TEST_MACRO_1, tc) { if (tc != NULL) {} } ATF_TC_BODY(TEST_MACRO_1, tc) { if (tc != NULL) {} } atf_tc_t *test_name_1 = &ATF_TC_NAME(TEST_MACRO_1); +atf_tc_pack_t *test_pack_1 = &ATF_TC_PACK_NAME(TEST_MACRO_1); void (*head_1)(atf_tc_t *) = ATF_TC_HEAD_NAME(TEST_MACRO_1); void (*body_1)(const atf_tc_t *) = ATF_TC_BODY_NAME(TEST_MACRO_1); ATF_TC_WITH_CLEANUP(TEST_MACRO_2); @@ -94,10 +95,12 @@ ATF_TC_HEAD(TEST_MACRO_2, tc) { if (tc ! ATF_TC_BODY(TEST_MACRO_2, tc) { if (tc != NULL) {} } ATF_TC_CLEANUP(TEST_MACRO_2, tc) { if (tc != NULL) {} } atf_tc_t *test_name_2 = &ATF_TC_NAME(TEST_MACRO_2); +atf_tc_pack_t *test_pack_2 = &ATF_TC_PACK_NAME(TEST_MACRO_2); void (*head_2)(atf_tc_t *) = ATF_TC_HEAD_NAME(TEST_MACRO_2); void (*body_2)(const atf_tc_t *) = ATF_TC_BODY_NAME(TEST_MACRO_2); void (*cleanup_2)(const atf_tc_t *) = ATF_TC_CLEANUP_NAME(TEST_MACRO_2); ATF_TC_WITHOUT_HEAD(TEST_MACRO_3); ATF_TC_BODY(TEST_MACRO_3, tc) { if (tc != NULL) {} } atf_tc_t *test_name_3 = &ATF_TC_NAME(TEST_MACRO_3); +atf_tc_pack_t *test_pack_3 = &ATF_TC_PACK_NAME(TEST_MACRO_3); void (*body_3)(const atf_tc_t *) = ATF_TC_BODY_NAME(TEST_MACRO_3); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 17:23:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0048E1F4; Fri, 19 Sep 2014 17:23:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E05CBE1; Fri, 19 Sep 2014 17:23:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JHNiKL036301; Fri, 19 Sep 2014 17:23:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JHNilf036300; Fri, 19 Sep 2014 17:23:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409191723.s8JHNilf036300@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 19 Sep 2014 17:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271876 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 17:23:45 -0000 Author: gjb Date: Fri Sep 19 17:23:44 2014 New Revision: 271876 URL: http://svnweb.freebsd.org/changeset/base/271876 Log: When populating the dvd/packages/ directory, create a symlink to All/pkg-*.txz in the Latest/ directory. This allows 'pkg bootstrap' to work out-of-box if the REPOS_DIR environment is properly set. Tested on: stable/10@r271848 MFC after: 3 days X-MFC-10.1: yes Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/pkg-stage.sh Modified: head/release/scripts/pkg-stage.sh ============================================================================== --- head/release/scripts/pkg-stage.sh Fri Sep 19 17:18:27 2014 (r271875) +++ head/release/scripts/pkg-stage.sh Fri Sep 19 17:23:44 2014 (r271876) @@ -50,6 +50,12 @@ ${PKGCMD} -vv ${PKGCMD} update -f ${PKGCMD} fetch -o ${PKG_REPODIR} -d ${DVD_PACKAGES} +# Create the 'Latest/pkg.txz' symlink so 'pkg bootstrap' works +# using the on-disc packages. +mkdir -p ${PKG_REPODIR}/Latest +(cd ${PKG_REPODIR}/Latest && \ + ln -s ../All/$(${PKGCMD} rquery %n-%v pkg).txz pkg.txz) + ${PKGCMD} repo ${PKG_REPODIR} # Always exit '0', even if pkg(8) complains about conflicts. From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 17:32:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83F513F7; Fri, 19 Sep 2014 17:32:22 +0000 (UTC) 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 5A1F61BE; Fri, 19 Sep 2014 17:32:22 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E588AB982; Fri, 19 Sep 2014 13:32:20 -0400 (EDT) From: John Baldwin To: Steven Hartland Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Fri, 19 Sep 2014 12:34:15 -0400 Message-ID: <11362806.9nSfhFyLDg@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <5783417ED470465B9C816FCA02B3690D@multiplay.co.uk> References: <201409181655.s8IGtgft042984@svn.freebsd.org> <5783417ED470465B9C816FCA02B3690D@multiplay.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 19 Sep 2014 13:32:21 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Will Andrews X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 17:32:22 -0000 On Thursday, September 18, 2014 06:37:28 PM Steven Hartland wrote: > You don't need a seperate TUNABLE_INT declations any more since the > excellent SYSCTL refactor. That is my fault. I wasn't certain if SYSCTL_PROC() would work correctly when Will asked me on IRC, but it seems it does so long as the tunable type is one it knows how to parse (e.g. CTLTYPE_INT). If your sysctl wants a "blob" (CTLTYPE_OPAQUE or the like), then you still need your own tunable fetching handler. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 18:09:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E480D248; Fri, 19 Sep 2014 18:09:51 +0000 (UTC) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com [IPv6:2607:f8b0:400e:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A88BD76C; Fri, 19 Sep 2014 18:09:51 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id lf10so563869pab.8 for ; Fri, 19 Sep 2014 11:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=MTw48t+BFUPTFOh9cbtPvDNqEda5ANIpxublTB+ZmrQ=; b=zmEaXRC5BKr7PPwm6PKP8VuGALOtLS2IGcvxoJfaV0NK4QmQPBHVn9LCNAFOSpMgHz pASJs8akRv6u9KNXOTSqXO96TtaxuDC8YdWDdtCwAofS+SMeDXK8VBQHF9LGxgy/pnu4 1FInjuTfwGL/mi9spSRP0QwBy32lQdpk/pYrS2/b28fwZpqQmP7f628pXGxfTKNkHBZV cHP6vDs+LlaW4y3zbIzH6dv64+RELBhpv4KxZV/18agIL3zBbttmNLuz6zJo2zpH8ykr NfQjjFqMoWb65hFx4NkzRYoJ2dzBnCBNTMAm0uErsM+Ejr4Ma58RqdRxWGa2AMS6MDkk M23Q== X-Received: by 10.70.89.108 with SMTP id bn12mr3575605pdb.146.1411150190863; Fri, 19 Sep 2014 11:09:50 -0700 (PDT) Received: from [10.17.200.39] (mobile-166-137-212-080.mycingular.net. [166.137.212.80]) by mx.google.com with ESMTPSA id ks2sm2488611pdb.24.2014.09.19.11.09.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Sep 2014 11:09:50 -0700 (PDT) References: <201409191718.s8JHIRvW032274@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201409191718.s8JHIRvW032274@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: iPhone Mail (11D257) From: Garrett Cooper Subject: Re: svn commit: r271875 - in head/contrib/atf: . atf-c Date: Fri, 19 Sep 2014 11:09:45 -0700 To: Craig Rodrigues Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 18:09:52 -0000 > On Sep 19, 2014, at 10:18, Craig Rodrigues wrote: > > Author: rodrigc > Date: Fri Sep 19 17:18:27 2014 > New Revision: 271875 > URL: http://svnweb.freebsd.org/changeset/base/271875 > > Log: > Reference the test case "packs" to fix warnings > > Put the various atf_tc_pack_t variables generated by ATF_TC to use in > the macros_h_test.c file so that we prevent some build warnings (and > thus some build errors) with clang and -Wunused. > > Obtained from: atf (git 70126d013db25c72539803f19f7e00baddacdf51) > > Modified: > head/contrib/atf/NEWS > head/contrib/atf/atf-c/macros_h_test.c This should be MFCed to stable/10. Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 18:12:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 636F64D1; Fri, 19 Sep 2014 18:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F98D828; Fri, 19 Sep 2014 18:12:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JICl9H060153; Fri, 19 Sep 2014 18:12:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JICk1P060151; Fri, 19 Sep 2014 18:12:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409191812.s8JICk1P060151@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Sep 2014 18:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r271877 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 18:12:47 -0000 Author: jhb Date: Fri Sep 19 18:12:46 2014 New Revision: 271877 URL: http://svnweb.freebsd.org/changeset/base/271877 Log: Add Julien Charbon (jch@) as a source committer. Julien will continue working on improving concurrency in the network stack, especially for short-lived TCP connections. I will mentor Julien. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Sep 19 17:23:44 2014 (r271876) +++ svnadmin/conf/access Fri Sep 19 18:12:46 2014 (r271877) @@ -106,6 +106,7 @@ iwasaki jamie jasone jceel +jch jchandra jeff jfv Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Sep 19 17:23:44 2014 (r271876) +++ svnadmin/conf/mentors Fri Sep 19 18:12:46 2014 (r271877) @@ -20,6 +20,7 @@ edavis davidch eri gnn Co-mentor: thompsa ganbold stas jceel wkoszek Co-mentor: cognet +jch jhb jkh rwatson jonathan rwatson jwd rmacklem From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 18:13:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D997E733; Fri, 19 Sep 2014 18:13:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C55E383F; Fri, 19 Sep 2014 18:13:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JIDuIZ060329; Fri, 19 Sep 2014 18:13:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JIDu9R060328; Fri, 19 Sep 2014 18:13:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409191813.s8JIDu9R060328@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 19 Sep 2014 18:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271878 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 18:13:57 -0000 Author: pfg Date: Fri Sep 19 18:13:56 2014 New Revision: 271878 URL: http://svnweb.freebsd.org/changeset/base/271878 Log: unistd: drop argument names from setpgrp(3) prototype. They are useless and don't match the style of the header. While here adjust the comment with tabs. Suggested by: kevinlo Modified: head/include/unistd.h Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Fri Sep 19 18:12:46 2014 (r271877) +++ head/include/unistd.h Fri Sep 19 18:13:56 2014 (r271878) @@ -566,7 +566,7 @@ int setkey(const char *); int setlogin(const char *); int setloginclass(const char *); void *setmode(const char *); -int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ +int setpgrp(pid_t, pid_t); /* obsoleted by setpgid() */ void setproctitle(const char *_fmt, ...) __printf0like(1, 2); int setresgid(gid_t, gid_t, gid_t); int setresuid(uid_t, uid_t, uid_t); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 18:24:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31DF6A71; Fri, 19 Sep 2014 18:24:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0351593B; Fri, 19 Sep 2014 18:24:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JIO2OP065044; Fri, 19 Sep 2014 18:24:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JIO2o9065041; Fri, 19 Sep 2014 18:24:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409191824.s8JIO2o9065041@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 19 Sep 2014 18:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271879 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 18:24:03 -0000 Author: pfg Date: Fri Sep 19 18:24:02 2014 New Revision: 271879 URL: http://svnweb.freebsd.org/changeset/base/271879 Log: awk: Use random(3) instead of rand(3) While none of them is considered even near to cryptographic level, random(3) is a better random generator than rand(3). Use random(3) for awk as is done in other systems. Thanks to Chenguang Li for discussing this in the lists and submitting the patch upstream. PR: 193147 MFC after: 5 weeks Modified: head/contrib/one-true-awk/awk.1 head/contrib/one-true-awk/main.c head/contrib/one-true-awk/run.c Modified: head/contrib/one-true-awk/awk.1 ============================================================================== --- head/contrib/one-true-awk/awk.1 Fri Sep 19 18:13:56 2014 (r271878) +++ head/contrib/one-true-awk/awk.1 Fri Sep 19 18:24:02 2014 (r271879) @@ -208,7 +208,7 @@ or of if no argument. .TP .B rand -random number on (0,1) +random number on [0,1) .TP .B srand sets seed for Modified: head/contrib/one-true-awk/main.c ============================================================================== --- head/contrib/one-true-awk/main.c Fri Sep 19 18:13:56 2014 (r271878) +++ head/contrib/one-true-awk/main.c Fri Sep 19 18:24:02 2014 (r271879) @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) signal(SIGFPE, fpecatch); srand_seed = 1; - srand(srand_seed); + srandom((unsigned long) srand_seed); yyin = NULL; symtab = makesymtab(NSYMTAB/NSYMTAB); Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Fri Sep 19 18:13:56 2014 (r271878) +++ head/contrib/one-true-awk/run.c Fri Sep 19 18:24:02 2014 (r271879) @@ -1521,8 +1521,10 @@ Cell *bltin(Node **a, int n) /* builtin u = (Awkfloat) system(getsval(x)) / 256; /* 256 is unix-dep */ break; case FRAND: - /* in principle, rand() returns something in 0..RAND_MAX */ - u = (Awkfloat) (rand() % RAND_MAX) / RAND_MAX; + /* random() returns numbers in [0..2^31-1] + * in order to get a number in [0, 1), divide it by 2^31 + */ + u = (Awkfloat) random() / (0x7fffffffL + 0x1UL); break; case FSRAND: if (isrec(x)) /* no argument provided */ @@ -1530,7 +1532,7 @@ Cell *bltin(Node **a, int n) /* builtin else u = getfval(x); tmp = u; - srand((unsigned int) u); + srandom((unsigned long) u); u = srand_seed; srand_seed = tmp; break; From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 18:43:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23ED94C2 for ; Fri, 19 Sep 2014 18:43:17 +0000 (UTC) Received: from mail-qc0-f171.google.com (mail-qc0-f171.google.com [209.85.216.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7204B1F for ; Fri, 19 Sep 2014 18:43:16 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id x3so3598576qcv.16 for ; Fri, 19 Sep 2014 11:43:10 -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:date :message-id:subject:from:to:cc:content-type; bh=hNfiSpbt+5iJ6mVTJ/RtQVzKRH1VrBZUSMeqWDn6v68=; b=Qv4L6DdPFJ+q6r0Gu3dT9HHH3ubM4SyKuIl4dMF4Al5ezala05pwiQSXMnxRg7sx71 ku1zV/Ref7AOTZmJAexUCdBknZHZ9xKnRQmiZyFsm2xNvWTSNUzAevAYwx3LOwvVyqa8 SiKByCCjro62Q9DOFrHaSV87sZ1pO9T/lPNjEmSPcqQsR3d3nm+ntZdcISRMTyFDBmQB 78pxioC5VE++2AyoWushxLm57vhcxYh7HOMnOkOfNmk/gjBi07isPORkay6SVXMYRShI vhZP0fkGx9lgGlO+pyQAOjFHhHruLcxoK3wDH4MEZhH03YuScweFhz7pJZM636Us9sJM k/jw== X-Gm-Message-State: ALoCoQlbpVpiwgZ1y9jzijhXcXXfDOP5MSGx2KlxHwT6TaYVCseQ+B9WxuODsPWUVIJpyuvt/kWw MIME-Version: 1.0 X-Received: by 10.224.4.72 with SMTP id 8mr2500066qaq.79.1411148135880; Fri, 19 Sep 2014 10:35:35 -0700 (PDT) Received: by 10.140.16.183 with HTTP; Fri, 19 Sep 2014 10:35:35 -0700 (PDT) In-Reply-To: <11362806.9nSfhFyLDg@ralph.baldwin.cx> References: <201409181655.s8IGtgft042984@svn.freebsd.org> <5783417ED470465B9C816FCA02B3690D@multiplay.co.uk> <11362806.9nSfhFyLDg@ralph.baldwin.cx> Date: Fri, 19 Sep 2014 11:35:35 -0600 Message-ID: Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Will Andrews To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" , Steven Hartland X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 18:43:17 -0000 I found that neither TUNABLE_INT nor CTLFLAG_RWTUN work with this particular implementation of the tunable, so there is a regression that needs to be fixed (i.e. vfs.zfs.debug_flags always comes up 0 no matter what's in loader.conf). I believe it's limited to this particular tunable, however, because I tested another SYSCTL_PROC that had CTLFLAG_TUN set and it worked. --Will. On Fri, Sep 19, 2014 at 10:34 AM, John Baldwin wrote: > On Thursday, September 18, 2014 06:37:28 PM Steven Hartland wrote: >> You don't need a seperate TUNABLE_INT declations any more since the >> excellent SYSCTL refactor. > > That is my fault. I wasn't certain if SYSCTL_PROC() would work correctly when > Will asked me on IRC, but it seems it does so long as the tunable type is one > it knows how to parse (e.g. CTLTYPE_INT). If your sysctl wants a "blob" > (CTLTYPE_OPAQUE or the like), then you still need your own tunable fetching > handler. > > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 21:30:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA2FA405; Fri, 19 Sep 2014 21:30:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4788D6F; Fri, 19 Sep 2014 21:30:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JLUkif054183; Fri, 19 Sep 2014 21:30:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JLUjvo054179; Fri, 19 Sep 2014 21:30:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409192130.s8JLUjvo054179@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 19 Sep 2014 21:30: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: r271880 - in stable/10/sys/boot: amd64/efi efi/libefi i386/libi386 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 21:30:46 -0000 Author: emaste Date: Fri Sep 19 21:30:45 2014 New Revision: 271880 URL: http://svnweb.freebsd.org/changeset/base/271880 Log: MFC r271475 by ambrisko: Add support for serial and null console to UEFI boot loader. Approved by: re Modified: stable/10/sys/boot/amd64/efi/bootinfo.c stable/10/sys/boot/amd64/efi/conf.c stable/10/sys/boot/efi/libefi/Makefile stable/10/sys/boot/i386/libi386/comconsole.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- stable/10/sys/boot/amd64/efi/bootinfo.c Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/amd64/efi/bootinfo.c Fri Sep 19 21:30:45 2014 (r271880) @@ -60,6 +60,7 @@ bi_getboothowto(char *kargs) { const char *sw; char *opts; + char *console; int howto, i; howto = 0; @@ -70,6 +71,14 @@ bi_getboothowto(char *kargs) howto |= howto_names[i].mask; } + console = getenv("console"); + if (console != NULL) { + if (strcmp(console, "comconsole") == 0) + howto |= RB_SERIAL; + if (strcmp(console, "nullconsole") == 0) + howto |= RB_MUTE; + } + /* Parse kargs */ if (kargs == NULL) return (howto); Modified: stable/10/sys/boot/amd64/efi/conf.c ============================================================================== --- stable/10/sys/boot/amd64/efi/conf.c Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/amd64/efi/conf.c Fri Sep 19 21:30:45 2014 (r271880) @@ -62,8 +62,12 @@ struct file_format *file_formats[] = { }; extern struct console efi_console; +extern struct console comconsole; +extern struct console nullconsole; struct console *consoles[] = { &efi_console, + &comconsole, + &nullconsole, NULL }; Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/efi/libefi/Makefile Fri Sep 19 21:30:45 2014 (r271880) @@ -5,6 +5,8 @@ INTERNALLIB= SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.PATH: ${.CURDIR}/../../i386/libi386 +SRCS+= nullconsole.c comconsole.c .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC @@ -16,6 +18,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common +CFLAGS+= -DNO_PCI + # Suppress warning from clang for FreeBSD %b and %D formats CFLAGS+= -fformat-extensions Modified: stable/10/sys/boot/i386/libi386/comconsole.c ============================================================================== --- stable/10/sys/boot/i386/libi386/comconsole.c Fri Sep 19 18:24:02 2014 (r271879) +++ stable/10/sys/boot/i386/libi386/comconsole.c Fri Sep 19 21:30:45 2014 (r271880) @@ -214,6 +214,9 @@ comc_port_set(struct env_var *ev, int fl static uint32_t comc_parse_pcidev(const char *string) { +#ifdef NO_PCI + return (0); +#else char *p, *p1; uint8_t bus, dev, func, bar; uint32_t locator; @@ -247,11 +250,15 @@ comc_parse_pcidev(const char *string) locator = (bar << 16) | biospci_locator(bus, dev, func); return (locator); +#endif } static int comc_pcidev_handle(uint32_t locator) { +#ifdef NO_PCI + return (CMD_ERROR); +#else char intbuf[64]; uint32_t port; @@ -275,6 +282,7 @@ comc_pcidev_handle(uint32_t locator) comc_locator = locator; return (CMD_OK); +#endif } static int From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 22:42:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8F27F67; Fri, 19 Sep 2014 22:42:14 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id A988D5FD; Fri, 19 Sep 2014 22:42:14 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 8737C20E7088E; Fri, 19 Sep 2014 22:42:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id E15F220E7088A; Fri, 19 Sep 2014 22:42:09 +0000 (UTC) Message-ID: <22388302B2EF4C53B49F0541ABDB3198@multiplay.co.uk> From: "Steven Hartland" To: "Will Andrews" , "John Baldwin" References: <201409181655.s8IGtgft042984@svn.freebsd.org><5783417ED470465B9C816FCA02B3690D@multiplay.co.uk><11362806.9nSfhFyLDg@ralph.baldwin.cx> Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Fri, 19 Sep 2014 23:42:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 22:42:15 -0000 ----- Original Message ----- From: "Will Andrews" To: "John Baldwin" Cc: "Steven Hartland" ; "src-committers@FreeBSD.org" ; ; Sent: Friday, September 19, 2014 6:35 PM Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs >I found that neither TUNABLE_INT nor CTLFLAG_RWTUN work with this > particular implementation of the tunable, so there is a regression > that needs to be fixed (i.e. vfs.zfs.debug_flags always comes up 0 no > matter what's in loader.conf). I believe it's limited to this > particular tunable, however, because I tested another SYSCTL_PROC that > had CTLFLAG_TUN set and it worked. Given I pointed you in this direction I kinda felt guilty that you where having issues so had a dig. It took quite a few printf's and a reboots but I found the cause. The name of your sysctl is conflicting with the 4th loader which believes your vfs.zfs.debug_flags is a module _flags setting as it matches the reserved suffix *_flags as detailed in loader.conf (5). I think the loader should only consider [a-z0-9_]+_flags as module flags as I can't see any modules having any other chars expecially not "." in their name; but I've no idea how to do that in 4th. So the fix is to rename you sysctl e.g. vfs.zfs.debugflags. Hope this helps. Regards Steve From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 23:16:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04ECE629; Fri, 19 Sep 2014 23:16:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E306C94A; Fri, 19 Sep 2014 23:16:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JNG4Bw002527; Fri, 19 Sep 2014 23:16:04 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JNG2oe002514; Fri, 19 Sep 2014 23:16:02 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409192316.s8JNG2oe002514@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 19 Sep 2014 23:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271881 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 23:16:05 -0000 Author: marcel Date: Fri Sep 19 23:16:02 2014 New Revision: 271881 URL: http://svnweb.freebsd.org/changeset/base/271881 Log: Fix partition alignment and image rounding when any of -P (block size), -T (track size) or -H (number of heads) is given: o scheme_metadata() always rounded to the block size. This is not always valid (e.g. vtoc8 that must have partitions start at cylinder boundaries). o The bsd and vtoc8 schemes "resized" the image to make it match the geometry, but since the geometry is an approximation and the size of the image computed from cylinders * heads * sectors is always smaller than the original image size, the partition information ran out of bounds. The fix is to have scheme_metadata() simply pass it's arguments to the per-scheme metadata callback, so that schemes not only know where the metadata is to go, but also what the current block address is. It's now up to the per-scheme callback to reserve room for metadata and to make sure alignment and rounding is applied. The BSD scheme now has the most elaborate alignment and rounding. Just to make the point: partitions are aligned on block boundaries, but the image is rounded to the next cyclinder boundary. vtoc8 now properly has all partitions aligned (and rounded) to the cyclinder boundary. Obtained from: Juniper Networks, Inc. MFC after: 3 days Modified: head/usr.bin/mkimg/apm.c head/usr.bin/mkimg/bsd.c head/usr.bin/mkimg/ebr.c head/usr.bin/mkimg/gpt.c head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/mkimg.h head/usr.bin/mkimg/pc98.c head/usr.bin/mkimg/scheme.c head/usr.bin/mkimg/scheme.h head/usr.bin/mkimg/vtoc8.c Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/apm.c Fri Sep 19 23:16:02 2014 (r271881) @@ -57,13 +57,12 @@ static struct mkimg_alias apm_aliases[] { ALIAS_NONE, 0 } }; -static u_int -apm_metadata(u_int where) +static lba_t +apm_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_IMG_START) ? nparts + 2 : 0; - return (secs); + blk += (where == SCHEME_META_IMG_START) ? nparts + 2 : 0; + return (round_block(blk)); } static int Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/bsd.c Fri Sep 19 23:16:02 2014 (r271881) @@ -52,13 +52,17 @@ static struct mkimg_alias bsd_aliases[] { ALIAS_NONE, 0 } }; -static u_int -bsd_metadata(u_int where) +static lba_t +bsd_metadata(u_int where, lba_t blk) { - u_int secs; - secs = BBSIZE / secsz; - return ((where == SCHEME_META_IMG_START) ? secs : 0); + if (where == SCHEME_META_IMG_START) + blk += BBSIZE / secsz; + else if (where == SCHEME_META_IMG_END) + blk = round_cylinder(blk); + else + blk = round_block(blk); + return (blk); } static int @@ -83,12 +87,6 @@ bsd_write(lba_t imgsz, void *bootcode) bsdparts = nparts + 1; /* Account for c partition */ if (bsdparts < MAXPARTITIONS) bsdparts = MAXPARTITIONS; - imgsz = (lba_t)ncyls * nheads * nsecs; - error = image_set_size(imgsz); - if (error) { - free(buf); - return (error); - } d = (void *)(buf + secsz); le32enc(&d->d_magic, DISKMAGIC); Modified: head/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/ebr.c Fri Sep 19 23:16:02 2014 (r271881) @@ -49,13 +49,12 @@ static struct mkimg_alias ebr_aliases[] { ALIAS_NONE, 0 } }; -static u_int -ebr_metadata(u_int where) +static lba_t +ebr_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_PART_BEFORE) ? nsecs : 0; - return (secs); + blk += (where == SCHEME_META_PART_BEFORE) ? 1 : 0; + return (round_track(blk)); } static void Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/gpt.c Fri Sep 19 23:16:02 2014 (r271881) @@ -153,17 +153,15 @@ gpt_tblsz(void) return ((nparts + ents - 1) / ents); } -static u_int -gpt_metadata(u_int where) +static lba_t +gpt_metadata(u_int where, lba_t blk) { - u_int secs; - if (where != SCHEME_META_IMG_START && where != SCHEME_META_IMG_END) - return (0); - - secs = gpt_tblsz(); - secs += (where == SCHEME_META_IMG_START) ? 2 : 1; - return (secs); + if (where == SCHEME_META_IMG_START || where == SCHEME_META_IMG_END) { + blk += gpt_tblsz(); + blk += (where == SCHEME_META_IMG_START) ? 2 : 1; + } + return (round_block(blk)); } static int Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/mbr.c Fri Sep 19 23:16:02 2014 (r271881) @@ -50,13 +50,12 @@ static struct mkimg_alias mbr_aliases[] { ALIAS_NONE, 0 } /* Keep last! */ }; -static u_int -mbr_metadata(u_int where) +static lba_t +mbr_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_IMG_START) ? nsecs : 0; - return (secs); + blk += (where == SCHEME_META_IMG_START) ? 1 : 0; + return (round_track(blk)); } static void Modified: head/usr.bin/mkimg/mkimg.h ============================================================================== --- head/usr.bin/mkimg/mkimg.h Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/mkimg.h Fri Sep 19 23:16:02 2014 (r271881) @@ -66,6 +66,21 @@ round_block(lba_t n) return ((n + b - 1) & ~(b - 1)); } +static inline lba_t +round_cylinder(lba_t n) +{ + u_int cyl = nsecs * nheads; + u_int r = n % cyl; + return ((r == 0) ? n : n + cyl - r); +} + +static inline lba_t +round_track(lba_t n) +{ + u_int r = n % nsecs; + return ((r == 0) ? n : n + nsecs - r); +} + #if !defined(SPARSE_WRITE) #define sparse_write write #else Modified: head/usr.bin/mkimg/pc98.c ============================================================================== --- head/usr.bin/mkimg/pc98.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/pc98.c Fri Sep 19 23:16:02 2014 (r271881) @@ -59,13 +59,12 @@ static struct mkimg_alias pc98_aliases[] { ALIAS_NONE, 0 } }; -static u_int -pc98_metadata(u_int where) +static lba_t +pc98_metadata(u_int where, lba_t blk) { - u_int secs; - - secs = PC98_BOOTCODESZ / secsz; - return ((where == SCHEME_META_IMG_START) ? secs : 0); + if (where == SCHEME_META_IMG_START) + blk += PC98_BOOTCODESZ / secsz; + return (round_track(blk)); } static void Modified: head/usr.bin/mkimg/scheme.c ============================================================================== --- head/usr.bin/mkimg/scheme.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/scheme.c Fri Sep 19 23:16:02 2014 (r271881) @@ -171,10 +171,8 @@ scheme_max_secsz(void) lba_t scheme_metadata(u_int where, lba_t start) { - lba_t secs; - secs = scheme->metadata(where); - return (round_block(start + secs)); + return (scheme->metadata(where, start)); } int Modified: head/usr.bin/mkimg/scheme.h ============================================================================== --- head/usr.bin/mkimg/scheme.h Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/scheme.h Fri Sep 19 23:16:02 2014 (r271881) @@ -62,7 +62,7 @@ struct mkimg_scheme { const char *name; const char *description; struct mkimg_alias *aliases; - u_int (*metadata)(u_int); + lba_t (*metadata)(u_int, lba_t); #define SCHEME_META_IMG_START 1 #define SCHEME_META_IMG_END 2 #define SCHEME_META_PART_BEFORE 3 Modified: head/usr.bin/mkimg/vtoc8.c ============================================================================== --- head/usr.bin/mkimg/vtoc8.c Fri Sep 19 21:30:45 2014 (r271880) +++ head/usr.bin/mkimg/vtoc8.c Fri Sep 19 23:16:02 2014 (r271881) @@ -53,13 +53,12 @@ static struct mkimg_alias vtoc8_aliases[ { ALIAS_NONE, 0 } }; -static u_int -vtoc8_metadata(u_int where) +static lba_t +vtoc8_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_IMG_START) ? nsecs * nheads : 0; - return (secs); + blk += (where == SCHEME_META_IMG_START) ? 1 : 0; + return (round_cylinder(blk)); } static int @@ -87,10 +86,6 @@ vtoc8_write(lba_t imgsz, void *bootcode be16enc(&vtoc8.nsecs, nsecs); be16enc(&vtoc8.magic, VTOC_MAGIC); - error = image_set_size(imgsz); - if (error) - return (error); - be32enc(&vtoc8.map[VTOC_RAW_PART].nblks, imgsz); STAILQ_FOREACH(part, &partlist, link) { n = part->index + ((part->index >= VTOC_RAW_PART) ? 1 : 0); From owner-svn-src-all@FreeBSD.ORG Fri Sep 19 23:38:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0098AB8C; Fri, 19 Sep 2014 23:38:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0383B0F; Fri, 19 Sep 2014 23:38:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8JNciog012148; Fri, 19 Sep 2014 23:38:44 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8JNcibf012147; Fri, 19 Sep 2014 23:38:44 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409192338.s8JNcibf012147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 19 Sep 2014 23:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271882 - head/usr.sbin/mfiutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 19 Sep 2014 23:38:45 -0000 Author: smh Date: Fri Sep 19 23:38:44 2014 New Revision: 271882 URL: http://svnweb.freebsd.org/changeset/base/271882 Log: Style (9) fixes, spaces to tabs. Fix style issues noticed when I went to MFC r257820 MFC after: 2 days X-MFC-With: r257820 Sponsored by: Multiplay Modified: head/usr.sbin/mfiutil/mfi_properties.c Modified: head/usr.sbin/mfiutil/mfi_properties.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_properties.c Fri Sep 19 23:16:02 2014 (r271881) +++ head/usr.sbin/mfiutil/mfi_properties.c Fri Sep 19 23:38:44 2014 (r271882) @@ -68,7 +68,7 @@ mfi_ctrl_set_properties(int fd, struct m static int mfi_ctrl_rebuild_rate(int ac, char **av) { - int error, fd; + int error, fd; struct mfi_ctrl_props ctrl_props; if (ac > 2) { @@ -76,40 +76,40 @@ mfi_ctrl_rebuild_rate(int ac, char **av) return(-1); } - fd = mfi_open(mfi_unit, O_RDWR); - if (fd < 0) { - error = errno; - warn("mfi_open"); - return (error); - } + fd = mfi_open(mfi_unit, O_RDWR); + if (fd < 0) { + error = errno; + warn("mfi_open"); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } /* * User requested a change to the rebuild rate */ if (ac > 1) { ctrl_props.rebuild_rate = atoi(av[ac - 1]); error = mfi_ctrl_set_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to set controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to set controller properties"); + close(fd); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } } printf ("controller rebuild rate: %%%u \n", ctrl_props.rebuild_rate); @@ -120,7 +120,7 @@ MFI_COMMAND(ctrlprop, rebuild, mfi_ctrl_ static int mfi_ctrl_alarm_enable(int ac, char **av) { - int error, fd; + int error, fd; struct mfi_ctrl_props ctrl_props; if (ac > 2) { @@ -128,40 +128,40 @@ mfi_ctrl_alarm_enable(int ac, char **av) return(-1); } - fd = mfi_open(mfi_unit, O_RDWR); - if (fd < 0) { - error = errno; - warn("mfi_open"); - return (error); - } + fd = mfi_open(mfi_unit, O_RDWR); + if (fd < 0) { + error = errno; + warn("mfi_open"); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } printf ("controller alarm was : %s\n", (ctrl_props.alarm_enable ? "enabled" : "disabled")); if (ac > 1) { ctrl_props.alarm_enable = atoi(av[ac - 1]); error = mfi_ctrl_set_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to set controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to set controller properties"); + close(fd); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } } printf ("controller alarm was : %s\n", (ctrl_props.alarm_enable ? "enabled" : "disabled")); From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 00:19:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A8A76CF; Sat, 20 Sep 2014 00:19:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66BB0EA2; Sat, 20 Sep 2014 00:19:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K0Jkd1031576; Sat, 20 Sep 2014 00:19:46 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K0JkDX031575; Sat, 20 Sep 2014 00:19:46 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409200019.s8K0JkDX031575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Sat, 20 Sep 2014 00:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271883 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 00:19:46 -0000 Author: gavin Date: Sat Sep 20 00:19:45 2014 New Revision: 271883 URL: http://svnweb.freebsd.org/changeset/base/271883 Log: Explain how to load the malo(4) firmware on boot. PR: 193653 Submitted by: Juan Ramón Molina Menor MFC after: 3 days Modified: head/share/man/man4/malo.4 Modified: head/share/man/man4/malo.4 ============================================================================== --- head/share/man/man4/malo.4 Fri Sep 19 23:38:44 2014 (r271882) +++ head/share/man/man4/malo.4 Sat Sep 20 00:19:45 2014 (r271883) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd October 21, 2009 +.Dd September 20, 2014 .Dt MALO 4 .Os .Sh NAME @@ -49,7 +49,7 @@ kernel configuration file: .Ed .Pp Alternatively, to load the driver as a -module at boot time, place the following lines in +module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_malo_load="YES" @@ -84,6 +84,15 @@ the archive and running in the .Pa malo-firmware-1.4 directory. +.Pp +To load the +.Nm malofw +firmware kernel module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +malofw_load="YES" +.Ed .Sh HARDWARE The following cards are among those supported by the .Nm From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 01:16:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03CEFD3D; Sat, 20 Sep 2014 01:16:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E37A73A5; Sat, 20 Sep 2014 01:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K1Gfuo058699; Sat, 20 Sep 2014 01:16:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K1Gf0W058698; Sat, 20 Sep 2014 01:16:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409200116.s8K1Gf0W058698@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Sep 2014 01:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271884 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 01:16:42 -0000 Author: adrian Date: Sat Sep 20 01:16:41 2014 New Revision: 271884 URL: http://svnweb.freebsd.org/changeset/base/271884 Log: Don't double-call the ar9300 stub function method. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Sep 20 00:19:45 2014 (r271883) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Sep 20 01:16:41 2014 (r271884) @@ -70,9 +70,6 @@ void ar9300_attach_freebsd_ops(struct ath_hal *ah) { - /* stub everything first */ - ar9300_set_stub_functions(ah); - /* Global functions */ ah->ah_detach = ar9300_detach; ah->ah_getRateTable = ar9300_get_rate_table; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 01:17:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F26EE7B; Sat, 20 Sep 2014 01:17:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8ACD03B0; Sat, 20 Sep 2014 01:17:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K1H2A8058798; Sat, 20 Sep 2014 01:17:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K1H2dZ058797; Sat, 20 Sep 2014 01:17:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409200117.s8K1H2dZ058797@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Sep 2014 01:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271885 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 01:17:02 -0000 Author: adrian Date: Sat Sep 20 01:17:02 2014 New Revision: 271885 URL: http://svnweb.freebsd.org/changeset/base/271885 Log: Quieten the AR9300 HAL probe a bit. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c Sat Sep 20 01:16:41 2014 (r271884) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c Sat Sep 20 01:17:02 2014 (r271885) @@ -33,7 +33,7 @@ void ar9300_set_stub_functions(struct ath_hal *ah) { - ath_hal_printf(ah, "%s: setting stub functions\n", __func__); +// ath_hal_printf(ah, "%s: setting stub functions\n", __func__); ah->ah_getRateTable = ar9300_Stub_GetRateTable; // ah->ah_detach = ar9300_Stub_detach; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 01:18:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7BB2FC8; Sat, 20 Sep 2014 01:18:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9320E3B7; Sat, 20 Sep 2014 01:18:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K1IaEi059037; Sat, 20 Sep 2014 01:18:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K1IaXO059036; Sat, 20 Sep 2014 01:18:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409200118.s8K1IaXO059036@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Sep 2014 01:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271886 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 01:18:36 -0000 Author: adrian Date: Sat Sep 20 01:18:36 2014 New Revision: 271886 URL: http://svnweb.freebsd.org/changeset/base/271886 Log: Quieten the AR9300 HAL attach a little - the setupXTxDesc method is only called during attach now. The EDMA TX path never calls this - only the legacy TX path does. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Sep 20 01:17:02 2014 (r271885) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Sep 20 01:18:36 2014 (r271886) @@ -468,11 +468,13 @@ ar9300_freebsd_setup_x_tx_desc(struct at u_int txRate3, u_int txTries3) { +#if 0 ath_hal_printf(ah, "%s: called, 0x%x/%d, 0x%x/%d, 0x%x/%d\n", __func__, txRate1, txTries1, txRate2, txTries2, txRate3, txTries3); +#endif /* XXX should only be called during probe */ return (AH_TRUE); From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 01:22:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A78C1A9; Sat, 20 Sep 2014 01:22:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E95CE635; Sat, 20 Sep 2014 01:22:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K1MIwQ062898; Sat, 20 Sep 2014 01:22:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K1MILV062894; Sat, 20 Sep 2014 01:22:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409200122.s8K1MILV062894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Sep 2014 01:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271887 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 01:22:19 -0000 Author: adrian Date: Sat Sep 20 01:22:17 2014 New Revision: 271887 URL: http://svnweb.freebsd.org/changeset/base/271887 Log: Fix up the EDMA RX setup path to correctly initialise and reset the RX FIFO. The original code was .. well, slightly more than incorrect. It showed up as stalled RX queues if the NIC needed to be frequently reinitialised (eg during scans.) This is inspired by work done by Matt Dillon over at the DragonflyBSD project. So: * track when EDMA RX has been stopped and when the MAC has been reset; * re-initialise the ring only after a reset; * track whether RX has been stopped/started - just for debugging now; * don't bother with the RX EOL stuff for EDMA - we don't need the interrupt at all. We also don't need to disable/enable the interrupt or start DMA - once new frames are pushed into the ring via the normal RX path, it'll just restart RX DMA on its own. Tested: * AR9380, STA mode * AR9380, AP mode * AR9485, STA mode * AR9462, STA mode Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Sep 20 01:18:36 2014 (r271886) +++ head/sys/dev/ath/if_ath.c Sat Sep 20 01:22:17 2014 (r271887) @@ -1715,12 +1715,22 @@ ath_suspend(struct ath_softc *sc) * NB: don't worry about putting the chip in low power * mode; pci will power off our socket on suspend and * CardBus detaches the device. + * + * XXX TODO: well, that's great, except for non-cardbus + * devices! */ /* - * XXX ensure none of the taskqueues are running + * XXX This doesn't wait until all pending taskqueue + * items and parallel transmit/receive/other threads + * are running! + */ + ath_hal_intrset(sc->sc_ah, 0); + taskqueue_block(sc->sc_tq); + callout_drain(&sc->sc_cal_ch); + + /* * XXX ensure sc_invalid is 1 - * XXX ensure the calibration callout is disabled */ /* Disable the PCIe PHY, complete with workarounds */ @@ -1811,6 +1821,11 @@ ath_resume(struct ath_softc *sc) AH_FALSE, &status); ath_reset_keycache(sc); + ATH_RX_LOCK(sc); + sc->sc_rx_stopped = 1; + sc->sc_rx_resetted = 1; + ATH_RX_UNLOCK(sc); + /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, ic->ic_curchan); @@ -2015,44 +2030,46 @@ ath_intr(void *arg) if (status & HAL_INT_RXEOL) { int imask; ATH_KTR(sc, ATH_KTR_ERROR, 0, "ath_intr: RXEOL"); - ATH_PCU_LOCK(sc); - /* - * NB: the hardware should re-read the link when - * RXE bit is written, but it doesn't work at - * least on older hardware revs. - */ - sc->sc_stats.ast_rxeol++; - /* - * Disable RXEOL/RXORN - prevent an interrupt - * storm until the PCU logic can be reset. - * In case the interface is reset some other - * way before "sc_kickpcu" is called, don't - * modify sc_imask - that way if it is reset - * by a call to ath_reset() somehow, the - * interrupt mask will be correctly reprogrammed. - */ - imask = sc->sc_imask; - imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); - ath_hal_intrset(ah, imask); - /* - * Only blank sc_rxlink if we've not yet kicked - * the PCU. - * - * This isn't entirely correct - the correct solution - * would be to have a PCU lock and engage that for - * the duration of the PCU fiddling; which would include - * running the RX process. Otherwise we could end up - * messing up the RX descriptor chain and making the - * RX desc list much shorter. - */ - if (! sc->sc_kickpcu) - sc->sc_rxlink = NULL; - sc->sc_kickpcu = 1; - ATH_PCU_UNLOCK(sc); + if (! sc->sc_isedma) { + ATH_PCU_LOCK(sc); + /* + * NB: the hardware should re-read the link when + * RXE bit is written, but it doesn't work at + * least on older hardware revs. + */ + sc->sc_stats.ast_rxeol++; + /* + * Disable RXEOL/RXORN - prevent an interrupt + * storm until the PCU logic can be reset. + * In case the interface is reset some other + * way before "sc_kickpcu" is called, don't + * modify sc_imask - that way if it is reset + * by a call to ath_reset() somehow, the + * interrupt mask will be correctly reprogrammed. + */ + imask = sc->sc_imask; + imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); + ath_hal_intrset(ah, imask); + /* + * Only blank sc_rxlink if we've not yet kicked + * the PCU. + * + * This isn't entirely correct - the correct solution + * would be to have a PCU lock and engage that for + * the duration of the PCU fiddling; which would include + * running the RX process. Otherwise we could end up + * messing up the RX descriptor chain and making the + * RX desc list much shorter. + */ + if (! sc->sc_kickpcu) + sc->sc_rxlink = NULL; + sc->sc_kickpcu = 1; + ATH_PCU_UNLOCK(sc); + } /* - * Enqueue an RX proc, to handled whatever + * Enqueue an RX proc to handle whatever * is in the RX queue. - * This will then kick the PCU. + * This will then kick the PCU if required. */ sc->sc_rx.recv_sched(sc, 1); } @@ -2348,6 +2365,12 @@ ath_init(void *arg) ATH_UNLOCK(sc); return; } + + ATH_RX_LOCK(sc); + sc->sc_rx_stopped = 1; + sc->sc_rx_resetted = 1; + ATH_RX_UNLOCK(sc); + ath_chan_change(sc, ic->ic_curchan); /* Let DFS at it in case it's a DFS channel */ @@ -2406,8 +2429,7 @@ ath_init(void *arg) * Enable interrupts. */ sc->sc_imask = HAL_INT_RX | HAL_INT_TX - | HAL_INT_RXEOL | HAL_INT_RXORN - | HAL_INT_TXURN + | HAL_INT_RXORN | HAL_INT_TXURN | HAL_INT_FATAL | HAL_INT_GLOBAL; /* @@ -2418,6 +2440,14 @@ ath_init(void *arg) sc->sc_imask |= (HAL_INT_RXHP | HAL_INT_RXLP); /* + * If we're an EDMA NIC, we don't care about RXEOL. + * Writing a new descriptor in will simply restart + * RX DMA. + */ + if (! sc->sc_isedma) + sc->sc_imask |= HAL_INT_RXEOL; + + /* * Enable MIB interrupts when there are hardware phy counters. * Note we only do this (at the moment) for station mode. */ @@ -2735,6 +2765,11 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T __func__, status); sc->sc_diversity = ath_hal_getdiversity(ah); + ATH_RX_LOCK(sc); + sc->sc_rx_stopped = 1; + sc->sc_rx_resetted = 1; + ATH_RX_UNLOCK(sc); + /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, ic->ic_curchan); @@ -5333,14 +5368,15 @@ ath_chan_set(struct ath_softc *sc, struc ATH_PCU_LOCK(sc); + /* Disable interrupts */ + ath_hal_intrset(ah, 0); + /* Stop new RX/TX/interrupt completion */ if (ath_reset_grablock(sc, 1) == 0) { device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n", __func__); } - ath_hal_intrset(ah, 0); - /* Stop pending RX/TX completion */ ath_txrx_stop_locked(sc); @@ -5384,6 +5420,11 @@ ath_chan_set(struct ath_softc *sc, struc } sc->sc_diversity = ath_hal_getdiversity(ah); + ATH_RX_LOCK(sc); + sc->sc_rx_stopped = 1; + sc->sc_rx_resetted = 1; + ATH_RX_UNLOCK(sc); + /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, chan); Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Sep 20 01:18:36 2014 (r271886) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Sep 20 01:22:17 2014 (r271887) @@ -160,10 +160,20 @@ ath_edma_stoprecv(struct ath_softc *sc, struct ath_hal *ah = sc->sc_ah; ATH_RX_LOCK(sc); + ath_hal_stoppcurecv(ah); ath_hal_setrxfilter(ah, 0); - ath_hal_stopdmarecv(ah); + /* + * + */ + if (ath_hal_stopdmarecv(ah) == AH_TRUE) + sc->sc_rx_stopped = 1; + + /* + * Give the various bus FIFOs (not EDMA descriptor FIFO) + * time to finish flushing out data. + */ DELAY(3000); /* Flush RX pending for each queue */ @@ -218,10 +228,6 @@ ath_edma_reinit_fifo(struct ath_softc *s /* * Start receive. - * - * XXX TODO: this needs to reallocate the FIFO entries when a reset - * occurs, in case the FIFO is filled up and no new descriptors get - * thrown into the FIFO. */ static int ath_edma_startrecv(struct ath_softc *sc) @@ -230,35 +236,31 @@ ath_edma_startrecv(struct ath_softc *sc) ATH_RX_LOCK(sc); + /* + * Sanity check - are we being called whilst RX + * isn't stopped? If so, we may end up pushing + * too many entries into the RX FIFO and + * badness occurs. + */ + /* Enable RX FIFO */ ath_hal_rxena(ah); /* - * Entries should only be written out if the - * FIFO is empty. - * - * XXX This isn't correct. I should be looking - * at the value of AR_RXDP_SIZE (0x0070) to determine - * how many entries are in here. - * - * A warm reset will clear the registers but not the FIFO. - * - * And I believe this is actually the address of the last - * handled buffer rather than the current FIFO pointer. - * So if no frames have been (yet) seen, we'll reinit the - * FIFO. - * - * I'll chase that up at some point. + * In theory the hardware has been initialised, right? */ - if (ath_hal_getrxbuf(sc->sc_ah, HAL_RX_QUEUE_HP) == 0) { + if (sc->sc_rx_resetted == 1) { DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Re-initing HP FIFO\n", __func__); ath_edma_reinit_fifo(sc, HAL_RX_QUEUE_HP); - } - if (ath_hal_getrxbuf(sc->sc_ah, HAL_RX_QUEUE_LP) == 0) { DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Re-initing LP FIFO\n", __func__); ath_edma_reinit_fifo(sc, HAL_RX_QUEUE_LP); + sc->sc_rx_resetted = 0; + } else { + device_printf(sc->sc_dev, + "%s: called without resetting chip?\n", + __func__); } /* Add up to m_fifolen entries in each queue */ @@ -266,6 +268,9 @@ ath_edma_startrecv(struct ath_softc *sc) * These must occur after the above write so the FIFO buffers * are pushed/tracked in the same order as the hardware will * process them. + * + * XXX TODO: is this really necessary? We should've stopped + * the hardware already and reinitialised it, so it's a no-op. */ ath_edma_rxfifo_alloc(sc, HAL_RX_QUEUE_HP, sc->sc_rxedma[HAL_RX_QUEUE_HP].m_fifolen); @@ -276,6 +281,11 @@ ath_edma_startrecv(struct ath_softc *sc) ath_mode_init(sc); ath_hal_startpcurecv(ah); + /* + * We're now doing RX DMA! + */ + sc->sc_rx_stopped = 0; + ATH_RX_UNLOCK(sc); return (0); @@ -380,6 +390,21 @@ ath_edma_recv_proc_queue(struct ath_soft ATH_RX_LOCK(sc); +#if 1 + if (sc->sc_rx_resetted == 1) { + /* + * XXX We shouldn't ever be scheduled if + * receive has been stopped - so complain + * loudly! + */ + device_printf(sc->sc_dev, + "%s: sc_rx_resetted=1! Bad!\n", + __func__); + ATH_RX_UNLOCK(sc); + return; + } +#endif + do { bf = re->m_fifo[re->m_fifo_head]; /* This shouldn't occur! */ @@ -451,24 +476,6 @@ ath_edma_recv_proc_queue(struct ath_soft "ath edma rx proc: npkts=%d\n", npkts); - /* Handle resched and kickpcu appropriately */ - ATH_PCU_LOCK(sc); - if (dosched && sc->sc_kickpcu) { - ATH_KTR(sc, ATH_KTR_ERROR, 0, - "ath_edma_recv_proc_queue(): kickpcu"); - if (npkts > 0) - device_printf(sc->sc_dev, - "%s: handled npkts %d\n", - __func__, npkts); - - /* - * XXX TODO: what should occur here? Just re-poke and - * re-enable the RX FIFO? - */ - sc->sc_kickpcu = 0; - } - ATH_PCU_UNLOCK(sc); - return; } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Sep 20 01:18:36 2014 (r271886) +++ head/sys/dev/ath/if_athvar.h Sat Sep 20 01:22:17 2014 (r271887) @@ -566,6 +566,8 @@ struct ath_softc { int sc_tx_statuslen; int sc_tx_nmaps; /* Number of TX maps */ int sc_edma_bufsize; + int sc_rx_stopped; /* XXX only for EDMA */ + int sc_rx_resetted; /* XXX only for EDMA */ void (*sc_node_cleanup)(struct ieee80211_node *); void (*sc_node_free)(struct ieee80211_node *); From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 02:35:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3444E76E; Sat, 20 Sep 2014 02:35:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DBD6B6A; Sat, 20 Sep 2014 02:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K2ZOP9095433; Sat, 20 Sep 2014 02:35:24 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K2ZLnt095414; Sat, 20 Sep 2014 02:35:21 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409200235.s8K2ZLnt095414@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 20 Sep 2014 02:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271888 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/modules/vmm sys/x86/include usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 02:35:24 -0000 Author: neel Date: Sat Sep 20 02:35:21 2014 New Revision: 271888 URL: http://svnweb.freebsd.org/changeset/base/271888 Log: Restructure the MSR handling so it is entirely handled by processor-specific code. There are only a handful of MSRs common between the two so there isn't too much duplicate functionality. The VT-x code has the following types of MSRs: - MSRs that are unconditionally saved/restored on every guest/host context switch (e.g., MSR_GSBASE). - MSRs that are restored to guest values on entry to vmx_run() and saved before returning. This is an optimization for MSRs that are not used in host kernel context (e.g., MSR_KGSBASE). - MSRs that are emulated and every access by the guest causes a trap into the hypervisor (e.g., MSR_IA32_MISC_ENABLE). Reviewed by: grehan Deleted: head/sys/amd64/vmm/vmm_msr.c head/sys/amd64/vmm/vmm_msr.h Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/ept.c head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_msr.c head/sys/amd64/vmm/intel/vmx_msr.h head/sys/amd64/vmm/vmm.c head/sys/modules/vmm/Makefile head/sys/x86/include/specialreg.h head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/xmsr.c head/usr.sbin/bhyve/xmsr.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/include/vmm.h Sat Sep 20 02:35:21 2014 (r271888) @@ -195,7 +195,6 @@ void vm_nmi_clear(struct vm *vm, int vcp int vm_inject_extint(struct vm *vm, int vcpu); int vm_extint_pending(struct vm *vm, int vcpuid); void vm_extint_clear(struct vm *vm, int vcpuid); -uint64_t *vm_guest_msrs(struct vm *vm, int cpu); struct vlapic *vm_lapic(struct vm *vm, int cpu); struct vioapic *vm_ioapic(struct vm *vm); struct vhpet *vm_hpet(struct vm *vm); Modified: head/sys/amd64/vmm/intel/ept.c ============================================================================== --- head/sys/amd64/vmm/intel/ept.c Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/vmm/intel/ept.c Sat Sep 20 02:35:21 2014 (r271888) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include "vmx_cpufunc.h" #include "vmm_ipi.h" -#include "vmx_msr.h" #include "ept.h" #define EPT_SUPPORTS_EXEC_ONLY(cap) ((cap) & (1UL << 0)) Modified: head/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.h Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/vmm/intel/vmcs.h Sat Sep 20 02:35:21 2014 (r271888) @@ -54,6 +54,10 @@ int vmcs_getdesc(struct vmcs *vmcs, int int vmcs_setdesc(struct vmcs *vmcs, int running, int ident, struct seg_desc *desc); +/* + * Avoid header pollution caused by inline use of 'vtophys()' in vmx_cpufunc.h + */ +#ifdef _VMX_CPUFUNC_H_ static __inline uint64_t vmcs_read(uint32_t encoding) { @@ -73,6 +77,7 @@ vmcs_write(uint32_t encoding, uint64_t v error = vmwrite(encoding, val); KASSERT(error == 0, ("vmcs_write(%u) error %d", encoding, error)); } +#endif /* _VMX_CPUFUNC_H_ */ #define vmexit_instruction_length() vmcs_read(VMCS_EXIT_INSTRUCTION_LENGTH) #define vmcs_guest_rip() vmcs_read(VMCS_GUEST_RIP) Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/vmm/intel/vmx.c Sat Sep 20 02:35:21 2014 (r271888) @@ -52,20 +52,20 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "vmm_lapic.h" #include "vmm_host.h" #include "vmm_ioport.h" #include "vmm_ipi.h" -#include "vmm_msr.h" #include "vmm_ktr.h" #include "vmm_stat.h" #include "vatpic.h" #include "vlapic.h" #include "vlapic_priv.h" -#include "vmx_msr.h" #include "ept.h" #include "vmx_cpufunc.h" #include "vmx.h" +#include "vmx_msr.h" #include "x86.h" #include "vmx_controls.h" @@ -116,12 +116,6 @@ __FBSDID("$FreeBSD$"); VM_ENTRY_INTO_SMM | \ VM_ENTRY_DEACTIVATE_DUAL_MONITOR) -#define guest_msr_rw(vmx, msr) \ - msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_RW) - -#define guest_msr_ro(vmx, msr) \ - msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_READ) - #define HANDLED 1 #define UNHANDLED 0 @@ -208,6 +202,7 @@ SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_ static int vmx_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc); static int vmx_getreg(void *arg, int vcpu, int reg, uint64_t *retval); +static int vmxctx_setreg(struct vmxctx *vmxctx, int reg, uint64_t val); static void vmx_inject_pir(struct vlapic *vlapic); #ifdef KTR @@ -475,22 +470,6 @@ vpid_init(void) } static void -msr_save_area_init(struct msr_entry *g_area, int *g_count) -{ - int cnt; - - static struct msr_entry guest_msrs[] = { - { MSR_KGSBASE, 0, 0 }, - }; - - cnt = sizeof(guest_msrs) / sizeof(guest_msrs[0]); - if (cnt > GUEST_MSR_MAX_ENTRIES) - panic("guest msr save area overrun"); - bcopy(guest_msrs, g_area, sizeof(guest_msrs)); - *g_count = cnt; -} - -static void vmx_disable(void *arg __unused) { struct invvpid_desc invvpid_desc = { 0 }; @@ -655,7 +634,6 @@ vmx_init(int ipinum) } else { if (bootverbose) printf("vmm: PAT MSR access not supported\n"); - guest_msr_valid(MSR_PAT); vmx_patmsr = 0; } } @@ -800,6 +778,8 @@ vmx_init(int ipinum) vpid_init(); + vmx_msr_init(); + /* enable VMX operation */ smp_rendezvous(NULL, vmx_enable, NULL, NULL); @@ -869,7 +849,7 @@ static void * vmx_vminit(struct vm *vm, pmap_t pmap) { uint16_t vpid[VM_MAXCPU]; - int i, error, guest_msr_count; + int i, error; struct vmx *vmx; struct vmcs *vmcs; @@ -958,6 +938,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) error, i); } + vmx_msr_guest_init(vmx, i); + error = vmcs_init(vmcs); KASSERT(error == 0, ("vmcs_init error %d", error)); @@ -996,13 +978,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vmx->state[i].lastcpu = NOCPU; vmx->state[i].vpid = vpid[i]; - msr_save_area_init(vmx->guest_msrs[i], &guest_msr_count); - - error = vmcs_set_msr_save(vmcs, vtophys(vmx->guest_msrs[i]), - guest_msr_count); - if (error != 0) - panic("vmcs_set_msr_save error %d", error); - /* * Set up the CR0/4 shadows, and init the read shadow * to the power-on register value from the Intel Sys Arch. @@ -2078,6 +2053,46 @@ vmx_task_switch_reason(uint64_t qual) } static int +emulate_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu) +{ + int error; + + if (lapic_msr(num)) + error = lapic_wrmsr(vmx->vm, vcpuid, num, val, retu); + else + error = vmx_wrmsr(vmx, vcpuid, num, val, retu); + + return (error); +} + +static int +emulate_rdmsr(struct vmx *vmx, int vcpuid, u_int num, bool *retu) +{ + struct vmxctx *vmxctx; + uint64_t result; + uint32_t eax, edx; + int error; + + if (lapic_msr(num)) + error = lapic_rdmsr(vmx->vm, vcpuid, num, &result, retu); + else + error = vmx_rdmsr(vmx, vcpuid, num, &result, retu); + + if (error == 0) { + eax = result; + vmxctx = &vmx->ctx[vcpuid]; + error = vmxctx_setreg(vmxctx, VM_REG_GUEST_RAX, eax); + KASSERT(error == 0, ("vmxctx_setreg(rax) error %d", error)); + + edx = result >> 32; + error = vmxctx_setreg(vmxctx, VM_REG_GUEST_RDX, edx); + KASSERT(error == 0, ("vmxctx_setreg(rdx) error %d", error)); + } + + return (error); +} + +static int vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { int error, handled, in; @@ -2215,7 +2230,7 @@ vmx_exit_process(struct vmx *vmx, int vc retu = false; ecx = vmxctx->guest_rcx; VCPU_CTR1(vmx->vm, vcpu, "rdmsr 0x%08x", ecx); - error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu); + error = emulate_rdmsr(vmx, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; vmexit->u.msr.code = ecx; @@ -2224,7 +2239,7 @@ vmx_exit_process(struct vmx *vmx, int vc } else { /* Return to userspace with a valid exitcode */ KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, - ("emulate_wrmsr retu with bogus exitcode")); + ("emulate_rdmsr retu with bogus exitcode")); } break; case EXIT_REASON_WRMSR: @@ -2235,7 +2250,7 @@ vmx_exit_process(struct vmx *vmx, int vc edx = vmxctx->guest_rdx; VCPU_CTR2(vmx->vm, vcpu, "wrmsr 0x%08x value 0x%016lx", ecx, (uint64_t)edx << 32 | eax); - error = emulate_wrmsr(vmx->vm, vcpu, ecx, + error = emulate_wrmsr(vmx, vcpu, ecx, (uint64_t)edx << 32 | eax, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_WRMSR; @@ -2523,6 +2538,8 @@ vmx_run(void *arg, int vcpu, register_t KASSERT(vmxctx->pmap == pmap, ("pmap %p different than ctx pmap %p", pmap, vmxctx->pmap)); + vmx_msr_guest_enter(vmx, vcpu); + VMPTRLD(vmcs); /* @@ -2624,6 +2641,8 @@ vmx_run(void *arg, int vcpu, register_t vmexit->exitcode); VMCLEAR(vmcs); + vmx_msr_guest_exit(vmx, vcpu); + return (0); } Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/vmm/intel/vmx.h Sat Sep 20 02:35:21 2014 (r271888) @@ -33,8 +33,6 @@ struct pmap; -#define GUEST_MSR_MAX_ENTRIES 64 /* arbitrary */ - struct vmxctx { register_t guest_rdi; /* Guest state */ register_t guest_rsi; @@ -97,13 +95,23 @@ struct pir_desc { } __aligned(64); CTASSERT(sizeof(struct pir_desc) == 64); +/* Index into the 'guest_msrs[]' array */ +enum { + IDX_MSR_LSTAR, + IDX_MSR_CSTAR, + IDX_MSR_STAR, + IDX_MSR_SF_MASK, + IDX_MSR_KGSBASE, + GUEST_MSR_NUM /* must be the last enumeration */ +}; + /* virtual machine softc */ struct vmx { struct vmcs vmcs[VM_MAXCPU]; /* one vmcs per virtual cpu */ struct apic_page apic_page[VM_MAXCPU]; /* one apic page per vcpu */ char msr_bitmap[PAGE_SIZE]; struct pir_desc pir_desc[VM_MAXCPU]; - struct msr_entry guest_msrs[VM_MAXCPU][GUEST_MSR_MAX_ENTRIES]; + uint64_t guest_msrs[VM_MAXCPU][GUEST_MSR_NUM]; struct vmxctx ctx[VM_MAXCPU]; struct vmxcap cap[VM_MAXCPU]; struct vmxstate state[VM_MAXCPU]; @@ -113,7 +121,6 @@ struct vmx { }; CTASSERT((offsetof(struct vmx, vmcs) & PAGE_MASK) == 0); CTASSERT((offsetof(struct vmx, msr_bitmap) & PAGE_MASK) == 0); -CTASSERT((offsetof(struct vmx, guest_msrs) & 15) == 0); CTASSERT((offsetof(struct vmx, pir_desc[0]) & 63) == 0); #define VMX_GUEST_VMEXIT 0 Modified: head/sys/amd64/vmm/intel/vmx_msr.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_msr.c Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/vmm/intel/vmx_msr.c Sat Sep 20 02:35:21 2014 (r271888) @@ -31,10 +31,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include "vmx.h" #include "vmx_msr.h" static boolean_t @@ -171,3 +174,115 @@ msr_bitmap_change_access(char *bitmap, u return (0); } + +static uint64_t misc_enable; +static uint64_t host_msrs[GUEST_MSR_NUM]; + +void +vmx_msr_init(void) +{ + /* + * It is safe to cache the values of the following MSRs because + * they don't change based on curcpu, curproc or curthread. + */ + host_msrs[IDX_MSR_LSTAR] = rdmsr(MSR_LSTAR); + host_msrs[IDX_MSR_CSTAR] = rdmsr(MSR_CSTAR); + host_msrs[IDX_MSR_STAR] = rdmsr(MSR_STAR); + host_msrs[IDX_MSR_SF_MASK] = rdmsr(MSR_SF_MASK); + + /* + * Initialize emulated MSRs + */ + misc_enable = rdmsr(MSR_IA32_MISC_ENABLE); + /* + * Set mandatory bits + * 11: branch trace disabled + * 12: PEBS unavailable + * Clear unsupported features + * 16: SpeedStep enable + * 18: enable MONITOR FSM + */ + misc_enable |= (1 << 12) | (1 << 11); + misc_enable &= ~((1 << 18) | (1 << 16)); +} + +void +vmx_msr_guest_init(struct vmx *vmx, int vcpuid) +{ + /* + * The permissions bitmap is shared between all vcpus so initialize it + * once when initializing the vBSP. + */ + if (vcpuid == 0) { + guest_msr_rw(vmx, MSR_LSTAR); + guest_msr_rw(vmx, MSR_CSTAR); + guest_msr_rw(vmx, MSR_STAR); + guest_msr_rw(vmx, MSR_SF_MASK); + guest_msr_rw(vmx, MSR_KGSBASE); + } + return; +} + +void +vmx_msr_guest_enter(struct vmx *vmx, int vcpuid) +{ + uint64_t *guest_msrs = vmx->guest_msrs[vcpuid]; + + /* Save host MSRs (if any) and restore guest MSRs */ + wrmsr(MSR_LSTAR, guest_msrs[IDX_MSR_LSTAR]); + wrmsr(MSR_CSTAR, guest_msrs[IDX_MSR_CSTAR]); + wrmsr(MSR_STAR, guest_msrs[IDX_MSR_STAR]); + wrmsr(MSR_SF_MASK, guest_msrs[IDX_MSR_SF_MASK]); + wrmsr(MSR_KGSBASE, guest_msrs[IDX_MSR_KGSBASE]); +} + +void +vmx_msr_guest_exit(struct vmx *vmx, int vcpuid) +{ + uint64_t *guest_msrs = vmx->guest_msrs[vcpuid]; + + /* Save guest MSRs */ + guest_msrs[IDX_MSR_LSTAR] = rdmsr(MSR_LSTAR); + guest_msrs[IDX_MSR_CSTAR] = rdmsr(MSR_CSTAR); + guest_msrs[IDX_MSR_STAR] = rdmsr(MSR_STAR); + guest_msrs[IDX_MSR_SF_MASK] = rdmsr(MSR_SF_MASK); + guest_msrs[IDX_MSR_KGSBASE] = rdmsr(MSR_KGSBASE); + + /* Restore host MSRs */ + wrmsr(MSR_LSTAR, host_msrs[IDX_MSR_LSTAR]); + wrmsr(MSR_CSTAR, host_msrs[IDX_MSR_CSTAR]); + wrmsr(MSR_STAR, host_msrs[IDX_MSR_STAR]); + wrmsr(MSR_SF_MASK, host_msrs[IDX_MSR_SF_MASK]); + + /* MSR_KGSBASE will be restored on the way back to userspace */ +} + +int +vmx_rdmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t *val, bool *retu) +{ + int error = 0; + + switch (num) { + case MSR_IA32_MISC_ENABLE: + *val = misc_enable; + break; + default: + error = EINVAL; + break; + } + return (error); +} + +int +vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu) +{ + int error = 0; + + switch (num) { + default: + error = EINVAL; + break; + } + + return (error); +} Modified: head/sys/amd64/vmm/intel/vmx_msr.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx_msr.h Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/vmm/intel/vmx_msr.h Sat Sep 20 02:35:21 2014 (r271888) @@ -29,6 +29,15 @@ #ifndef _VMX_MSR_H_ #define _VMX_MSR_H_ +struct vmx; + +void vmx_msr_init(void); +void vmx_msr_guest_init(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_enter(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_exit(struct vmx *vmx, int vcpuid); +int vmx_rdmsr(struct vmx *, int vcpuid, u_int num, uint64_t *val, bool *retu); +int vmx_wrmsr(struct vmx *, int vcpuid, u_int num, uint64_t val, bool *retu); + uint32_t vmx_revision(void); int vmx_set_ctlreg(int ctl_reg, int true_ctl_reg, uint32_t ones_mask, @@ -52,4 +61,10 @@ int vmx_set_ctlreg(int ctl_reg, int true void msr_bitmap_initialize(char *bitmap); int msr_bitmap_change_access(char *bitmap, u_int msr, int access); +#define guest_msr_rw(vmx, msr) \ + msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_RW) + +#define guest_msr_ro(vmx, msr) \ + msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_READ) + #endif Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/amd64/vmm/vmm.c Sat Sep 20 02:35:21 2014 (r271888) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include "vhpet.h" #include "vioapic.h" #include "vlapic.h" -#include "vmm_msr.h" #include "vmm_ipi.h" #include "vmm_stat.h" #include "vmm_lapic.h" @@ -105,7 +104,6 @@ struct vcpu { struct savefpu *guestfpu; /* (a,i) guest fpu state */ uint64_t guest_xcr0; /* (i) guest %xcr0 register */ void *stats; /* (a,i) statistics */ - uint64_t guest_msrs[VMM_MSR_NUM]; /* (i) emulated MSRs */ struct vm_exit exitinfo; /* (x) exit reason and collateral */ }; @@ -188,7 +186,6 @@ static struct vmm_ops *ops; #define fpu_stop_emulating() clts() static MALLOC_DEFINE(M_VM, "vm", "vm"); -CTASSERT(VMM_MSR_NUM <= 64); /* msr_mask can keep track of up to 64 msrs */ /* statistics */ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcpu total runtime"); @@ -249,7 +246,6 @@ vcpu_init(struct vm *vm, int vcpu_id, bo vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; fpu_save_area_reset(vcpu->guestfpu); vmm_stat_init(vcpu->stats); - guest_msrs_init(vm, vcpu_id); } struct vm_exit * @@ -293,7 +289,6 @@ vmm_init(void) else return (ENXIO); - vmm_msr_init(); vmm_resume_p = vmm_resume; return (VMM_INIT(vmm_ipinum)); @@ -1440,7 +1435,6 @@ restart: pcb = PCPU_GET(curpcb); set_pcb_flags(pcb, PCB_FULL_IRET); - restore_guest_msrs(vm, vcpuid); restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); @@ -1448,7 +1442,6 @@ restart: vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); - restore_host_msrs(vm, vcpuid); vmm_stat_incr(vm, vcpuid, VCPU_TOTAL_RUNTIME, rdtsc() - tscval); @@ -1890,12 +1883,6 @@ vm_set_capability(struct vm *vm, int vcp return (VMSETCAP(vm->cookie, vcpu, type, val)); } -uint64_t * -vm_guest_msrs(struct vm *vm, int cpu) -{ - return (vm->vcpu[cpu].guest_msrs); -} - struct vlapic * vm_lapic(struct vm *vm, int cpu) { Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/modules/vmm/Makefile Sat Sep 20 02:35:21 2014 (r271888) @@ -19,7 +19,6 @@ SRCS+= vmm.c \ vmm_ipi.c \ vmm_lapic.c \ vmm_mem.c \ - vmm_msr.c \ vmm_stat.c \ vmm_util.c \ x86.c \ Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Sep 20 01:22:17 2014 (r271887) +++ head/sys/x86/include/specialreg.h Sat Sep 20 02:35:21 2014 (r271888) @@ -437,6 +437,10 @@ #define MSR_MC4_STATUS 0x411 #define MSR_MC4_ADDR 0x412 #define MSR_MC4_MISC 0x413 +#define MSR_PKG_ENERGY_STATUS 0x611 +#define MSR_DRAM_ENERGY_STATUS 0x619 +#define MSR_PP0_ENERGY_STATUS 0x639 +#define MSR_PP1_ENERGY_STATUS 0x641 /* * VMX MSRs Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Sat Sep 20 01:22:17 2014 (r271887) +++ head/usr.sbin/bhyve/bhyverun.c Sat Sep 20 02:35:21 2014 (r271888) @@ -803,6 +803,12 @@ main(int argc, char *argv[]) exit(1); } + error = init_msr(); + if (error) { + fprintf(stderr, "init_msr error %d", error); + exit(1); + } + init_mem(); init_inout(); pci_irq_init(ctx); Modified: head/usr.sbin/bhyve/xmsr.c ============================================================================== --- head/usr.sbin/bhyve/xmsr.c Sat Sep 20 01:22:17 2014 (r271887) +++ head/usr.sbin/bhyve/xmsr.c Sat Sep 20 02:35:21 2014 (r271888) @@ -31,33 +31,84 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include + #include #include #include +#include #include "xmsr.h" +static int cpu_vendor_intel, cpu_vendor_amd; + int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val) { - switch (code) { - case 0xd04: /* Sandy Bridge uncore PMC MSRs */ - case 0xc24: - return (0); - case 0x79: - return (0); /* IA32_BIOS_UPDT_TRIG MSR */ - default: - break; + if (cpu_vendor_intel) { + switch (code) { + case 0xd04: /* Sandy Bridge uncore PMCs */ + case 0xc24: + return (0); + case MSR_BIOS_UPDT_TRIG: + return (0); + case MSR_BIOS_SIGN: + return (0); + default: + break; + } } return (-1); } int -emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val) +emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t num, uint64_t *val) { + int error = 0; - return (-1); + if (cpu_vendor_intel) { + switch (num) { + case MSR_BIOS_SIGN: + case MSR_IA32_PLATFORM_ID: + case MSR_PKG_ENERGY_STATUS: + case MSR_PP0_ENERGY_STATUS: + case MSR_PP1_ENERGY_STATUS: + case MSR_DRAM_ENERGY_STATUS: + *val = 0; + break; + default: + error = -1; + break; + } + } + return (error); +} + +int +init_msr(void) +{ + int error; + u_int regs[4]; + char cpu_vendor[13]; + + do_cpuid(0, regs); + ((u_int *)&cpu_vendor)[0] = regs[1]; + ((u_int *)&cpu_vendor)[1] = regs[3]; + ((u_int *)&cpu_vendor)[2] = regs[2]; + cpu_vendor[12] = '\0'; + + error = 0; + if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + cpu_vendor_amd = 1; + } else if (strcmp(cpu_vendor, "GenuineIntel") == 0) { + cpu_vendor_intel = 1; + } else { + fprintf(stderr, "Unknown cpu vendor \"%s\"\n", cpu_vendor); + error = -1; + } + return (error); } Modified: head/usr.sbin/bhyve/xmsr.h ============================================================================== --- head/usr.sbin/bhyve/xmsr.h Sat Sep 20 01:22:17 2014 (r271887) +++ head/usr.sbin/bhyve/xmsr.h Sat Sep 20 02:35:21 2014 (r271888) @@ -29,6 +29,7 @@ #ifndef _XMSR_H_ #define _XMSR_H_ +int init_msr(void); int emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t val); int emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t code, uint64_t *val); From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 04:31:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0885A563; Sat, 20 Sep 2014 04:31:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE49C8A8; Sat, 20 Sep 2014 04:31:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K4VC6h050708; Sat, 20 Sep 2014 04:31:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K4VCDa050706; Sat, 20 Sep 2014 04:31:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409200431.s8K4VCDa050706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 20 Sep 2014 04:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271889 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 04:31:13 -0000 Author: adrian Date: Sat Sep 20 04:31:12 2014 New Revision: 271889 URL: http://svnweb.freebsd.org/changeset/base/271889 Log: Populate the device info string with _PXM (proximity domain) information. This is primarily useful for debugging right now - it'll show up in devinfo. Reviewed by: jhb Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pci.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sat Sep 20 02:35:21 2014 (r271888) +++ head/sys/dev/acpica/acpi.c Sat Sep 20 04:31:12 2014 (r271889) @@ -851,11 +851,18 @@ acpi_child_location_str_method(device_t size_t buflen) { struct acpi_device *dinfo = device_get_ivars(child); + char buf2[32]; + int pxm; - if (dinfo->ad_handle) - snprintf(buf, buflen, "handle=%s", acpi_name(dinfo->ad_handle)); - else - snprintf(buf, buflen, "unknown"); + if (dinfo->ad_handle) { + snprintf(buf, buflen, "handle=%s", acpi_name(dinfo->ad_handle)); + if (ACPI_SUCCESS(acpi_GetInteger(dinfo->ad_handle, "_PXM", &pxm))) { + snprintf(buf2, 32, " _PXM=%d", pxm); + strlcat(buf, buf2, buflen); + } + } else { + snprintf(buf, buflen, "unknown"); + } return (0); } Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Sat Sep 20 02:35:21 2014 (r271888) +++ head/sys/dev/acpica/acpi_pci.c Sat Sep 20 04:31:12 2014 (r271889) @@ -149,12 +149,19 @@ acpi_pci_child_location_str_method(devic size_t buflen) { struct acpi_pci_devinfo *dinfo = device_get_ivars(child); + int pxm; + char buf2[32]; pci_child_location_str_method(cbdev, child, buf, buflen); - + if (dinfo->ap_handle) { - strlcat(buf, " handle=", buflen); - strlcat(buf, acpi_name(dinfo->ap_handle), buflen); + strlcat(buf, " handle=", buflen); + strlcat(buf, acpi_name(dinfo->ap_handle), buflen); + + if (ACPI_SUCCESS(acpi_GetInteger(dinfo->ap_handle, "_PXM", &pxm))) { + snprintf(buf2, 32, " _PXM=%d", pxm); + strlcat(buf, buf2, buflen); + } } return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 05:12:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B250A9DC; Sat, 20 Sep 2014 05:12:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99BFCBC2; Sat, 20 Sep 2014 05:12:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K5CZ6m070081; Sat, 20 Sep 2014 05:12:35 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K5CZEH070080; Sat, 20 Sep 2014 05:12:35 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409200512.s8K5CZEH070080@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 20 Sep 2014 05:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271890 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 05:12:35 -0000 Author: neel Date: Sat Sep 20 05:12:34 2014 New Revision: 271890 URL: http://svnweb.freebsd.org/changeset/base/271890 Log: MSR_KGSBASE is no longer saved and restored from the guest MSR save area. This behavior was changed in r271888 so update the comment block to reflect this. MSR_KGSBASE is accessible from the guest without triggering a VM-exit. The permission bitmap for MSR_KGSBASE is modified by vmx_msr_guest_init() so get rid of redundant code in vmx_vminit(). Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Sep 20 04:31:12 2014 (r271889) +++ head/sys/amd64/vmm/intel/vmx.c Sat Sep 20 05:12:34 2014 (r271890) @@ -885,12 +885,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * how they are saved/restored so can be directly accessed by the * guest. * - * Guest KGSBASE is saved and restored in the guest MSR save area. - * Host KGSBASE is restored before returning to userland from the pcb. - * There will be a window of time when we are executing in the host - * kernel context with a value of KGSBASE from the guest. This is ok - * because the value of KGSBASE is inconsequential in kernel context. - * * MSR_EFER is saved and restored in the guest VMCS area on a * VM exit and entry respectively. It is also restored from the * host VMCS area on a VM exit. @@ -905,7 +899,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_SYSENTER_CS_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) || - guest_msr_rw(vmx, MSR_KGSBASE) || guest_msr_rw(vmx, MSR_EFER) || guest_msr_ro(vmx, MSR_TSC)) panic("vmx_vminit: error setting guest msr access"); From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 05:13:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BE2AB1D; Sat, 20 Sep 2014 05:13:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1794EBC6; Sat, 20 Sep 2014 05:13:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K5D3mx070189; Sat, 20 Sep 2014 05:13:03 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K5D3Er070187; Sat, 20 Sep 2014 05:13:03 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409200513.s8K5D3Er070187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 20 Sep 2014 05:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271891 - in head/sys/amd64/vmm: . io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 05:13:04 -0000 Author: neel Date: Sat Sep 20 05:13:03 2014 New Revision: 271891 URL: http://svnweb.freebsd.org/changeset/base/271891 Log: Add some more KTR events to help debugging. Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Sat Sep 20 05:12:34 2014 (r271890) +++ head/sys/amd64/vmm/io/vlapic.c Sat Sep 20 05:13:03 2014 (r271891) @@ -633,6 +633,7 @@ vlapic_fire_timer(struct vlapic *vlapic) // The timer LVT always uses the fixed delivery mode. lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + VLAPIC_CTR0(vlapic, "vlapic timer fired"); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_TIMER, 1); } } Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Sep 20 05:12:34 2014 (r271890) +++ head/sys/amd64/vmm/vmm.c Sat Sep 20 05:13:03 2014 (r271891) @@ -1197,8 +1197,12 @@ vm_handle_paging(struct vm *vm, int vcpu if (ftype == VM_PROT_READ || ftype == VM_PROT_WRITE) { rv = pmap_emulate_accessed_dirty(vmspace_pmap(vm->vmspace), vme->u.paging.gpa, ftype); - if (rv == 0) + if (rv == 0) { + VCPU_CTR2(vm, vcpuid, "%s bit emulation for gpa %#lx", + ftype == VM_PROT_READ ? "accessed" : "dirty", + vme->u.paging.gpa); goto done; + } } map = &vm->vmspace->vm_map; @@ -1239,6 +1243,8 @@ vm_handle_inst_emul(struct vm *vm, int v paging = &vme->u.inst_emul.paging; cpu_mode = paging->cpu_mode; + VCPU_CTR1(vm, vcpuid, "inst_emul fault accessing gpa %#lx", gpa); + vie_init(vie); /* Fetch, decode and emulate the faulting instruction */ From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 05:49:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF349F5A; Sat, 20 Sep 2014 05:49:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB258E1F; Sat, 20 Sep 2014 05:49:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K5nF07084625; Sat, 20 Sep 2014 05:49:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K5nFS7084624; Sat, 20 Sep 2014 05:49:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409200549.s8K5nFS7084624@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 20 Sep 2014 05:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271892 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 05:49:16 -0000 Author: ngie Date: Sat Sep 20 05:49:15 2014 New Revision: 271892 URL: http://svnweb.freebsd.org/changeset/base/271892 Log: Sort the optional rc.d scripts by their knobs MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Sep 20 05:13:03 2014 (r271891) +++ head/etc/rc.d/Makefile Sat Sep 20 05:49:15 2014 (r271892) @@ -169,27 +169,27 @@ FILES= DAEMON \ zfs \ zvol -.if ${MK_OFED} != "no" -_opensm= opensm +.if ${MK_BLUETOOTH} != "no" +_bluetooth= bluetooth +_bthidd= bthidd +_hcsecd= hcsecd +_ubthidhci= ubthidhci .endif -.if ${MK_OPENSSH} != "no" -_sshd= sshd +.if ${MK_CASPER} != "no" +_casperd= casperd .endif .if ${MK_NS_CACHING} != "no" _nscd= nscd .endif -.if ${MK_BLUETOOTH} != "no" -_bluetooth= bluetooth -_bthidd= bthidd -_hcsecd= hcsecd -_ubthidhci= ubthidhci +.if ${MK_OFED} != "no" +_opensm= opensm .endif -.if ${MK_CASPER} != "no" -_casperd= casperd +.if ${MK_OPENSSH} != "no" +_sshd= sshd .endif .if ${MK_UNBOUND} != "no" From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 06:05:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 092FC1E0; Sat, 20 Sep 2014 06:05:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9225F88; Sat, 20 Sep 2014 06:05:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K65ObK093397; Sat, 20 Sep 2014 06:05:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K65Ot8093395; Sat, 20 Sep 2014 06:05:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409200605.s8K65Ot8093395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 20 Sep 2014 06:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271893 - in head: etc/rc.d 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 06:05:25 -0000 Author: ngie Date: Sat Sep 20 06:05:24 2014 New Revision: 271893 URL: http://svnweb.freebsd.org/changeset/base/271893 Log: Don't install /etc/rc.d/rwho unless MK_RCMDS == yes MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Sep 20 05:49:15 2014 (r271892) +++ head/etc/rc.d/Makefile Sat Sep 20 06:05:24 2014 (r271893) @@ -133,7 +133,6 @@ FILES= DAEMON \ rpcbind \ rtadvd \ rtsold \ - rwho \ savecore \ sdpd \ securelevel \ @@ -192,6 +191,10 @@ _opensm= opensm _sshd= sshd .endif +.if ${MK_RCMDS} != "no" +FILES+= rwho +.endif + .if ${MK_UNBOUND} != "no" _unbound= local_unbound .endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 20 05:49:15 2014 (r271892) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 20 06:05:24 2014 (r271893) @@ -3766,6 +3766,7 @@ OLD_FILES+=usr/lib/private/libssh_p.a .if ${MK_RCMDS} == no OLD_FILES+=bin/rcp +OLD_FILES+=etc/rc.d/rwho OLD_FILES+=etc/periodic/daily/140.clean-rwho OLD_FILES+=etc/periodic/daily/430.status-rwho OLD_FILES+=rescue/rcp From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 06:34:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65AECA43; Sat, 20 Sep 2014 06:34:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5113D26E; Sat, 20 Sep 2014 06:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K6YZ7E007967; Sat, 20 Sep 2014 06:34:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K6YYee007965; Sat, 20 Sep 2014 06:34:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409200634.s8K6YYee007965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 20 Sep 2014 06:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271895 - in head: etc/rc.d 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 06:34:35 -0000 Author: ngie Date: Sat Sep 20 06:34:34 2014 New Revision: 271895 URL: http://svnweb.freebsd.org/changeset/base/271895 Log: Don't install /etc/rc.d/ftp-proxy unless MK_PF == yes MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Sep 20 06:27:37 2014 (r271894) +++ head/etc/rc.d/Makefile Sat Sep 20 06:34:34 2014 (r271895) @@ -44,7 +44,6 @@ FILES= DAEMON \ dumpon \ faith \ fsck \ - ftp-proxy \ ftpd \ gbde \ geli \ @@ -191,6 +190,10 @@ _opensm= opensm _sshd= sshd .endif +.if ${MK_PF} != "no" +FILES+= ftp-proxy +.endif + .if ${MK_RCMDS} != "no" FILES+= rwho .endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 20 06:27:37 2014 (r271894) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 20 06:34:34 2014 (r271895) @@ -3606,6 +3606,7 @@ OLD_DIRS+=usr/share/examples/pc-sysinsta .if ${MK_PF} == no OLD_FILES+=etc/periodic/security/520.pfdenied OLD_FILES+=etc/pf.os +OLD_FILES+=etc/rc.d/ftp-proxy OLD_FILES+=sbin/pfctl OLD_FILES+=sbin/pflogd OLD_FILES+=usr/libexec/tftp-proxy From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 06:49:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C11A46C1; Sat, 20 Sep 2014 06:49:15 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 915D63CF; Sat, 20 Sep 2014 06:49:15 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-253-99.lns20.per2.internode.on.net [121.45.253.99]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id s8K6n0k5023133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 19 Sep 2014 23:49:07 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <541D2356.8040403@freebsd.org> Date: Sat, 20 Sep 2014 14:48:54 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Will Andrews , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271771 - in head: bin/csh etc/mail lib/libc usr.bin/grep usr.sbin/mtree References: <201409181441.s8IEfvR1075223@svn.freebsd.org> In-Reply-To: <201409181441.s8IEfvR1075223@svn.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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 06:49:15 -0000 On 9/18/14, 10:41 PM, Will Andrews wrote: > Author: will > Date: Thu Sep 18 14:41:57 2014 > New Revision: 271771 > URL: http://svnweb.freebsd.org/changeset/base/271771 > > Log: > Fix incremental builds involving non-root users with read-only source files. > > Makefiles should not assume that source files can be overwritten. This is the > common case for Perforce source trees. I'm concerned that just adding -f may not really be fixing the problem.. why are the files getting overwritten? I'm not sure forcing an overwrite is teh right answer to read-only sources. > iconv.h: ${.CURDIR}/iconv_stub.h > - cp ${.CURDIR}/iconv_stub.h ${.TARGET} > + cp -f ${.CURDIR}/iconv_stub.h ${.TARGET} > .endif > .endif > From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 07:38:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F722F3B; Sat, 20 Sep 2014 07:38:14 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id F311DA1C; Sat, 20 Sep 2014 07:38:12 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id CA9AE1041D3F; Sat, 20 Sep 2014 17:38:03 +1000 (EST) Date: Sat, 20 Sep 2014 17:38:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Julian Elischer Subject: Re: svn commit: r271771 - in head: bin/csh etc/mail lib/libc usr.bin/grep usr.sbin/mtree In-Reply-To: <541D2356.8040403@freebsd.org> Message-ID: <20140920172111.Q4941@besplex.bde.org> References: <201409181441.s8IEfvR1075223@svn.freebsd.org> <541D2356.8040403@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=NLfwrw81WfMA:10 a=Zwapm-UbuuUA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=Ek32XI8EQgEfo3QnYBkA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Will Andrews X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 07:38:14 -0000 On Sat, 20 Sep 2014, Julian Elischer wrote: > On 9/18/14, 10:41 PM, Will Andrews wrote: >> Author: will >> Date: Thu Sep 18 14:41:57 2014 >> New Revision: 271771 >> URL: http://svnweb.freebsd.org/changeset/base/271771 >> >> Log: >> Fix incremental builds involving non-root users with read-only source >> files. >> Makefiles should not assume that source files can be overwritten. >> This is the >> common case for Perforce source trees. > > I'm concerned that just adding -f may not really be fixing the problem.. > why are the files getting overwritten? I'm not sure forcing an overwrite is > teh right answer to read-only sources. The log message is confused. Source files are not being overwritten. They are being copied to object directories using cp. Then if they are read-only in the source directory, they are read-only in the object directory, even if they are copied without -p so as to clobber their timestamps (their mode is still preserved). Then if the source file's mtime is changed, either by actually changing the file or just by clobbering its mtime, the copy in the object directory becomes out of date. Then the cp to make it up to date fails because it is read-only. >> iconv.h: ${.CURDIR}/iconv_stub.h >> - cp ${.CURDIR}/iconv_stub.h ${.TARGET} >> + cp -f ${.CURDIR}/iconv_stub.h ${.TARGET} >> .endif >> .endif Many makefiles avoid this problem by using cat instead of cp to copy the files. I prefer using cp -p. The above fixes the problem for a makefile that uses cp (without -p) by adding -f. This causes the file to be unlinked before a new copy is made. If the object directory is in the source tree (most likely since it is the source directory) and the source files are read-only, then this would often fail because the source directory is also read-only, but then it can't reasonably be an object directory. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 07:59:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53B6C38B; Sat, 20 Sep 2014 07:59:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24A47B98; Sat, 20 Sep 2014 07:59:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K7xZap046684; Sat, 20 Sep 2014 07:59:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K7xZEm046683; Sat, 20 Sep 2014 07:59:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409200759.s8K7xZEm046683@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 20 Sep 2014 07:59: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: r271896 - stable/10/sys/dev/usb/serial 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 07:59:35 -0000 Author: hselasky Date: Sat Sep 20 07:59:34 2014 New Revision: 271896 URL: http://svnweb.freebsd.org/changeset/base/271896 Log: MFC r271492: Workaround for receiving Voice Calls using the E1750 dongle from Huawei. It might appear as if the firmware is allocating memory blocks according to the USB transfer size and if there is initially a lot of data, like at the answering machine prompt, it simply dies without any apparent reason. The simple workaround for this is to force a zero length packet at hardware level after every 512 bytes of data. This will force the other side to use smaller memory blocks aswell. Approved by: re, gjb Modified: stable/10/sys/dev/usb/serial/u3g.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Sat Sep 20 06:34:34 2014 (r271895) +++ stable/10/sys/dev/usb/serial/u3g.c Sat Sep 20 07:59:34 2014 (r271896) @@ -75,6 +75,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_MAXPORTS 12 #define U3G_CONFIG_INDEX 0 #define U3G_BSIZE 2048 +#define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) +#define U3G_TXFRAMES 4 #define U3GSP_GPRS 0 #define U3GSP_EDGE 1 @@ -153,6 +155,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = U3G_BSIZE,/* bytes */ + .frames = U3G_TXFRAMES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = &u3g_write_callback, }, @@ -1012,14 +1015,22 @@ u3g_write_callback(struct usb_xfer *xfer struct ucom_softc *ucom = usbd_xfer_softc(xfer); struct usb_page_cache *pc; uint32_t actlen; + uint32_t frame; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(ucom, pc, 0, U3G_BSIZE, &actlen)) { - usbd_xfer_set_frame_len(xfer, 0, actlen); + for (frame = 0; frame != U3G_TXFRAMES; frame++) { + usbd_xfer_set_frame_offset(xfer, frame * U3G_TXSIZE, frame); + + pc = usbd_xfer_get_frame(xfer, frame); + if (ucom_get_data(ucom, pc, 0, U3G_TXSIZE, &actlen) == 0) + break; + usbd_xfer_set_frame_len(xfer, frame, actlen); + } + if (frame != 0) { + usbd_xfer_set_frames(xfer, frame); usbd_transfer_submit(xfer); } break; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 08:01:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 226954F3; Sat, 20 Sep 2014 08:01:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7AD0C2C; Sat, 20 Sep 2014 08:01:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K81oJf048719; Sat, 20 Sep 2014 08:01:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K81o3P048718; Sat, 20 Sep 2014 08:01:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409200801.s8K81o3P048718@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 20 Sep 2014 08:01:50 +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: r271897 - stable/9/sys/dev/usb/serial 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 08:01:51 -0000 Author: hselasky Date: Sat Sep 20 08:01:50 2014 New Revision: 271897 URL: http://svnweb.freebsd.org/changeset/base/271897 Log: MFC r271492: Workaround for receiving Voice Calls using the E1750 dongle from Huawei. It might appear as if the firmware is allocating memory blocks according to the USB transfer size and if there is initially a lot of data, like at the answering machine prompt, it simply dies without any apparent reason. The simple workaround for this is to force a zero length packet at hardware level after every 512 bytes of data. This will force the other side to use smaller memory blocks aswell. Modified: stable/9/sys/dev/usb/serial/u3g.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Sat Sep 20 07:59:34 2014 (r271896) +++ stable/9/sys/dev/usb/serial/u3g.c Sat Sep 20 08:01:50 2014 (r271897) @@ -75,6 +75,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_MAXPORTS 12 #define U3G_CONFIG_INDEX 0 #define U3G_BSIZE 2048 +#define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) +#define U3G_TXFRAMES 4 #define U3GSP_GPRS 0 #define U3GSP_EDGE 1 @@ -153,6 +155,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = U3G_BSIZE,/* bytes */ + .frames = U3G_TXFRAMES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = &u3g_write_callback, }, @@ -1013,14 +1016,22 @@ u3g_write_callback(struct usb_xfer *xfer struct ucom_softc *ucom = usbd_xfer_softc(xfer); struct usb_page_cache *pc; uint32_t actlen; + uint32_t frame; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(ucom, pc, 0, U3G_BSIZE, &actlen)) { - usbd_xfer_set_frame_len(xfer, 0, actlen); + for (frame = 0; frame != U3G_TXFRAMES; frame++) { + usbd_xfer_set_frame_offset(xfer, frame * U3G_TXSIZE, frame); + + pc = usbd_xfer_get_frame(xfer, frame); + if (ucom_get_data(ucom, pc, 0, U3G_TXSIZE, &actlen) == 0) + break; + usbd_xfer_set_frame_len(xfer, frame, actlen); + } + if (frame != 0) { + usbd_xfer_set_frames(xfer, frame); usbd_transfer_submit(xfer); } break; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 08:03:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DADBD632; Sat, 20 Sep 2014 08:03:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB87BC35; Sat, 20 Sep 2014 08:03:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K83FhU050893; Sat, 20 Sep 2014 08:03:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K83FLk050892; Sat, 20 Sep 2014 08:03:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409200803.s8K83FLk050892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 20 Sep 2014 08:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271898 - stable/8/sys/dev/usb/serial X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 08:03:16 -0000 Author: hselasky Date: Sat Sep 20 08:03:15 2014 New Revision: 271898 URL: http://svnweb.freebsd.org/changeset/base/271898 Log: MFC r271492: Workaround for receiving Voice Calls using the E1750 dongle from Huawei. It might appear as if the firmware is allocating memory blocks according to the USB transfer size and if there is initially a lot of data, like at the answering machine prompt, it simply dies without any apparent reason. The simple workaround for this is to force a zero length packet at hardware level after every 512 bytes of data. This will force the other side to use smaller memory blocks aswell. Modified: stable/8/sys/dev/usb/serial/u3g.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sat Sep 20 08:01:50 2014 (r271897) +++ stable/8/sys/dev/usb/serial/u3g.c Sat Sep 20 08:03:15 2014 (r271898) @@ -75,6 +75,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_MAXPORTS 12 #define U3G_CONFIG_INDEX 0 #define U3G_BSIZE 2048 +#define U3G_TXSIZE (U3G_BSIZE / U3G_TXFRAMES) +#define U3G_TXFRAMES 4 #define U3GSP_GPRS 0 #define U3GSP_EDGE 1 @@ -151,6 +153,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = U3G_BSIZE,/* bytes */ + .frames = U3G_TXFRAMES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = &u3g_write_callback, }, @@ -987,14 +990,22 @@ u3g_write_callback(struct usb_xfer *xfer struct ucom_softc *ucom = usbd_xfer_softc(xfer); struct usb_page_cache *pc; uint32_t actlen; + uint32_t frame; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: case USB_ST_SETUP: tr_setup: - pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(ucom, pc, 0, U3G_BSIZE, &actlen)) { - usbd_xfer_set_frame_len(xfer, 0, actlen); + for (frame = 0; frame != U3G_TXFRAMES; frame++) { + usbd_xfer_set_frame_offset(xfer, frame * U3G_TXSIZE, frame); + + pc = usbd_xfer_get_frame(xfer, frame); + if (ucom_get_data(ucom, pc, 0, U3G_TXSIZE, &actlen) == 0) + break; + usbd_xfer_set_frame_len(xfer, frame, actlen); + } + if (frame != 0) { + usbd_xfer_set_frames(xfer, frame); usbd_transfer_submit(xfer); } break; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 08:18:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E60C8B2; Sat, 20 Sep 2014 08:18:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A4C1D2D; Sat, 20 Sep 2014 08:18:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K8ImL6056318; Sat, 20 Sep 2014 08:18:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K8ImA9056317; Sat, 20 Sep 2014 08:18:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409200818.s8K8ImA9056317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 20 Sep 2014 08:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271899 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 08:18:49 -0000 Author: bz Date: Sat Sep 20 08:18:48 2014 New Revision: 271899 URL: http://svnweb.freebsd.org/changeset/base/271899 Log: Make gcc happy by initialising the variable only set in a couple of case statements without a default. MFC after: 2 days X-MFC with: r271871 Modified: head/sys/dev/vt/vt_buf.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Sat Sep 20 08:03:15 2014 (r271898) +++ head/sys/dev/vt/vt_buf.c Sat Sep 20 08:18:48 2014 (r271899) @@ -83,6 +83,7 @@ vthistory_seek(struct vt_buf *vb, int of bottom + vb->vb_scr_size.tp_row - vb->vb_history_size : 0; + roffset = 0; /* Make gcc happy. */ switch (whence) { case VHS_SET: if (offset < 0) From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 08:34:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52E4DB1E; Sat, 20 Sep 2014 08:34:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8AAE8E; Sat, 20 Sep 2014 08:34:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K8YvTQ065036; Sat, 20 Sep 2014 08:34:57 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K8YumQ065034; Sat, 20 Sep 2014 08:34:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409200834.s8K8YumQ065034@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 20 Sep 2014 08:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271900 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 08:34:57 -0000 Author: bz Date: Sat Sep 20 08:34:56 2014 New Revision: 271900 URL: http://svnweb.freebsd.org/changeset/base/271900 Log: Properly hide calls to ARP under #ifdef INET to allow IPv6-only kernels to compile. MFC atfer: 3 days Modified: head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Sat Sep 20 08:18:48 2014 (r271899) +++ head/sys/dev/ixl/if_ixl.c Sat Sep 20 08:34:56 2014 (r271900) @@ -921,8 +921,10 @@ ixl_ioctl(struct ifnet * ifp, u_long com ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ixl_init(pf); +#ifdef INET if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); +#endif } else error = ether_ioctl(ifp, command, data); break; Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Sat Sep 20 08:18:48 2014 (r271899) +++ head/sys/dev/ixl/if_ixlv.c Sat Sep 20 08:34:56 2014 (r271900) @@ -755,8 +755,10 @@ ixlv_ioctl(struct ifnet *ifp, u_long com ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ixlv_init(sc); +#ifdef INET if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); +#endif } else error = ether_ioctl(ifp, command, data); break; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 09:18:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C527B14C; Sat, 20 Sep 2014 09:18:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B055323A; Sat, 20 Sep 2014 09:18:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8K9Iwbc084046; Sat, 20 Sep 2014 09:18:58 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8K9IwQY084045; Sat, 20 Sep 2014 09:18:58 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201409200918.s8K9IwQY084045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Sat, 20 Sep 2014 09:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271901 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 09:18:58 -0000 Author: ganbold Date: Sat Sep 20 09:18:58 2014 New Revision: 271901 URL: http://svnweb.freebsd.org/changeset/base/271901 Log: Fix typo in comment. Disable AHB clock gate for ehci0. Approved by: stas (mentor) Modified: head/sys/arm/allwinner/a10_clk.c Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Sat Sep 20 08:34:56 2014 (r271900) +++ head/sys/arm/allwinner/a10_clk.c Sat Sep 20 09:18:58 2014 (r271901) @@ -132,7 +132,7 @@ a10_clk_usb_activate(void) /* Gating AHB clock for USB */ reg_value = ccm_read_4(sc, CCM_AHB_GATING0); reg_value |= CCM_AHB_GATING_USB0; /* AHB clock gate usb0 */ - reg_value |= CCM_AHB_GATING_EHCI0; /* AHB clock gate ehci1 */ + reg_value |= CCM_AHB_GATING_EHCI0; /* AHB clock gate ehci0 */ reg_value |= CCM_AHB_GATING_EHCI1; /* AHB clock gate ehci1 */ ccm_write_4(sc, CCM_AHB_GATING0, reg_value); @@ -167,6 +167,7 @@ a10_clk_usb_deactivate(void) /* Disable gating AHB clock for USB */ reg_value = ccm_read_4(sc, CCM_AHB_GATING0); reg_value &= ~CCM_AHB_GATING_USB0; /* disable AHB clock gate usb0 */ + reg_value &= ~CCM_AHB_GATING_EHCI0; /* disable AHB clock gate ehci0 */ reg_value &= ~CCM_AHB_GATING_EHCI1; /* disable AHB clock gate ehci1 */ ccm_write_4(sc, CCM_AHB_GATING0, reg_value); From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 09:47:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 37E22564; Sat, 20 Sep 2014 09:47:54 +0000 (UTC) Date: Sat, 20 Sep 2014 09:47:54 +0000 From: Alexey Dokuchaev To: Will Andrews Subject: Re: svn commit: r271795 - head/sys/dev/firewire Message-ID: <20140920094754.GA83802@FreeBSD.org> References: <201409181728.s8IHSLju057744@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409181728.s8IHSLju057744@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 09:47:54 -0000 On Thu, Sep 18, 2014 at 05:28:21PM +0000, Will Andrews wrote: > New Revision: 271795 > URL: http://svnweb.freebsd.org/changeset/base/271795 > > Log: > Start the process of cleaning up FreeBSD's firewire driver. Woot! Thanks for finally starting to breath some life into our 1394 stack. ./danfe From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 12:59:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B195CF8A; Sat, 20 Sep 2014 12:59:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 826708B2; Sat, 20 Sep 2014 12:59:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KCxSBL085721; Sat, 20 Sep 2014 12:59:28 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KCxSs1085720; Sat, 20 Sep 2014 12:59:28 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201409201259.s8KCxSs1085720@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 20 Sep 2014 12:59:28 +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: r271902 - stable/9/usr.bin/pathchk 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 12:59:28 -0000 Author: jilles Date: Sat Sep 20 12:59:28 2014 New Revision: 271902 URL: http://svnweb.freebsd.org/changeset/base/271902 Log: MFC r256800: pathchk: Ensure bytes >= 128 are considered non-portable characters. This was not broken on architectures such as ARM where char is unsigned. Also, remove the first non-portable character from the output. POSIX does not require this, and printing the first byte may yield an invalid byte sequence with UTF-8. PR: 165988 Reported by: Nicolas Rachinsky Relnotes: yes Modified: stable/9/usr.bin/pathchk/pathchk.c Directory Properties: stable/9/usr.bin/pathchk/ (props changed) Modified: stable/9/usr.bin/pathchk/pathchk.c ============================================================================== --- stable/9/usr.bin/pathchk/pathchk.c Sat Sep 20 09:18:58 2014 (r271901) +++ stable/9/usr.bin/pathchk/pathchk.c Sat Sep 20 12:59:28 2014 (r271902) @@ -98,7 +98,7 @@ check(const char *path) { struct stat sb; long complen, namemax, pathmax, svnamemax; - int badch, last; + int last; char *end, *p, *pathd; if ((pathd = strdup(path)) == NULL) @@ -142,9 +142,9 @@ check(const char *path) goto bad; } - if (pflag && (badch = portable(p)) >= 0) { + if (pflag && !portable(p)) { warnx("%s: %s: component contains non-portable " - "character `%c'", path, p, badch); + "character", path, p); goto bad; } @@ -183,8 +183,7 @@ bad: free(pathd); } /* - * Check whether a path component contains only portable characters. Return - * the first non-portable character found. + * Check whether a path component contains only portable characters. */ static int portable(const char *path) @@ -197,7 +196,7 @@ portable(const char *path) s = strspn(path, charset); if (path[s] != '\0') - return (path[s]); + return (0); - return (-1); + return (1); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 13:46:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EEE4B23; Sat, 20 Sep 2014 13:46:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69CC0CA8; Sat, 20 Sep 2014 13:46:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KDkH1k009166; Sat, 20 Sep 2014 13:46:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KDkHCs009165; Sat, 20 Sep 2014 13:46:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409201346.s8KDkHCs009165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Sep 2014 13:46: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: r271903 - stable/10/sys/cam/scsi 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 13:46:17 -0000 Author: mav Date: Sat Sep 20 13:46:16 2014 New Revision: 271903 URL: http://svnweb.freebsd.org/changeset/base/271903 Log: MFC r271700: Fix typo in defined ROD types in r269497. Approved by: re (gjb) Modified: stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sat Sep 20 12:59:28 2014 (r271902) +++ stable/10/sys/cam/scsi/scsi_all.h Sat Sep 20 13:46:16 2014 (r271903) @@ -1608,11 +1608,11 @@ struct scsi_token { uint8_t type[4]; #define ROD_TYPE_INTERNAL 0x00000000 -#define ROD_TYPE_AUR 0x00001000 -#define ROD_TYPE_PIT_DEF 0x00080000 -#define ROD_TYPE_PIT_VULN 0x00080001 -#define ROD_TYPE_PIT_PERS 0x00080002 -#define ROD_TYPE_PIT_ANY 0x0008FFFF +#define ROD_TYPE_AUR 0x00010000 +#define ROD_TYPE_PIT_DEF 0x00800000 +#define ROD_TYPE_PIT_VULN 0x00800001 +#define ROD_TYPE_PIT_PERS 0x00800002 +#define ROD_TYPE_PIT_ANY 0x0080FFFF #define ROD_TYPE_BLOCK_ZERO 0xFFFF0001 uint8_t reserved[2]; uint8_t length[2]; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 13:48:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D013AC81; Sat, 20 Sep 2014 13:48:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB154CBF; Sat, 20 Sep 2014 13:48:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KDmqBe009530; Sat, 20 Sep 2014 13:48:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KDmqBs009529; Sat, 20 Sep 2014 13:48:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409201348.s8KDmqBs009529@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Sep 2014 13:48: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: r271904 - stable/10/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 13:48:52 -0000 Author: mav Date: Sat Sep 20 13:48:52 2014 New Revision: 271904 URL: http://svnweb.freebsd.org/changeset/base/271904 Log: MFC r271702: Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT DESCRIPTOR field as Identification Descriptor CSCD descriptor, not just as Identification Descriptor. Approved by: re (gjb) Modified: stable/10/sys/cam/ctl/ctl_tpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Sat Sep 20 13:46:16 2014 (r271903) +++ stable/10/sys/cam/ctl/ctl_tpc.c Sat Sep 20 13:48:52 2014 (r271904) @@ -1811,6 +1811,7 @@ tpc_create_token(struct ctl_lun *lun, st { static int id = 0; struct scsi_vpd_id_descriptor *idd = NULL; + struct scsi_ec_cscd_id *cscd; int targid_len; scsi_ulto4b(ROD_TYPE_AUR, token->type); @@ -1824,8 +1825,12 @@ tpc_create_token(struct ctl_lun *lun, st idd = scsi_get_devid_desc((struct scsi_vpd_id_descriptor *) lun->lun_devid->data, lun->lun_devid->len, scsi_devid_is_lun_eui64); - if (idd != NULL) - memcpy(&token->body[8], idd, 4 + idd->length); + if (idd != NULL) { + cscd = (struct scsi_ec_cscd_id *)&token->body[8]; + cscd->type_code = EC_CSCD_ID; + cscd->luidt_pdt = T_DIRECT; + memcpy(&cscd->codeset, idd, 4 + idd->length); + } scsi_u64to8b(0, &token->body[40]); scsi_u64to8b(len, &token->body[48]); if (port->target_devid) { From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 14:24:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3598F88C; Sat, 20 Sep 2014 14:24:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14D98A6; Sat, 20 Sep 2014 14:24:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KEOmve028023; Sat, 20 Sep 2014 14:24:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KEOmXZ028021; Sat, 20 Sep 2014 14:24:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409201424.s8KEOmXZ028021@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Sep 2014 14:24:48 +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: r271905 - in stable/10/sys: amd64/amd64 i386/i386 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 14:24:49 -0000 Author: kib Date: Sat Sep 20 14:24:48 2014 New Revision: 271905 URL: http://svnweb.freebsd.org/changeset/base/271905 Log: MFC r271716: Presence of any VM_PROT bits in the permission argument on x86 implies that the entry is readable and valid. Approved by: re (gjb) Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/i386/i386/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Sat Sep 20 13:48:52 2014 (r271904) +++ stable/10/sys/amd64/amd64/pmap.c Sat Sep 20 14:24:48 2014 (r271905) @@ -3845,7 +3845,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pt_entry_t *pte, PG_G, PG_M, PG_RW, PG_V; boolean_t anychanged, pv_lists_locked; - if ((prot & VM_PROT_READ) == VM_PROT_NONE) { + KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); + if (prot == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Sat Sep 20 13:48:52 2014 (r271904) +++ stable/10/sys/i386/i386/pmap.c Sat Sep 20 14:24:48 2014 (r271905) @@ -3161,7 +3161,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pt_entry_t *pte; boolean_t anychanged, pv_lists_locked; - if ((prot & VM_PROT_READ) == VM_PROT_NONE) { + KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); + if (prot == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 14:49:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0788ED0; Sat, 20 Sep 2014 14:49:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCA7E265; Sat, 20 Sep 2014 14:49:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KEnLbK037862; Sat, 20 Sep 2014 14:49:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KEnLkW037861; Sat, 20 Sep 2014 14:49:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409201449.s8KEnLkW037861@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 20 Sep 2014 14:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271906 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 14:49:22 -0000 Author: ian Date: Sat Sep 20 14:49:21 2014 New Revision: 271906 URL: http://svnweb.freebsd.org/changeset/base/271906 Log: Make the ARM MPCore Timer driver work with published standard FDT bindings. We've always considered the mpcore timers to be a single monolithic device and we defined our own fdt binding for it with our own compat string. The published bindings treat the timers as two separate devices, a global timer and a "timer-watchdog" device for the per-cpu private timers. Thus our binding has two tuples in the regs property, one set of registers for the global timer and one for the private timers. The published bindings have two separate devices, each with a single set of registers. (Note that we don't use the optional watchdog feature of the hardware.) These changes add the compat strings for the published bindings. If our own compat string appears, we expect to get two sets of memory resources. For the published bindings, there's only one set of memory resources, and only the private timers have an associated interrupt. The other major change is that there can no longer be a single global var for the softc pointer because now there may be multiple devices at runtime. Since the global timer is used only as a timecounter and the private timers only as eventtimers, and there will only be one of each, those are now the pointers which are global, and the priv fields of those structures backlink to the device softc. Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Sat Sep 20 14:24:48 2014 (r271905) +++ head/sys/arm/arm/mpcore_timer.c Sat Sep 20 14:49:21 2014 (r271906) @@ -97,36 +97,25 @@ __FBSDID("$FreeBSD$"); #define GBL_TIMER_INTR_EVENT (1UL << 0) struct arm_tmr_softc { - struct resource * tmr_res[4]; - bus_space_tag_t prv_bst; - bus_space_tag_t gbl_bst; - bus_space_handle_t prv_bsh; - bus_space_handle_t gbl_bsh; + device_t dev; + int irqrid; + int memrid; + struct resource * gbl_mem; + struct resource * prv_mem; + struct resource * prv_irq; uint64_t clkfreq; struct eventtimer et; }; -static struct resource_spec arm_tmr_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Global registers */ - { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Global timer interrupt (unused) */ - { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* Private (per-CPU) registers */ - { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Private timer interrupt */ - { -1, 0 } -}; - -static struct arm_tmr_softc *arm_tmr_sc = NULL; - -static uint64_t platform_arm_tmr_freq = 0; - -#define tmr_prv_read_4(reg) \ - bus_space_read_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg) -#define tmr_prv_write_4(reg, val) \ - bus_space_write_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg, val) -#define tmr_gbl_read_4(reg) \ - bus_space_read_4(arm_tmr_sc->gbl_bst, arm_tmr_sc->gbl_bsh, reg) -#define tmr_gbl_write_4(reg, val) \ - bus_space_write_4(arm_tmr_sc->gbl_bst, arm_tmr_sc->gbl_bsh, reg, val) - +static struct eventtimer *arm_tmr_et; +static struct timecounter *arm_tmr_tc; +static uint64_t arm_tmr_freq; +static boolean_t arm_tmr_freq_varies; + +#define tmr_prv_read_4(sc, reg) bus_read_4((sc)->prv_mem, reg) +#define tmr_prv_write_4(sc, reg, val) bus_write_4((sc)->prv_mem, reg, val) +#define tmr_gbl_read_4(sc, reg) bus_read_4((sc)->gbl_mem, reg) +#define tmr_gbl_write_4(sc, reg, val) bus_write_4((sc)->gbl_mem, reg, val) static timecounter_get_t arm_tmr_get_timecount; @@ -139,6 +128,21 @@ static struct timecounter arm_tmr_timeco .tc_quality = 800, }; +#define TMR_GBL 0x01 +#define TMR_PRV 0x02 +#define TMR_BOTH (TMR_GBL | TMR_PRV) +#define TMR_NONE 0 + +static struct ofw_compat_data compat_data[] = { + {"arm,mpcore-timers", TMR_BOTH}, /* Non-standard, FreeBSD. */ + {"arm,cortex-a9-global-timer", TMR_GBL}, + {"arm,cortex-a5-global-timer", TMR_GBL}, + {"arm,cortex-a9-twd-timer", TMR_PRV}, + {"arm,cortex-a5-twd-timer", TMR_PRV}, + {"arm,arm11mp-twd-timer", TMR_PRV}, + {NULL, TMR_NONE} +}; + /** * arm_tmr_get_timecount - reads the timecount (global) timer * @tc: pointer to arm_tmr_timecount struct @@ -152,7 +156,10 @@ static struct timecounter arm_tmr_timeco static unsigned arm_tmr_get_timecount(struct timecounter *tc) { - return (tmr_gbl_read_4(GBL_TIMER_COUNT_LOW)); + struct arm_tmr_softc *sc; + + sc = tc->tc_priv; + return (tmr_gbl_read_4(sc, GBL_TIMER_COUNT_LOW)); } /** @@ -172,11 +179,13 @@ arm_tmr_get_timecount(struct timecounter static int arm_tmr_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { + struct arm_tmr_softc *sc; uint32_t load, count; uint32_t ctrl; - tmr_prv_write_4(PRV_TIMER_CTRL, 0); - tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + sc = et->et_priv; + tmr_prv_write_4(sc, PRV_TIMER_CTRL, 0); + tmr_prv_write_4(sc, PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); ctrl = PRV_TIMER_CTRL_IRQ_ENABLE | PRV_TIMER_CTRL_TIMER_ENABLE; @@ -191,9 +200,9 @@ arm_tmr_start(struct eventtimer *et, sbi else count = load; - tmr_prv_write_4(PRV_TIMER_LOAD, load); - tmr_prv_write_4(PRV_TIMER_COUNT, count); - tmr_prv_write_4(PRV_TIMER_CTRL, ctrl); + tmr_prv_write_4(sc, PRV_TIMER_LOAD, load); + tmr_prv_write_4(sc, PRV_TIMER_COUNT, count); + tmr_prv_write_4(sc, PRV_TIMER_CTRL, ctrl); return (0); } @@ -210,8 +219,11 @@ arm_tmr_start(struct eventtimer *et, sbi static int arm_tmr_stop(struct eventtimer *et) { - tmr_prv_write_4(PRV_TIMER_CTRL, 0); - tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + struct arm_tmr_softc *sc; + + sc = et->et_priv; + tmr_prv_write_4(sc, PRV_TIMER_CTRL, 0); + tmr_prv_write_4(sc, PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); return (0); } @@ -227,13 +239,12 @@ arm_tmr_stop(struct eventtimer *et) static int arm_tmr_intr(void *arg) { - struct arm_tmr_softc *sc = (struct arm_tmr_softc *)arg; - - tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + struct arm_tmr_softc *sc; + sc = arg; + tmr_prv_write_4(sc, PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); - return (FILTER_HANDLED); } @@ -257,13 +268,98 @@ arm_tmr_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "arm,mpcore-timers")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == TMR_NONE) return (ENXIO); device_set_desc(dev, "ARM MPCore Timers"); return (BUS_PROBE_DEFAULT); } +static int +attach_tc(struct arm_tmr_softc *sc) +{ + int rid; + + if (arm_tmr_tc != NULL) + return (EBUSY); + + rid = sc->memrid; + sc->gbl_mem = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->gbl_mem == NULL) { + device_printf(sc->dev, "could not allocate gbl mem resources\n"); + return (ENXIO); + } + tmr_gbl_write_4(sc, GBL_TIMER_CTRL, 0x00000000); + + arm_tmr_timecount.tc_frequency = sc->clkfreq; + arm_tmr_timecount.tc_priv = sc; + tc_init(&arm_tmr_timecount); + arm_tmr_tc = &arm_tmr_timecount; + + tmr_gbl_write_4(sc, GBL_TIMER_CTRL, GBL_TIMER_CTRL_TIMER_ENABLE); + + return (0); +} + +static int +attach_et(struct arm_tmr_softc *sc) +{ + void *ihl; + int irid, mrid; + + if (arm_tmr_et != NULL) + return (EBUSY); + + mrid = sc->memrid; + sc->prv_mem = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &mrid, + RF_ACTIVE); + if (sc->prv_mem == NULL) { + device_printf(sc->dev, "could not allocate prv mem resources\n"); + return (ENXIO); + } + tmr_prv_write_4(sc, PRV_TIMER_CTRL, 0x00000000); + + irid = sc->irqrid; + sc->prv_irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &irid, RF_ACTIVE); + if (sc->prv_irq == NULL) { + bus_release_resource(sc->dev, SYS_RES_MEMORY, mrid, sc->prv_mem); + device_printf(sc->dev, "could not allocate prv irq resources\n"); + return (ENXIO); + } + + if (bus_setup_intr(sc->dev, sc->prv_irq, INTR_TYPE_CLK, arm_tmr_intr, + NULL, sc, &ihl) != 0) { + bus_release_resource(sc->dev, SYS_RES_MEMORY, mrid, sc->prv_mem); + bus_release_resource(sc->dev, SYS_RES_IRQ, irid, sc->prv_irq); + device_printf(sc->dev, "unable to setup the et irq handler.\n"); + return (ENXIO); + } + + /* + * Setup and register the eventtimer. Most event timers set their min + * and max period values to some value calculated from the clock + * frequency. We might not know yet what our runtime clock frequency + * will be, so we just use some safe values. A max of 2 seconds ensures + * that even if our base clock frequency is 2GHz (meaning a 4GHz CPU), + * we won't overflow our 32-bit timer count register. A min of 20 + * nanoseconds is pretty much completely arbitrary. + */ + sc->et.et_name = "MPCore"; + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; + sc->et.et_quality = 1000; + sc->et.et_frequency = sc->clkfreq; + sc->et.et_min_period = 20 * SBT_1NS; + sc->et.et_max_period = 2 * SBT_1S; + sc->et.et_start = arm_tmr_start; + sc->et.et_stop = arm_tmr_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + arm_tmr_et = &sc->et; + + return (0); +} + /** * arm_tmr_attach - attaches the timer to the simplebus * @dev: new device @@ -277,21 +373,19 @@ arm_tmr_probe(device_t dev) static int arm_tmr_attach(device_t dev) { - struct arm_tmr_softc *sc = device_get_softc(dev); + struct arm_tmr_softc *sc; phandle_t node; pcell_t clock; - void *ihl; - boolean_t fixed_freq; + int et_err, tc_err, tmrtype; - if (arm_tmr_sc) - return (ENXIO); + sc = device_get_softc(dev); + sc->dev = dev; - if (platform_arm_tmr_freq == ARM_TMR_FREQUENCY_VARIES) { - fixed_freq = false; + if (arm_tmr_freq_varies) { + sc->clkfreq = arm_tmr_freq; } else { - fixed_freq = true; - if (platform_arm_tmr_freq != 0) { - sc->clkfreq = platform_arm_tmr_freq; + if (arm_tmr_freq != 0) { + sc->clkfreq = arm_tmr_freq; } else { /* Get the base clock frequency */ node = ofw_bus_get_node(dev); @@ -305,66 +399,40 @@ arm_tmr_attach(device_t dev) } } - if (bus_alloc_resources(dev, arm_tmr_spec, sc->tmr_res)) { - device_printf(dev, "could not allocate resources\n"); - return (ENXIO); - } - - /* Global timer interface */ - sc->gbl_bst = rman_get_bustag(sc->tmr_res[0]); - sc->gbl_bsh = rman_get_bushandle(sc->tmr_res[0]); - - /* Private per-CPU timer interface */ - sc->prv_bst = rman_get_bustag(sc->tmr_res[2]); - sc->prv_bsh = rman_get_bushandle(sc->tmr_res[2]); - - arm_tmr_sc = sc; - - /* Disable both timers to start off */ - tmr_prv_write_4(PRV_TIMER_CTRL, 0x00000000); - tmr_gbl_write_4(GBL_TIMER_CTRL, 0x00000000); - - if (bus_setup_intr(dev, sc->tmr_res[3], INTR_TYPE_CLK, arm_tmr_intr, - NULL, sc, &ihl) != 0) { - bus_release_resources(dev, arm_tmr_spec, sc->tmr_res); - device_printf(dev, "Unable to setup the clock irq handler.\n"); - return (ENXIO); - } + tmrtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + tc_err = ENXIO; + et_err = ENXIO; /* - * If the clock is fixed-frequency, setup and enable the global timer to - * use as the timecounter. If it's variable frequency it won't work as - * a timecounter. We also can't use it for DELAY(), so hopefully the - * platform provides its own implementation. If it doesn't, ours will + * If we're handling the global timer and it is fixed-frequency, set it + * up to use as a timecounter. If it's variable frequency it won't work + * as a timecounter. We also can't use it for DELAY(), so hopefully the + * platform provides its own implementation. If it doesn't, ours will * get used, but since the frequency isn't set, it will only use the * bogus loop counter. */ - if (fixed_freq) { - tmr_gbl_write_4(GBL_TIMER_CTRL, GBL_TIMER_CTRL_TIMER_ENABLE); - arm_tmr_timecount.tc_frequency = sc->clkfreq; - tc_init(&arm_tmr_timecount); + if (tmrtype & TMR_GBL) { + if (!arm_tmr_freq_varies) + tc_err = attach_tc(sc); + else if (bootverbose) + device_printf(sc->dev, + "not using variable-frequency device as timecounter"); + sc->memrid++; + sc->irqrid++; + } + + /* If we are handling the private timer, set it up as an eventtimer. */ + if (tmrtype & TMR_PRV) { + et_err = attach_et(sc); } /* - * Setup and register the eventtimer. Most event timers set their min - * and max period values to some value calculated from the clock - * frequency. We might not know yet what our runtime clock frequency - * will be, so we just use some safe values. A max of 2 seconds ensures - * that even if our base clock frequency is 2GHz (meaning a 4GHz CPU), - * we won't overflow our 32-bit timer count register. A min of 20 - * nanoseconds is pretty much completely arbitrary. + * If we didn't successfully set up a timecounter or eventtimer then we + * didn't actually attach at all, return error. */ - sc->et.et_name = "MPCore"; - sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; - sc->et.et_quality = 1000; - sc->et.et_frequency = sc->clkfreq; - sc->et.et_min_period = 20 * SBT_1NS; - sc->et.et_max_period = 2 * SBT_1S; - sc->et.et_start = arm_tmr_start; - sc->et.et_stop = arm_tmr_stop; - sc->et.et_priv = sc; - et_register(&sc->et); - + if (tc_err != 0 && et_err != 0) { + return (ENXIO); + } return (0); } @@ -384,6 +452,8 @@ static devclass_t arm_tmr_devclass; EARLY_DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(mp_tmr, ofwbus, arm_tmr_driver, arm_tmr_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); /* * Handle a change in clock frequency. The mpcore timer runs at half the CPU @@ -404,10 +474,14 @@ void arm_tmr_change_frequency(uint64_t newfreq) { - if (arm_tmr_sc == NULL) - platform_arm_tmr_freq = newfreq; - else - et_change_frequency(&arm_tmr_sc->et, newfreq); + if (newfreq == ARM_TMR_FREQUENCY_VARIES) { + arm_tmr_freq_varies = true; + return; + } + + arm_tmr_freq = newfreq; + if (arm_tmr_et != NULL) + et_change_frequency(arm_tmr_et, newfreq); } /** @@ -424,12 +498,13 @@ arm_tmr_change_frequency(uint64_t newfre static void __used /* Must emit function code for the weak ref below. */ arm_tmr_DELAY(int usec) { + struct arm_tmr_softc *sc; int32_t counts_per_usec; int32_t counts; uint32_t first, last; /* Check the timers are setup, if not just use a for loop for the meantime */ - if (arm_tmr_sc == NULL || arm_tmr_timecount.tc_frequency == 0) { + if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) cpufunc_nullop(); /* Prevent gcc from optimizing @@ -438,6 +513,8 @@ arm_tmr_DELAY(int usec) return; } + sc = arm_tmr_tc->tc_priv; + /* Get the number of times to count */ counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1); @@ -452,10 +529,10 @@ arm_tmr_DELAY(int usec) else counts = usec * counts_per_usec; - first = tmr_gbl_read_4(GBL_TIMER_COUNT_LOW); + first = tmr_gbl_read_4(sc, GBL_TIMER_COUNT_LOW); while (counts > 0) { - last = tmr_gbl_read_4(GBL_TIMER_COUNT_LOW); + last = tmr_gbl_read_4(sc, GBL_TIMER_COUNT_LOW); counts -= (int32_t)(last - first); first = last; } From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 15:45:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82CDE10C; Sat, 20 Sep 2014 15:45:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8179AB; Sat, 20 Sep 2014 15:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KFjUpA066598; Sat, 20 Sep 2014 15:45:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KFjU8C066594; Sat, 20 Sep 2014 15:45:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409201545.s8KFjU8C066594@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 20 Sep 2014 15:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271907 - head/share/man/man4/man4.arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 15:45:30 -0000 Author: ian Date: Sat Sep 20 15:45:29 2014 New Revision: 271907 URL: http://svnweb.freebsd.org/changeset/base/271907 Log: Add a man page for the cgem(4) driver. Submitted by: Thomas Skibo Reviewed by: wkoszek@, Yonghyeon PYUN Added: head/share/man/man4/man4.arm/cgem.4 (contents, props changed) Modified: head/share/man/man4/man4.arm/Makefile Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Sat Sep 20 14:49:21 2014 (r271906) +++ head/share/man/man4/man4.arm/Makefile Sat Sep 20 15:45:29 2014 (r271907) @@ -1,11 +1,13 @@ # $FreeBSD$ -MAN= devcfg.4 \ +MAN= cgem.4 \ + devcfg.4 \ mge.4 \ npe.4 \ ti_adc.4 -MLINKS= mge.4 if_mge.4 +MLINKS= cgem.4 if_cgem.4 +MLINKS+= mge.4 if_mge.4 MLINKS+=npe.4 if_npe.4 MANSUBDIR=/arm Added: head/share/man/man4/man4.arm/cgem.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/cgem.4 Sat Sep 20 15:45:29 2014 (r271907) @@ -0,0 +1,297 @@ +.\" +.\" Copyright (c) 2014 Thomas Skibo +.\" 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. The name of the author may not 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. +.\" +.\" $FreeBSD$ +.\" +.Dd August 26, 2014 +.Dt CGEM 4 +.Os +.Sh NAME +.Nm cgem +.Nd "Cadence GEM Gigabit Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ether" +.Cd "device miibus" +.Cd "device cgem" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Cadence GEM (Gigabit Ethernet MAC). +The Cadence GEM is used in some SoC (System on a Chip) devices such as +the Xilinx Zynq-7000 and the Atmel SAMA5D3. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode using +.Xr ifconfig 8 +or by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either +.Cm full-duplex +or +.Cm half-duplex +modes. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +The +.Xr ifconfig 8 +.Cm mediaopt +option can also be used to select either +.Cm full-duplex +or +.Cm half-duplex +modes. +.It Cm 1000baseT +Set 1000Mbps (Gigabit Ethernet) operation over twisted pair. +The GEM supports 1000Mbps in +.Cm full-duplex +mode only. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full-duplex operation. +.It Cm half-duplex +Force half-duplex operation. +.El +.Pp +The driver provides support for TCP/UDP/IP checksum offloading (although +disabled by default). +The device and driver also support 1536-byte frames for VLANs (vlanmtu). +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxxxx" +.It Va dev.cgem.%d.rxbufs +The number of receive buffers allocated to the hardware. +The default value is 256. +The maximum value is 511. +If this number is increased while the interface is UP, it will not +take effect until the next packet is received. +If this number is decreased while the interface is UP, buffers will +not be immediately removed from the receive buffer ring but the +number of buffers will decrease as packets are received until it +reaches the new value. +.It Va dev.cgem.%d.rxhangwar +This tunable enables a work-around to recover from receive hangs. +The default value is 1. +Set to 0 to disable the work-around. +.El +.Pp +The following read-only variables are available as +.Xr sysctl 8 +variables: +.Bl -tag -width "xxxxxxxx" +.It Va dev.cgem.%d._rxoverruns +This variable counts the number of receive packet buffer overrun interrupts. +.It Va dev.cgem.%d._rxnobufs +This variable counts the number of interrupts due to the GEM buffer ring +going empty. +.It Va dev.cgem.%d._rxdmamapfails +This variable is the number of times bus_dmamap_load_mbuf_sg(9) failed in +the receive path. +.It Va dev.cgem.%d._txfull +The number of times the GEM's transmit ring was full. +.It Va dev.cgem.%d._txdmamapfails +This variable is the number of times bus_dmamap_load_mbuf_sg(9) failed in +the transmit path. +.It Va dev.cgem.%d._txdefrags +This variable is the number of times the driver needed to call m_defrag(9) +because a packet queued for transmit had too many DMA segments. +.It Va dev.cgem.%d._txdefragfails +This variable is the number of times +.Xr m_defrag 9 +failed. +.It Va dev.cgem.%d.stats.* +The following variables are useful MAC counters supplied by the hardware: +.It Va dev.cgem.%d.stats.tx_bytes +A 64-bit counter of the number of bytes transmitted in frames without error. +.It Va dev.cgem.%d.stats.tx_frames +Counter of frames transmitted without error excluding pause frames. +.It Va dev.cgem.%d.stats.tx_frames_bcast +Counter of broadcast frames transmitted without error excluding +pause frames. +.It Va dev.cgem.%d.stats.tx_frames_multi +Counter of multicast frames transmitted without error excluding +pause frames. +.It Va dev.cgem.%d.stats.tx_frames_pause +Counter of pause frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_64b +Counter of 64 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_65to127b +Counter of 65 to 127 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_128to255b +Counter of 128 to 255 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_256to511b +Counter of 256 to 511 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_512to1023b +Counter of 512 to 1023 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_frames_1024to1536b +Counter of 1024 to 1536 byte frames transmitted without error. +.It Va dev.cgem.%d.stats.tx_under_runs +Counter of frames not transmitted due to a transmit underrun. +.It Va dev.cgem.%d.stats.tx_single_collisn +Counter of frames experiencing a single collision before being successfully +transmitted. +.It Va dev.cgem.%d.stats.tx_multi_collisn +Counter of frames experiencing between 2 and 15 collisions before +being successfully transmitted. +.It Va dev.cgem.%d.stats.tx_excsv_collisn +Counter of frames that failed to transmit because they experienced 16 +collisions. +.It Va dev.cgem.%d.stats.tx_late_collisn +Counter of frames that experienced a late collision. +.It Va dev.cgem.%d.stats.tx_deferred_frames +Counter of frames experiencing deferral due to carrier sense being +active on their first attempt at transmission. +.It Va dev.cgem.%d.stats.tx_carrier_sense_errs +Counter of frames transmitted where carrier sense was not seen during +transmission or where carrier sense was deasserted after being asserted +in a transmit frame without collision. +.It Va dev.cgem.%d.stats.rx_bytes +A 64-bit counter of bytes received without error excluding pause +frames. +.It Va dev.cgem.%d.stats.rx_frames +Counter of frames received without error excluding pause frames. +.It Va dev.cgem.%d.stats.rx_frames_bcast +Counter of broadcast frames receive without error excluding pause frames. +.It Va dev.cgem.%d.stats.rx_frames_multi +Counter of multicast frames receive without error excluding pause frames. +.It Va dev.cgem.%d.stats.rx_frames_pause +Counter of pause frames recevied without error. +.It Va dev.cgem.%d.stats.rx_frames_64b +Counter of 64-byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_65to127b +Counter of 65 to 127 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_128to255b +Counter of 128 to 255 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_256to511b +Counter of 256 to 511 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_512to1023b +Counter of 512 to 1023 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_1024to1536b +Counter of 1024 to 1536 byte frames received without error. +.It Va dev.cgem.%d.stats.rx_frames_undersize +Counter of frames received less than 64 bytes in length that +do not also have either a CRC error or an alignment error. +.It Va dev.cgem.%d.stats.rx_frames_oversize +Counter of frames received exceeding 1536 bytes and do not also have either +a CRC error or an alignment error. +.It Va dev.cgem.%d.stats.rx_frames_jabber +Counter of frames received exceeding 1536 bytes and also have either a CRC +error, an alignment error, or a receive symbol error. +.It Va dev.cgem.%d.stats.rx_frames_fcs_errs +Counter of frames received with a bad CRC and are between 64 +and 1536 bytes. +.It Va dev.cgem.%d.stats.rx_frames_length_errs +Counter of frames received that are shorter than that extracted +from the length field. +.It Va dev.cgem.%d.stats.rx_symbol_errs +Counter of receive symbol errors. +.It Va dev.cgem.%d.stats.rx_align_errs +Counter of received frames that are not an integral number of bytes. +.It Va dev.cgem.%d.stats.rx_resource_errs +Counter of frames successfully receive by the MAC but could not be +copied to memory because no receive buffer was available. +.It Va dev.cgem.%d.stats.rx_overrun_errs +Counter of frames that are address recognized but were not copied +to memory due to a receive overrun. +.It Va dev.cgem.%d.stats.rx_frames_ip_hdr_csum_errs +Counter of frames discarded due to an incorrect IP header checksum when +checksum offloading is enabled. +.It Va dev.cgem.%d.stats.rx_frames_tcp_csum_errs +Counter of frames discarded due to an incorrect TCP checksum when +checksum offloading is enabled. +.It Va dev.cgem.%d.stats.rx_frames_udp_csum_errs +Counter of frames discarded due to an incorrect UDP checksum when +checksum offloading is enabled. +.El +.Sh BUGS +The GEM can perform TCP/UDP/IP checksum offloading. +However, when transmit checksum offloading is enabled, the GEM generates and +replaces checksums for all packets it transmits. +In a system that is forwarding packets, the device could potentially correct +the checksum of packet that was corrupted in transit. +For this reason, checksum offloading is disabled by default but can be +enabled using ifconfig(8). +.Pp +When receive checksum offloading is enabled, the device will discard packets +with bad TCP/UDP/IP checksums. +The bad packets will not be counted in any +.Xr netstat 1 +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 +"Known Issues" of the Zynq-7000 SoC Technical Reference Manual (Xilinx +UG585 v1.7). +The +.Nm +driver implements the work-around suggested in the manual. +If the bug does not exist in other versions of this device, the +work-around can be disabled by setting the dev.cgem.%d.rxhangwar +.Xr sysctl 8 +variable to 0. +.Pp +.Sh SEE ALSO +.Xr miibus 4 , +.Xr ifconfig 8 +.Rs +.%T "Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585)" +.%U http://www.xilinx.com/support/documentation/user_guides/\:ug585-Zynq-7000-TRM.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +driver and this manual page was written by +.An Thomas Skibo Aq Mt thomasskibo@yahoo.com . From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 16:43:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB9B9313; Sat, 20 Sep 2014 16:43:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB8EBE96; Sat, 20 Sep 2014 16:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KGhF5S095309; Sat, 20 Sep 2014 16:43:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KGhEnt095304; Sat, 20 Sep 2014 16:43:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409201643.s8KGhEnt095304@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Sep 2014 16:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271908 - in head/sys/netgraph/bluetooth: include 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 16:43:15 -0000 Author: jhb Date: Sat Sep 20 16:43:14 2014 New Revision: 271908 URL: http://svnweb.freebsd.org/changeset/base/271908 Log: Use callout(9) instead of timeout(9). Reviewed by: emax Modified: head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Modified: head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h Sat Sep 20 15:45:29 2014 (r271907) +++ head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h Sat Sep 20 16:43:14 2014 (r271908) @@ -162,7 +162,7 @@ struct ng_btsocket_l2cap_pcb { u_int16_t flush_timo; /* flush timeout */ u_int16_t link_timo; /* link timeout */ - struct callout_handle timo; /* timeout */ + struct callout timo; /* timeout */ u_int32_t token; /* message token */ ng_btsocket_l2cap_rtentry_p rt; /* routing info */ Modified: head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h Sat Sep 20 15:45:29 2014 (r271907) +++ head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h Sat Sep 20 16:43:14 2014 (r271908) @@ -296,7 +296,7 @@ struct ng_btsocket_rfcomm_pcb { int16_t tx_cred; /* TX credits */ struct mtx pcb_mtx; /* PCB lock */ - struct callout_handle timo; /* timeout */ + struct callout timo; /* timeout */ LIST_ENTRY(ng_btsocket_rfcomm_pcb) session_next;/* link to next */ LIST_ENTRY(ng_btsocket_rfcomm_pcb) next; /* link to next */ Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Sat Sep 20 15:45:29 2014 (r271907) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Sat Sep 20 16:43:14 2014 (r271908) @@ -1967,8 +1967,6 @@ ng_btsocket_l2cap_attach(struct socket * pcb->flush_timo = NG_L2CAP_FLUSH_TIMO_DEFAULT; pcb->link_timo = NG_L2CAP_LINK_TIMO_DEFAULT; - callout_handle_init(&pcb->timo); - /* * XXX Mark PCB mutex as DUPOK to prevent "duplicated lock of * the same type" message. When accepting new L2CAP connection @@ -1978,6 +1976,7 @@ ng_btsocket_l2cap_attach(struct socket * mtx_init(&pcb->pcb_mtx, "btsocks_l2cap_pcb_mtx", NULL, MTX_DEF|MTX_DUPOK); + callout_init_mtx(&pcb->timo, &pcb->pcb_mtx, 0); /* * Add the PCB to the list @@ -2664,8 +2663,8 @@ ng_btsocket_l2cap_timeout(ng_btsocket_l2 if (!(pcb->flags & NG_BTSOCKET_L2CAP_TIMO)) { pcb->flags |= NG_BTSOCKET_L2CAP_TIMO; - pcb->timo = timeout(ng_btsocket_l2cap_process_timeout, pcb, - bluetooth_l2cap_ertx_timeout()); + callout_reset(&pcb->timo, bluetooth_l2cap_ertx_timeout(), + ng_btsocket_l2cap_process_timeout, pcb); } else KASSERT(0, ("%s: Duplicated socket timeout?!\n", __func__)); @@ -2681,7 +2680,7 @@ ng_btsocket_l2cap_untimeout(ng_btsocket_ mtx_assert(&pcb->pcb_mtx, MA_OWNED); if (pcb->flags & NG_BTSOCKET_L2CAP_TIMO) { - untimeout(ng_btsocket_l2cap_process_timeout, pcb, pcb->timo); + callout_stop(&pcb->timo); pcb->flags &= ~NG_BTSOCKET_L2CAP_TIMO; } else KASSERT(0, @@ -2697,7 +2696,7 @@ ng_btsocket_l2cap_process_timeout(void * { ng_btsocket_l2cap_pcb_p pcb = (ng_btsocket_l2cap_pcb_p) xpcb; - mtx_lock(&pcb->pcb_mtx); + mtx_assert(&pcb->pcb_mtx, MA_OWNED); pcb->flags &= ~NG_BTSOCKET_L2CAP_TIMO; pcb->so->so_error = ETIMEDOUT; @@ -2731,8 +2730,6 @@ ng_btsocket_l2cap_process_timeout(void * "%s: Invalid socket state=%d\n", __func__, pcb->state); break; } - - mtx_unlock(&pcb->pcb_mtx); } /* ng_btsocket_l2cap_process_timeout */ /* Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Sat Sep 20 15:45:29 2014 (r271907) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Sat Sep 20 16:43:14 2014 (r271908) @@ -434,7 +434,7 @@ ng_btsocket_rfcomm_attach(struct socket pcb->rx_cred = RFCOMM_DEFAULT_CREDITS; mtx_init(&pcb->pcb_mtx, "btsocks_rfcomm_pcb_mtx", NULL, MTX_DEF); - callout_handle_init(&pcb->timo); + callout_init_mtx(&pcb->timo, &pcb->pcb_mtx, 0); /* Add the PCB to the list */ mtx_lock(&ng_btsocket_rfcomm_sockets_mtx); @@ -3451,8 +3451,8 @@ ng_btsocket_rfcomm_timeout(ng_btsocket_r if (!(pcb->flags & NG_BTSOCKET_RFCOMM_DLC_TIMO)) { pcb->flags |= NG_BTSOCKET_RFCOMM_DLC_TIMO; pcb->flags &= ~NG_BTSOCKET_RFCOMM_DLC_TIMEDOUT; - pcb->timo = timeout(ng_btsocket_rfcomm_process_timeout, pcb, - ng_btsocket_rfcomm_timo * hz); + callout_reset(&pcb->timo, ng_btsocket_rfcomm_timo * hz, + ng_btsocket_rfcomm_process_timeout, pcb); } else panic("%s: Duplicated socket timeout?!\n", __func__); } /* ng_btsocket_rfcomm_timeout */ @@ -3467,7 +3467,7 @@ ng_btsocket_rfcomm_untimeout(ng_btsocket mtx_assert(&pcb->pcb_mtx, MA_OWNED); if (pcb->flags & NG_BTSOCKET_RFCOMM_DLC_TIMO) { - untimeout(ng_btsocket_rfcomm_process_timeout, pcb, pcb->timo); + callout_stop(&pcb->timo); pcb->flags &= ~NG_BTSOCKET_RFCOMM_DLC_TIMO; pcb->flags &= ~NG_BTSOCKET_RFCOMM_DLC_TIMEDOUT; } else @@ -3483,7 +3483,7 @@ ng_btsocket_rfcomm_process_timeout(void { ng_btsocket_rfcomm_pcb_p pcb = (ng_btsocket_rfcomm_pcb_p) xpcb; - mtx_lock(&pcb->pcb_mtx); + mtx_assert(&pcb->pcb_mtx, MA_OWNED); NG_BTSOCKET_RFCOMM_INFO( "%s: Timeout, so=%p, dlci=%d, state=%d, flags=%#x\n", @@ -3510,8 +3510,6 @@ ng_btsocket_rfcomm_process_timeout(void } ng_btsocket_rfcomm_task_wakeup(); - - mtx_unlock(&pcb->pcb_mtx); } /* ng_btsocket_rfcomm_process_timeout */ /* From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 18:48:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FD2C4C0; Sat, 20 Sep 2014 18:48:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B3E8BF7; Sat, 20 Sep 2014 18:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KImpFY053311; Sat, 20 Sep 2014 18:48:51 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KImpDb053310; Sat, 20 Sep 2014 18:48:51 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409201848.s8KImpDb053310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 20 Sep 2014 18:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271909 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 18:48:51 -0000 Author: hrs Date: Sat Sep 20 18:48:50 2014 New Revision: 271909 URL: http://svnweb.freebsd.org/changeset/base/271909 Log: Revert changes in r269180. It could cause -c N option to enter an infinite loop if no reply packet is received. PR: 151023 Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sat Sep 20 16:43:14 2014 (r271908) +++ head/sbin/ping6/ping6.c Sat Sep 20 18:48:50 2014 (r271909) @@ -1090,14 +1090,8 @@ main(int argc, char *argv[]) /* signal handling */ if (seenalrm) { /* last packet sent, timeout reached? */ - if (npackets && ntransmitted >= npackets) { - struct timeval zerotime = {0, 0}; - itimer.it_value = zerotime; - itimer.it_interval = zerotime; - (void)setitimer(ITIMER_REAL, &itimer, NULL); - seenalrm = 0; /* clear flag */ - continue; - } + if (npackets && ntransmitted >= npackets) + break; retransmit(); seenalrm = 0; continue; From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 19:54:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB1F5589; Sat, 20 Sep 2014 19:54:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4DC926D; Sat, 20 Sep 2014 19:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KJsJfc086077; Sat, 20 Sep 2014 19:54:19 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KJsJnE086075; Sat, 20 Sep 2014 19:54:19 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409201954.s8KJsJnE086075@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sat, 20 Sep 2014 19:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271910 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 19:54:20 -0000 Author: hrs Date: Sat Sep 20 19:54:19 2014 New Revision: 271910 URL: http://svnweb.freebsd.org/changeset/base/271910 Log: Fix a problem that reply packets are not received when -i T option is set and (T < RTT). - Use select(2) for timeout instead of interval timer. Remove poll(2) support. - Use sigaction(2) instead of signal(3). - Exit in SIGINT handler when two signals are received and doing reverse DNS lookup as ping(8) does. - Remove redundant variables used for getaddrinfo(3). PR: 151023 Modified: head/sbin/ping6/Makefile head/sbin/ping6/ping6.c Modified: head/sbin/ping6/Makefile ============================================================================== --- head/sbin/ping6/Makefile Sat Sep 20 18:48:50 2014 (r271909) +++ head/sbin/ping6/Makefile Sat Sep 20 19:54:19 2014 (r271910) @@ -4,7 +4,7 @@ PROG= ping6 MAN= ping6.8 CFLAGS+=-DIPSEC -DKAME_SCOPEID -DUSE_RFC2292BIS \ - -DHAVE_POLL_H -DHAVE_ARC4RANDOM + -DHAVE_ARC4RANDOM WARNS?= 2 BINOWN= root Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sat Sep 20 18:48:50 2014 (r271909) +++ head/sbin/ping6/ping6.c Sat Sep 20 19:54:19 2014 (r271910) @@ -125,10 +125,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#ifdef HAVE_POLL_H -#include -#endif #ifdef IPSEC #include @@ -207,7 +205,6 @@ u_int options; int mx_dup_ck = MAX_DUP_CHK; char rcvd_tbl[MAX_DUP_CHK / 8]; -struct addrinfo *res = NULL; struct sockaddr_in6 dst; /* who to ping6 */ struct sockaddr_in6 src; /* src addr of this packet */ socklen_t srclen; @@ -223,12 +220,6 @@ u_int8_t nonce[8]; /* nonce field for n int hoplimit = -1; /* hoplimit */ int pathmtu = 0; /* path MTU for the destination. 0 = unspec. */ u_char *packet = NULL; -#ifdef HAVE_POLL_H -struct pollfd fdmaskp[1]; -#else -fd_set *fdmaskp = NULL; -int fdmasks; -#endif /* counters */ long nmissedmax; /* max value of ntransmitted - nreceived - 1 */ @@ -236,7 +227,7 @@ long npackets; /* max packets to trans long nreceived; /* # of packets we got back */ long nrepeats; /* number of duplicates */ long ntransmitted; /* sequence # for outbound packets = #sent */ -struct timeval interval = {1, 0}; /* interval between packets */ +int interval = 1000; /* interval between packets in ms */ /* timing */ int timing; /* flag to do timing */ @@ -253,7 +244,6 @@ struct msghdr smsghdr; struct iovec smsgiov; char *scmsg = 0; -volatile sig_atomic_t seenalrm; volatile sig_atomic_t seenint; #ifdef SIGINFO volatile sig_atomic_t seeninfo; @@ -265,7 +255,6 @@ int get_hoplim(struct msghdr *); int get_pathmtu(struct msghdr *); struct in6_pktinfo *get_rcvpktinfo(struct msghdr *); void onsignal(int); -void retransmit(void); void onint(int); size_t pingerlen(void); int pinger(void); @@ -293,19 +282,15 @@ void usage(void); int main(int argc, char *argv[]) { - struct itimerval itimer; - struct sockaddr_in6 from; + struct timeval last, intvl; + struct sockaddr_in6 from, *sin6; #ifndef HAVE_ARC4RANDOM struct timeval seed; #endif -#ifdef HAVE_POLL_H - int timeout; -#else - struct timeval timeout, *tv; -#endif - struct addrinfo hints; + struct addrinfo hints, *res; + struct sigaction si_sa; int cc, i; - int ch, hold, packlen, preload, optval, ret_ga; + int almost_done, ch, hold, packlen, preload, optval, error; int nig_oldmcprefix = -1; u_char *datap; char *e, *target, *ifname = NULL, *gateway = NULL; @@ -326,7 +311,7 @@ main(int argc, char *argv[]) char *policy_in = NULL; char *policy_out = NULL; #endif - double intval; + double t; size_t rthlen; #ifdef IPV6_USE_MIN_MTU int mflag = 0; @@ -450,22 +435,22 @@ main(int argc, char *argv[]) #endif break; case 'i': /* wait between sending packets */ - intval = strtod(optarg, &e); + t = strtod(optarg, &e); if (*optarg == '\0' || *e != '\0') errx(1, "illegal timing interval %s", optarg); - if (intval < 1 && getuid()) { + if (t < 1 && getuid()) { errx(1, "%s: only root may use interval < 1s", strerror(EPERM)); } - interval.tv_sec = (long)intval; - interval.tv_usec = - (long)((intval - interval.tv_sec) * 1000000); - if (interval.tv_sec < 0) + intvl.tv_sec = (long)t; + intvl.tv_usec = + (long)((t - intvl.tv_sec) * 1000000); + if (intvl.tv_sec < 0) errx(1, "illegal timing interval %s", optarg); /* less than 1/hz does not make sense */ - if (interval.tv_sec == 0 && interval.tv_usec < 1) { + if (intvl.tv_sec == 0 && intvl.tv_usec < 1) { warnx("too small interval, raised to .000001"); - interval.tv_usec = 1; + intvl.tv_usec = 1; } options |= F_INTERVAL; break; @@ -516,10 +501,10 @@ main(int argc, char *argv[]) hints.ai_socktype = SOCK_RAW; hints.ai_protocol = IPPROTO_ICMPV6; - ret_ga = getaddrinfo(optarg, NULL, &hints, &res); - if (ret_ga) { + error = getaddrinfo(optarg, NULL, &hints, &res); + if (error) { errx(1, "invalid source address: %s", - gai_strerror(ret_ga)); + gai_strerror(error)); } /* * res->ai_family must be AF_INET6 and res->ai_addrlen @@ -622,9 +607,9 @@ main(int argc, char *argv[]) hints.ai_socktype = SOCK_RAW; hints.ai_protocol = IPPROTO_ICMPV6; - ret_ga = getaddrinfo(target, NULL, &hints, &res); - if (ret_ga) - errx(1, "%s", gai_strerror(ret_ga)); + error = getaddrinfo(target, NULL, &hints, &res); + if (error) + errx(1, "%s", gai_strerror(error)); if (res->ai_canonname) hostname = res->ai_canonname; else @@ -647,28 +632,25 @@ main(int argc, char *argv[]) /* set the gateway (next hop) if specified */ if (gateway) { - struct addrinfo ghints, *gres; - int error; - - memset(&ghints, 0, sizeof(ghints)); - ghints.ai_family = AF_INET6; - ghints.ai_socktype = SOCK_RAW; - ghints.ai_protocol = IPPROTO_ICMPV6; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_RAW; + hints.ai_protocol = IPPROTO_ICMPV6; - error = getaddrinfo(gateway, NULL, &hints, &gres); + error = getaddrinfo(gateway, NULL, &hints, &res); if (error) { errx(1, "getaddrinfo for the gateway %s: %s", gateway, gai_strerror(error)); } - if (gres->ai_next && (options & F_VERBOSE)) + if (res->ai_next && (options & F_VERBOSE)) warnx("gateway resolves to multiple addresses"); if (setsockopt(s, IPPROTO_IPV6, IPV6_NEXTHOP, - gres->ai_addr, gres->ai_addrlen)) { + res->ai_addr, res->ai_addrlen)) { err(1, "setsockopt(IPV6_NEXTHOP)"); } - freeaddrinfo(gres); + freeaddrinfo(res); } /* @@ -898,7 +880,7 @@ main(int argc, char *argv[]) } if (argc > 1) { /* some intermediate addrs are specified */ - int hops, error; + int hops; #ifdef USE_RFC2292BIS int rthdrlen; #endif @@ -920,26 +902,25 @@ main(int argc, char *argv[]) #endif /* USE_RFC2292BIS */ for (hops = 0; hops < argc - 1; hops++) { - struct addrinfo *iaip; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; if ((error = getaddrinfo(argv[hops], NULL, &hints, - &iaip))) + &res))) errx(1, "%s", gai_strerror(error)); - if (SIN6(iaip->ai_addr)->sin6_family != AF_INET6) + if (res->ai_addr->sa_family != AF_INET6) errx(1, "bad addr family of an intermediate addr"); - + sin6 = (struct sockaddr_in6 *)(void *)res->ai_addr; #ifdef USE_RFC2292BIS - if (inet6_rth_add(rthdr, - &(SIN6(iaip->ai_addr))->sin6_addr)) + if (inet6_rth_add(rthdr, &sin6->sin6_addr)) errx(1, "can't add an intermediate node"); #else /* old advanced API */ - if (inet6_rthdr_add(scmsgp, - &(SIN6(iaip->ai_addr))->sin6_addr, + if (inet6_rthdr_add(scmsg, &sin6->sin6_addr, IPV6_RTHDR_LOOSE)) errx(1, "can't add an intermediate node"); #endif /* USE_RFC2292BIS */ - freeaddrinfo(iaip); + freeaddrinfo(res); } #ifndef USE_RFC2292BIS @@ -1055,52 +1036,46 @@ main(int argc, char *argv[]) printf("%s --> ", pr_addr((struct sockaddr *)&src, sizeof(src))); printf("%s\n", pr_addr((struct sockaddr *)&dst, sizeof(dst))); - while (preload--) /* Fire off them quickies. */ - (void)pinger(); - - (void)signal(SIGINT, onsignal); -#ifdef SIGINFO - (void)signal(SIGINFO, onsignal); -#endif - - if ((options & F_FLOOD) == 0) { - (void)signal(SIGALRM, onsignal); - itimer.it_interval = interval; - itimer.it_value = interval; - (void)setitimer(ITIMER_REAL, &itimer, NULL); - if (ntransmitted == 0) - retransmit(); - } - -#ifndef HAVE_POLL_H - fdmasks = howmany(s + 1, NFDBITS) * sizeof(fd_mask); - if ((fdmaskp = malloc(fdmasks)) == NULL) - err(1, "malloc"); -#endif - - seenalrm = seenint = 0; + if (preload == 0) + pinger(); + else { + if (npackets != 0 && preload > npackets) + preload = npackets; + while (preload--) + pinger(); + } + gettimeofday(&last, NULL); + + sigemptyset(&si_sa.sa_mask); + si_sa.sa_flags = 0; + si_sa.sa_handler = onsignal; + if (sigaction(SIGINT, &si_sa, 0) == -1) + err(EX_OSERR, "sigaction SIGINT"); + seenint = 0; #ifdef SIGINFO + if (sigaction(SIGINFO, &si_sa, 0) == -1) + err(EX_OSERR, "sigaction SIGINFO"); seeninfo = 0; #endif + if (options & F_FLOOD) { + intvl.tv_sec = 0; + intvl.tv_usec = 10000; + } else if ((options & F_INTERVAL) == 0) { + intvl.tv_sec = interval / 1000; + intvl.tv_usec = interval % 1000 * 1000; + } - for (;;) { + almost_done = 0; + while (seenint == 0) { + struct timeval now, timeout; struct msghdr m; struct iovec iov[2]; + fd_set rfds; + int n; /* signal handling */ - if (seenalrm) { - /* last packet sent, timeout reached? */ - if (npackets && ntransmitted >= npackets) - break; - retransmit(); - seenalrm = 0; - continue; - } - if (seenint) { + if (seenint) onint(SIGINT); - seenint = 0; - continue; - } #ifdef SIGINFO if (seeninfo) { summary(); @@ -1108,93 +1083,104 @@ main(int argc, char *argv[]) continue; } #endif + FD_ZERO(&rfds); + FD_SET(s, &rfds); + gettimeofday(&now, NULL); + timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec; + timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; + while (timeout.tv_usec < 0) { + timeout.tv_usec += 1000000; + timeout.tv_sec--; + } + while (timeout.tv_usec > 1000000) { + timeout.tv_usec -= 1000000; + timeout.tv_sec++; + } + if (timeout.tv_sec < 0) + timeout.tv_sec = timeout.tv_usec = 0; + + n = select(s + 1, &rfds, NULL, NULL, &timeout); + if (n < 0) + continue; /* EINTR */ + if (n == 1) { + m.msg_name = (caddr_t)&from; + m.msg_namelen = sizeof(from); + memset(&iov, 0, sizeof(iov)); + iov[0].iov_base = (caddr_t)packet; + iov[0].iov_len = packlen; + m.msg_iov = iov; + m.msg_iovlen = 1; + memset(cm, 0, CONTROLLEN); + m.msg_control = (void *)cm; + m.msg_controllen = CONTROLLEN; + + cc = recvmsg(s, &m, 0); + if (cc < 0) { + if (errno != EINTR) { + warn("recvmsg"); + sleep(1); + } + continue; + } else if (cc == 0) { + int mtu; - if (options & F_FLOOD) { - (void)pinger(); -#ifdef HAVE_POLL_H - timeout = 10; -#else - timeout.tv_sec = 0; - timeout.tv_usec = 10000; - tv = &timeout; -#endif - } else { -#ifdef HAVE_POLL_H - timeout = INFTIM; -#else - tv = NULL; -#endif - } -#ifdef HAVE_POLL_H - fdmaskp[0].fd = s; - fdmaskp[0].events = POLLIN; - cc = poll(fdmaskp, 1, timeout); -#else - memset(fdmaskp, 0, fdmasks); - FD_SET(s, fdmaskp); - cc = select(s + 1, fdmaskp, NULL, NULL, tv); -#endif - if (cc < 0) { - if (errno != EINTR) { -#ifdef HAVE_POLL_H - warn("poll"); -#else - warn("select"); -#endif - sleep(1); - } - continue; - } else if (cc == 0) - continue; - - m.msg_name = (caddr_t)&from; - m.msg_namelen = sizeof(from); - memset(&iov, 0, sizeof(iov)); - iov[0].iov_base = (caddr_t)packet; - iov[0].iov_len = packlen; - m.msg_iov = iov; - m.msg_iovlen = 1; - memset(cm, 0, CONTROLLEN); - m.msg_control = (void *)cm; - m.msg_controllen = CONTROLLEN; - - cc = recvmsg(s, &m, 0); - if (cc < 0) { - if (errno != EINTR) { - warn("recvmsg"); - sleep(1); - } - continue; - } else if (cc == 0) { - int mtu; - - /* - * receive control messages only. Process the - * exceptions (currently the only possibility is - * a path MTU notification.) - */ - if ((mtu = get_pathmtu(&m)) > 0) { - if ((options & F_VERBOSE) != 0) { - printf("new path MTU (%d) is " - "notified\n", mtu); + /* + * receive control messages only. Process the + * exceptions (currently the only possibility is + * a path MTU notification.) + */ + if ((mtu = get_pathmtu(&m)) > 0) { + if ((options & F_VERBOSE) != 0) { + printf("new path MTU (%d) is " + "notified\n", mtu); + } } + continue; + } else { + /* + * an ICMPv6 message (probably an echoreply) + * arrived. + */ + pr_pack(packet, cc, &m); } - continue; - } else { + if (((options & F_ONCE) != 0 && nreceived > 0) || + (npackets > 0 && nreceived >= npackets)) + break; + } + if (n == 0 || (options & F_FLOOD)) { + if (npackets == 0 || ntransmitted < npackets) + pinger(); + else { + if (almost_done) + break; + almost_done = 1; /* - * an ICMPv6 message (probably an echoreply) arrived. + * If we're not transmitting any more packets, + * change the timer to wait two round-trip times + * if we've received any packets or ten seconds + * if we haven't. */ - pr_pack(packet, cc, &m); - } - if (((options & F_ONCE) != 0 && nreceived > 0) || - (npackets > 0 && nreceived >= npackets)) - break; - if (ntransmitted - nreceived - 1 > nmissedmax) { - nmissedmax = ntransmitted - nreceived - 1; - if (options & F_MISSED) - (void)write(STDOUT_FILENO, &BBELL, 1); +#define MAXWAIT 10 + intvl.tv_usec = 0; + if (nreceived) { + intvl.tv_sec = 2 * tmax / 1000; + if (intvl.tv_sec == 0) + intvl.tv_sec = 1; + } else + intvl.tv_sec = MAXWAIT; + } + gettimeofday(&last, NULL); + if (ntransmitted - nreceived - 1 > nmissedmax) { + nmissedmax = ntransmitted - nreceived - 1; + if (options & F_MISSED) + (void)write(STDOUT_FILENO, &BBELL, 1); + } } } + sigemptyset(&si_sa.sa_mask); + si_sa.sa_flags = 0; + si_sa.sa_handler = SIG_IGN; + sigaction(SIGINT, &si_sa, 0); summary(); if (res != NULL) @@ -1203,11 +1189,6 @@ main(int argc, char *argv[]) if(packet != NULL) free(packet); -#ifndef HAVE_POLL_H - if(fdmaskp != NULL) - free(fdmaskp); -#endif - exit(nreceived == 0 ? 2 : 0); } @@ -1216,9 +1197,6 @@ onsignal(int sig) { switch (sig) { - case SIGALRM: - seenalrm++; - break; case SIGINT: seenint++; break; @@ -1231,38 +1209,6 @@ onsignal(int sig) } /* - * retransmit -- - * This routine transmits another ping6. - */ -void -retransmit(void) -{ - struct itimerval itimer; - - if (pinger() == 0) - return; - - /* - * If we're not transmitting any more packets, change the timer - * to wait two round-trip times if we've received any packets or - * ten seconds if we haven't. - */ -#define MAXWAIT 10 - if (nreceived) { - itimer.it_value.tv_sec = 2 * tmax / 1000; - if (itimer.it_value.tv_sec == 0) - itimer.it_value.tv_sec = 1; - } else - itimer.it_value.tv_sec = MAXWAIT; - itimer.it_interval.tv_sec = 0; - itimer.it_interval.tv_usec = 0; - itimer.it_value.tv_usec = 0; - - (void)signal(SIGALRM, onsignal); - (void)setitimer(ITIMER_REAL, &itimer, NULL); -} - -/* * pinger -- * Compose and transmit an ICMP ECHO REQUEST packet. The IP packet * will be added on by the kernel. The ID field is our UNIX process ID, @@ -2241,24 +2187,12 @@ tvsub(struct timeval *out, struct timeva void onint(int notused __unused) { - summary(); - - if (res != NULL) - freeaddrinfo(res); - - if(packet != NULL) - free(packet); - -#ifndef HAVE_POLL_H - if(fdmaskp != NULL) - free(fdmaskp); -#endif - - (void)signal(SIGINT, SIG_DFL); - (void)kill(getpid(), SIGINT); - - /* NOTREACHED */ - exit(1); + /* + * When doing reverse DNS lookups, the seenint flag might not + * be noticed for a while. Just exit if we get a second SIGINT. + */ + if ((options & F_HOSTNAME) && seenint != 0) + _exit(nreceived ? 0 : 2); } /* From owner-svn-src-all@FreeBSD.ORG Sat Sep 20 21:03:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6390D801; Sat, 20 Sep 2014 21:03:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A7C9AAB; Sat, 20 Sep 2014 21:03:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8KL31Ds019901; Sat, 20 Sep 2014 21:03:01 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8KL2sKP019851; Sat, 20 Sep 2014 21:02:54 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409202102.s8KL2sKP019851@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 20 Sep 2014 21:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271911 - in head: etc/mtree usr.bin/mkimg usr.bin/mkimg/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.18-1 Precedence: list List-Id: "SVN commit messages 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, 20 Sep 2014 21:03:01 -0000 Author: marcel Date: Sat Sep 20 21:02:54 2014 New Revision: 271911 URL: http://svnweb.freebsd.org/changeset/base/271911 Log: Add unit tests for mkimg(1): Added: head/usr.bin/mkimg/tests/ head/usr.bin/mkimg/tests/Makefile (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-apm.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-apm.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-bsd.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-ebr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-ebr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-mbr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-pc98.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-apm.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-apm.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-apm.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-apm.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-bsd.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-bsd.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-bsd.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-ebr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-ebr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-ebr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-mbr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-mbr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-mbr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-pc98.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-pc98.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-pc98.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-apm.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-apm.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-apm.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-bsd.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-bsd.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-ebr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-ebr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-mbr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-mbr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-pc98.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-apm.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-apm.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-apm.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-apm.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-bsd.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-bsd.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-bsd.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-ebr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-ebr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-ebr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-mbr.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-mbr.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-mbr.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-pc98.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-pc98.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-pc98.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.raw.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhd.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdf.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vmdk.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/mkimg.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/mkimg/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sat Sep 20 19:54:19 2014 (r271910) +++ head/etc/mtree/BSD.tests.dist Sat Sep 20 21:02:54 2014 (r271911) @@ -253,6 +253,8 @@ .. m4 .. + mkimg + .. ncal .. printf Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Sat Sep 20 19:54:19 2014 (r271910) +++ head/usr.bin/mkimg/Makefile Sat Sep 20 21:02:54 2014 (r271911) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 @@ -29,4 +31,8 @@ LDADD= -lutil WARNS?= 6 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.bin/mkimg/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/Makefile Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/mkimg + +ATF_TESTS_SH= mkimg + +SOURCES!= cd ${.CURDIR}; echo *.uu +FILES= ${SOURCES:S,.gz.uu,,g} +FILESDIR= ${TESTSDIR} + +${FILES}: + uudecode -p ${.CURDIR}/${.TARGET}.gz.uu | gunzip -c > ${.TARGET} + +rebase: + (cd ${.CURDIR}; atf-sh mkimg.sh rebase) + +.include Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.raw.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.raw.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,12 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-apm.raw.gz +M'XL(".W%'50``VEM9RTQ>#$M-#`Y-BUA<&TN6#-2,^JH4 +MR/L%LWH;`CW.Z2,.S5RJ3R@Y2]]3UWVU$SB1ZW,]KAJKD]OS.P>T@":HQW"J +M+53KRD'=IJN/I]UI=]AO(HXL3C6N6?]'W7?=3:J3F6=+,V>[B$L9@/W9(NJC +MW+M'YW$H9[P=A$T2D!6((!HK7+J:O8^`RV/;/J]?'CZ6Z]0_HLSZU`S_1.*? +M_TE2_Y#J4[G]4S?]TQ6TGMC-BW\_OWX1H[[,_G$6_&/UQ'F]8%9E__%`"L!L +."DDX8/$'F8$ZXZ<%```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhd.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhd.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,18 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-apm.vhd.gz +M'XL(".W%'50``VEM9RTQ>#$M-#`Y-BUA<&TN=FAD+F]U=`"M5EUOVR`4?<^O +MN-+>*BT"#+A[7-7F;5*U:L\M#N=^ +M`"'N`9`-R!ZD!BEPW'*0WZ"]!C"3OC';4_\*A^[M57?[S%`Z,DM1J: +MHSUK@)M%6F`*%Y%K',,AP"R_W#U?;5Z>`QSS<&%A+H$S$`:$3]:1Y,@.D58W +M#[<6\BFR:Z;LHI7Y_^9`.%":?-$$=D]'CD\[ +M/>+'"J$BC_SH9*XI;Y?Y4&'A8\^`8SC/;1'P,<%BHLM1;Q='8O:IME)RK[5I_HV^LD3\C$ +MMQ#XZ=JQIZT[)`J/)Z2(9Q!;&^("Y\S[!'#UKK4YA;[^6CVD^FE>EQ\E)^C' +M$OU'29N)S:C?[J\+Q,"OMG[*ZT=4IB]/'.Z7PY\# +M9+Z85JO.+%:_.@RY!ZS&D,<NJ*WW)JG351;B*5UV$JWK5E;:@+OX!7ZN]MA\-```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,15 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-apm.vhdf.gz +M'XL(".W%'50``VEM9RTQ>#$M-#`Y-BUA<&TN=FAD9BYO=70`K571:L(P%'WW +M*R[L35A)DYM;][@Q?1O(9,]:;2N%J<4)VT,_?DF3V-16<2/I)23,NXEZ_G8):.`T/XPA83IH`R3OXO=<59_Y`!P/M5T#)_KL9-&,8X"$0X)` +M3[:G`BC7:G/R%W2ZM!MG)P-[BG=Y.[(!;P*ZW +MX/AAZ+.'C1VDA5=&J$`.4@`B\$P1ESJGYCW`V3'/7Q:OCQ^SA:\?8F!^=(=^ +MW-//7!)?/_#Y46C]Z*9^B8`D&3B;K7Y?W^8@.GZ!]8N9U8^E`_WU1#V/NH\! +M1`L8C"'9ZDS"WG4MHG`U8.(#\M;>!G!SV.>;4_GCWV"RU;DHAD.OYT+_"R@! +MGC8E)M-CC]_#=#LN=UL'YZJ?^[#R^FSQY2ZIN]V9,KB!7+7L1%\D\M5;(S"$ +M..YLW+);^>H9.#QO-B]@+1N:+CJ33F*P-FNXIOKY+__76P-'@8^*^E&.?@&@ +'6R\`T@<````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.vmdk.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.vmdk.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,82 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-apm.vmdk.gz +M'XL(".[%'50``VEM9RTQ>#$M-#`Y-BUA<&TN=FUD:RYO=70`K9Q;;]S($87? +M_2L([\LB0`2>X?W!0-:1#03!`L9ZDSQN>(V%V)8@"4D,S(\/F^S3.I1$-[$J +M[V@YY:FJZ:X>E>2O#IBFZY\DR;LDSY-\2(HR29',?[4^DC1[,.;'J>8+Y[]> +M_OSW"_[Y\>+B_&I-!AF!^G:+K,175/`GVZ +MT\X+N^GR^<73UN]GNK^\,K7SRWOLRM83[> +MLDFJ+"D[;R9EL=A94IV6U]*DFIVF.>$/R>75W;^3R_&NO[VZN;_VZSNYLYV= +M\]+YE[W+,&^L*MT3]X)+U[@4Y9AD0Y+!O9R<;]]??1XO_C/>WEU=?WT#;O?D +MSC;/DKQQRW'^Z<-C8[@W29,2[CV2\Y__ +MLDSDR).J29;E%"[W:7YY\%M>:M?? +MCNW]^.NWF_'-ZR_77T/MW-FZDC5+HGHI5)84F4OEM^;*5[B,[F.SG%IR_GQU +M_^FJ_SAO\VY\??%#PG2EJ]U\@+5?U[KK.:3=W_[N?]YL,_F2OF&Y9 +MQ+*)^;V+4U)4+M=\@,M1G)(L=\_FOYH7/.\DAW-*SM=?+W[YQ_PM[HKU\<-/ +MOS!=/4?-GO,"YY!Y0YL]%>O^B\M\G;]FZ\^.'R\FTXV=9M-E\>\])&EZ5<4[O/ +M]U+.N7#K2:\'O1S%,'07[=#>W(^W[GC#472N1(/?J3O6_.$8M^]3+2'JBUY[WRZ +M+/4M(/.M;%.BL)SU#:6!COW]]>VZL-?2C[/'/\M>VH_S)S]2J]^9<$UGO;XR +M??3S+-.X7(QBD]#]%$OGKS_-7Q\>UE>Z]97B66E4+4:S2??/.<7-T^V6[KNP +M%<].HWHQAB/5*UUK&\5S>EP]_JH!>;Z?CK\+T#/3J%R,8I-NKW:%KQT]*XVJ +MQ6@VZ?9J5_K:T;/3J%Z,X=!F*U\[>DX:Y2[\50KI@5_+RMK7CIZ91N5B%)MT +M>[5K?.WH66E4+4:S2;=7N];7CIZ=1O5B#(-F4;D8Q2;=7NW8[^A9:50M1K-)MU<[ +M]CMZ=AK5BS$IK1\],HW(QBDVZG=K5['?TK#2J +M%J/9I-NI7F8:E8M1;-+MU8[] +MCIZ51M5B-)MT>[5COZ-GIU&]&,.AS;+?T7/2*'?AOY\@S_?3L=_1,].H7(QB +MDVZO=NQW]*PTJA:CV:3;JQW['3T[C>K%&`YMEOV.GI-&N0OY(^3Y?CKV.WIF +M&I6+46S2[=6._8Z>E4;58C2;='NU8[^C9Z=1O1C#H_H.6F4 +MNPQ2NR&:COV.GIE&Y6(4FW1[M6._HV>E4;48S2;=7NW8[^C9:50OQG!HL^QW +M])PTREU&J=T83<=^1\],HW(QBDVZO=JQW]&STJA:C&:3;J]V['?T[#2J%V,X +MM%GV.WI.&N4ND]1NBJ9COZ-GIE&Y&,4FW5[MV._H66E4+4:S2;=7._8[>G8: +MU8LQ'-HL^QT])XU*97H&>;Z;KDW7V@7/3*-R,8I-NIW:M;[?!<]*HVHQFDVZ +MG=JUOM\%STZC>C&&0YOU_2YX3AKE2B;\#E&DU?I^!^%W4'X'X7>(\KO6]SL( +MOX/R.PB_0Y3?M;[?0?@=E-]!^-V!S?I^!^%W4'X'X7>((JW6]SL(OX/R.PB_ +M0Y3?M;[?0?@=E-]!^!VB_*[U_0["[Z#\#L+O#FS6]SL(OX/R.PB_0Q1IM;[? +M0?@=E-]!^!VB_*[U_0["[Z#\#L+O$.5WK>]W$'X'Y7<0?G=@L[[?0?@=E-]! +M^!VB2*M+?>V$WT'Y'83?(^$WT'Y'83?(8JT.O8[X7=0?@?A=XCRNX[]3O@=E-]!^!VB_*YCOQ-^ +M!^5W$'YW8+/L=\+OH/P.PN\015H=^YWP.RB_@_`[1/E=QWXG_`[*[R#\#E%^ +MU['?";^#\CL(OSNP6?8[X7=0?@?A=X@BK3[UM1-^!^5W$'Z'*+_KV>^$WT'Y +M'83?(O8[X7=0?@?A=P^$WT'Y'83? +M(O8[X7=0?@?A=XCRNY[]3O@=E-]!^-V!S;+?";^#\CL(OT,4:?7L=\+O +MH/P.PN\0Y7<]^YWP.RB_@_`[1/E=SWXG_`[*[R#\[L!FV>^$WT'Y'83?(8JT +MAM373O@=E-]!^!VB_&Y@OQ-^!^5W$'Z'*+\;V.^$WT'Y'83?'=@L^YWP.RB_ +M@_`[1)'6P'XG_`[*[R#\#E%^-[#?";^#\CL(OT.4WPWL=\+OH/P.PN\.;);] +M3O@=E-]!^!VB2&M@OQ-^!^5W$'Z'*+\;V.^$WT'Y'83?(2[IDO7+IQO3M7;/2LJ?^:M0N^39U8W&^D`L +M^L`P4UAW]?L2KNFLUQ?FVWR\2+^(,-_FXT7Z183Y-A\OTB\BS+?Y>)%^$6&^ +M;:)?1)AOF^@7$>;;)OI%A/FVB7X18;YMHE]$F&^;Z!<1YMLF^D6$^;:)?A%A +MOFVB7T28;YOH%Q'FVR;Z183YMHE^$6&^;:)?1)AOF^@7$>;;)OI%A/FVB7X1 +M8;YMHE]$F&^;Z!<1YMLF^D6$^;:)?A%AOFVB7T28;YOH%Q'FVR;Z183YMHE^ +M$6&^;:)?1)AOF^@7$>;;)OI%A/FVB7X1G&_;Z!?!^;:-?A&<;]OH%\'YMHU^ +M$9QOV^@7P?FVC7X1G&_;Z!?!^;:-?A&<;]OH%\'YMHU^$9QOV^@7P?FVC7X1 +MG&_;Z!?!^;:-?A&<;]OH%\'YMHU^$9QOV^@7P?FVC7X1G&_;Z!?!^;:-?A&< +M;]OH%\'YMHU^$9QOV^@7P?FVC7X1G&_;Z!?!^;:-?A&<;]OH%\'YMHU^$9QO +MV^@7P?FVC7X1G&_;Z!?!^;:-?A%AODW/%^D7$>;;]'R1?A%AODW/%^D7$>;; +M]'R1?A%AOFVB7T28;YOH%Q'FVR;Z183YMHE^$6&^;:)?1)AOF^@7$>;;)OI% +MA/FVB7X18;YMHE]$F&^;Z!<1YMLF^D6$^;:)?A%AOFVB7T28;YOH%Q'FVR;Z +M183YMHE^$6&^;:)?1)AOF^@7$>;;)OI%A/FVB7X18;YMHE]$F&^;Z!<1YMLF +M^D6$^;:)?A%AOFVB7T28;YOH%Q'FVR;Z183YMHE^$9QOV^@7,9KJ%S&:ZAP@?3/=WLJ@_, +ME_7EA;MWJ=[K=[VK\7<2OOO%I?GQT?IR\_4M]^MUMU<=GL1EFA#;%\X??GZN +M?OERO]Y\N:VINXWI>K_>`^O[Z>;F\_A,NB?W8OZ]VUW394]75TS^1K_+G3MS +MWBV7]Q0N)J[NMYOV]O[J_NKZZV],M]RO=_"W<3V^NB_MS;.K,[X7?+<92\WW'A[J);+'?4/0WSP@OW6I$]3?C^=AS??KS\ +MX]_>?]3ZY;GQ^LH#]5-IR/I-HO5+='W6VN.\_&[]JBRIJF<^FP_UN_OO^D'D +J^HSK5Z2^?N[^SD_^O__"^X3FJTP=S>?35_]'S/@3HZ37@`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-bsd.raw.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-bsd.raw.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,10 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-bsd.raw.gz +M'XL(".[%'50``VEM9RTQ>#$M-#`Y-BUB)W-9:9S8V(RC/=PB6![!-2XK +MB+1J22ZXE&/"U9Y5KSB54V<1^/ZK6%WJ[N;>=IN\L,^`'\`!L/,^XL"EO[#J +MN\0RB)6;T0=QN;W#M3Q>!CC:*1CV4[&P#$M-#`Y-BUB?T)1?GU5Y/EY6^FD6'8PSV\HU)WM, +M0*A),L"")I%[:D-C,*N'S6%Y_#@8'&J1X:P3?-V]3ZUL& +MTN6/NZ/$:[A>,+\%E^B]:U&2`1?JZ'!,L]B`$W/J*&>JNYQ-(R=SF8_L['4& +M7@/?`\NMK+:`_?K"H._1EX&.NS/ZP'>W(%SFCN<6#J^X"RYN-[NV\^J8KZZ, +MO!C[\<2Q-VY'0[C'@38GBPJ`]4HOPYW-"\K]^V`J(^J:&)`D7\2))N*@7 +02:G^(C"V^`74/'YQ?0P````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,13 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-bsd.vhdf.gz +M'XL("._%'50``VEM9RTQ>#$M-#`Y-BUBJW6G2=-VJX%"E4/W2X[[)`?OQ@"Q'RUFPA1!'+\\-I.+$0[ +M`+0"D<^LRP9[B/ECHUW4T!0!30K:@$'(W'8Q3/;!#/;C^!Z'PWJ<7/-:QL6C +MT>'4/5PO6#Z"2\A+,DHRX)8,+4YXEAAP>DV=RX2H_A2LV2IW76VSD5]89Y`U +MR#.(S-L4!_;UA4'??BI#L7!7],$TW)QP*=\O`YRZ$RYP7+%:VW5U8JJNW+@8 +MR?AF/'AS"<)O;HM3VS8"U706=P+=KNFZ;+"O,7]:H/;`S3*(OO=A`E@#5H"& +MWE,-N('MND*=!73)-$H;9*S0(#5*RP+VZ$S_. +IA--]L%4-A6ED=I-],,-LJR*<$2.O_]:VQ>'&1\4=ON@7D=A:0S`'```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vmdk.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-bsd.vmdk.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,81 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-bsd.vmdk.gz +M'XL("._%'50``VEM9RTQ>#$M-#`Y-BUB[P^'\9@D&YR4N2#6<+%;/JP>FVS$:+G->[86C#W?< +M>&`S7#X]>'S.A;L[S0_W[D+")2%0L@I7/)/39K(O[>Y/;WSQW/XRMX?I>,LF +MJ;*D;/TR*8MYG275<7XL3:K):)P"ODVN;^[_DUP/]]W=S8^'6[^_HSO;R3@O +MG7W9N0A38E7I+MP#+ESC0I1#DO5)!O=P[^YO;[>S#=HSO; +M/$ORQFW'V:>/M]7"/4F:E'#/D9S_^O?K]_Z5FQY^G.X8SGE-&YF>>\I#XY9E +MXKXO;_/NAN\/+N+HO\+NW-GZXA3S<^?NHLB3JDGF[10N]G%ZN/RF4\M.7^]>?AR +MTWV>TKP?K@YO$X8K7>VF`ZS]OI:L)Y=R\V2G;9\__N]ARC?I_,-R\B3F) +MZ;F+8U)4+M9T@/-1'),L=U?3/TT;GC+)X8R2\^WWPR^_3V]Q5ZS/G_[R"\/5 +MD]=D.6UPWW](9SLR26;S[=I:X.+4BZAW>M[+N=4 +MN.6DEX.>CZ+OV\.I/_UX&.[<\8:C:%V)>I^I.];\\1C7SU/-)S6Z5TQR?I]< +MW?33F;JP_QYNOS%X?JE=M-VEM-\/,SI`*<=/KO!J797\ZF&[3'VT_SB]^I%9_,.`2SGI_9?KDYUFF +M?KDLBE5`]U,LG;[_/'U_>MQ?Z?97BF6E7K4LFE6X?TTA?ERF6[IWX4DL6_7J +M9-'OJ5[I6ML@EN/3ZO%7#.EJUZ=;+H=R7;^MK1#M?YVM$R4Z]< +M%L4JW%;M>E\[6E;J5[RZ5V>2Q< +ME?K:T3)3KUP6Q2K<1NTJ]CM:5NI5RZ)9A=NH7<5^1\M6O3I9]+N29;^CY:A> +M[JZ0VA71<.QWM,S4*Y=%L0JW53OV.UI6ZE7+HEF%VZH=^QTM6_7J9-'O2I;] +MCI:C>KF[4FI71L.QW]$R4Z]<%L4JW%;MV.]H6:E7+8MF%6ZK=NQWM&S5JY-% +MORM9]CM:CNKE[OA+$.1Z.QS['2TS]#L=^1\M,O7)9%*MP +M6[5COZ-EI5ZU+)I5N*W:L=_1LE6O3A;]KF39[V@YJI>[(W^$7&^'8[^C9:9> +MN2R*5;BMVK'?T;)2KUH6S2K<5NW8[VC9JEUHF:E7+HMB%6ZC=@W['2TK]:IET:S";=2N8;^C9:M>G2SZ7G6RZ'+?E>R['>T'-4KE>D9Y'HSW"E=:A^$WT'Y'83?[4B6 +M_4[X'93?0?@=HDBK9;\3?@?E=Q!^ARB_:]GOA-]!^1V$WR'*[UKV.^%W4'X' +MX7<[DF6_$WX'Y7<0?H^$WT'Y'83?(8JT6O8[X7=0?@?A=XCRNY;]3O@=E-]!^!VB +M_*YEOQ-^!^5W$'ZW(UGV.^%W4'X'X7>((JTN];43?@?E=Q!^ARB_Z]COA-]! +M^1V$WR'*[SKV.^%W4'X'X7<[DF6_$WX'Y7<0?H^$WT'Y'83?(8JT.O8[X7=0?@?A +M=XCRNX[]3O@=E-]!^!VB_*YCOQ-^!^5W$'ZW(UGV.^%W4'X'X7>((JV._4[X +M'93?0?@=HORN8[\3?@?E=Q!^ARB_Z]COA-]!^1V$W^U(EOU.^!V4WT'X':)( +MJT]][83?0?D=A-\ARN]Z]COA=U!^!^%WB/*[GOU.^!V4WT'XW8YDV>^$WT'Y +M'83?(8JT>O8[X7=0?@?A=XCRNY[]3O@=E-]!^!VB_*YGOQ-^!^5W$'ZW(UGV +M.^%W4'X'X7>((JV>_4[X'93?0?@=HORN9[\3?@?E=Q!^ARB_Z]GOA-]!^1V$ +MW^U(EOU.^!V4WT'X':)(JV>_$WX'Y7<0?H7/_%.H7?+L[@9C?2!F +M?6"8*2Q9_;&`2SCK_87Y-F^OTB\BS+=Y>Y5^$6&^S=NK](L(\VW>7J5?1)AO +MF^@7$>;;)OI%A/FVB7X18;YMHE]$F&^;Z!<1YMLF^D6$^;:)?A%AOFVB7T28 +M;YOH%Q'FVR;Z183YMHE^$6&^;:)?1)AOF^@7$>;;)OI%A/FVB7X18;YMHE]$ +MF&^;Z!<1YMLF^D6$^;:)?A%AOFVB7T28;YOH%Q'FVR;Z183YMHE^$6&^;:)? +M1)AOF^@7$>;;)OI%A/FVB7X18;YMHE\$Y]LV^D5POFVC7P3GVS;Z17"^;:-? +M!.?;-OI%<+YMHU\$Y]LV^D5POFVC7P3GVS;Z17"^;:-?!.?;-OI%<+YMHU\$ +MY]LV^D5POFVC7P3GVS;Z17"^;:-?!.?;-OI%<+YMHU\$Y]LV^D5POFVC7P3G +MVS;Z17"^;:-?!.?;-OI%<+YMHU\$Y]LV^D5POFVC7P3GVS;Z17"^;:-?!.?; +M-OI%<+YMHU\$Y]LV^D5POFVC7T28;]/R5?I%A/DV+5^E7T28;]/R5?I%A/DV +M+5^E7T28;YOH%Q'FVR;Z183YMHE^$6&^;:)?1)AOF^@7$>;;)OI%A/FVB7X1 +M8;YMHE]$F&^;Z!<1YMLF^D6$^;:)?A%AOFVB7T28;YOH%Q'FVR;Z183YMHE^ +M$6&^;:)?1)AOF^@7$>;;)OI%A/FVB7X18;YMHE]$F&^;Z!<1YMLF^D6$^;:) +M?A%AOFVB7T28;YOH%Q'FVR;Z183YMHE^$6&^;:)?!.?;-OI%#*;Z10RF^D4, +MIOI%#*;Z10RF^D4,IOI%#*;Z10RF^D4,IOI%#*;Z10RF^D4,IOI%#*;Z10RF +M^D4,IOI%C&EJJ%_$:*I?Q&BJ7\1HJE_$:*I?Q&BJ7\1HJE_$:*I?Q&BJ7\1H +MJE_$:*I?Q&BJ7\1HJE_$:*I?Q&BJ7\1HJE\\IFEJJ%\\7GR6\,YPE\DN^L!\ +MWM_RZ:"7?V\_6<.]\K'>/X?*7=J=SBGW)&G]X^ +M>+8O[^[=Y>XZX\.X^"C6G>]<%V3]SEW"'6T;03EWEF7X?_GW]@/G3X?UGR5@ +-/@=\\W^I>^KAH%T````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-ebr.raw.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-ebr.raw.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,11 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-ebr.raw.gz +M'XL("._%'50``VEM9RTQ>#$M-#`Y-BUE8G(N8PL.M6@1;7DA<=H*7D\$&+<0?'&2"/ZSNYN&_N<+MC0"E!J0#X&O6A +M\1((3*WL<8.^E_Z<]`D#E!4("?(*->X-^/-XKZ5#\%S_S^)P"S<)YGMP%^/E +MG'0K(V[0K"A#YSR"[.^6R@# +MO7`3^B`,5QE#$M-#`Y-BUE8G(N=FAD+F]U=`"METU3PR`0AN_] +M%>MX\]"!#6S:JZ.>G7'4JVE,'`]^C'KPD!\O!$@@"=@H34J3@7WR[K)L*&/F +M`T`%4`O4`$E]70J@/90[`-5I3^Q;;F^AJ]]>F_KK^7MK/]W&P#CSK4)S;8\% +M"/60$K#2#Z%'?0V=PVQ/+Y_.GE^>'`XMSCU8$`@$J2!B]AQB@SI-NCJ_N>B1 +M#Z.Z8JYNM%+?@P`F@'-O1.'4/0P:!YQ05FW;GR5452_3G<%-T#$Z.\%)-K'R +M9"X%U7-V"4>SC\Q5T(<8?DW*;5G#$M-#`Y-BUE8G(N=FAD9BYO=70`K96Q;H,P$(;W +M/,5%W3)$MK$/LD9-YTI5VS5`(,J0=NG0@8>OC3'Q82"D,A@P.M_'?[ZS8

+M`/H:;=.&9CLXFM5FU=)X\3"PKD>!%E=J+SU`MUQU'=T8]W"<@>#3^M8^[A0[ +MW/HQH%*0YP'PW>D3QDL*8/G(?=K0[+?T[/5)`U0I2`4*(1-+`_X\?(RE0_)8 +M\V=QXAZN%\R7X!+CY8WT*V/:T-S*Q#X=3LZITPA6/12LBEQ[,AOX^7D&IE=) +M"2SK;(("^_S"3=\NE"%(N#/Z(`PW-[B4CN<>3MP)%RBNF,WMO+IUJ*Z,G`PU +M7!D+5ZZ!T)5K<2+N1B#:G457H!X5WJ<-S>N6GA8H.V"T&<3N5X0)8`U8`2K3 +M3R7@#M+,!PI:24WY_565/Y=?/\,&Q_L_1]B,OTC,:L$41&X^@B?3]_0]'#$M-#`Y-BUE8G(N=FUD:RYO=70`K5Q=C]S&$7SW +MKZ"EER`/"]:27)(/`A+G'"`(`AB68[^&G]$AMB2<#D$,[(\/AYR:*]YJ-+2O +M3SR1+7;W3O=PZT[5AC.4X-[QQ_?O= +M/WX\\>L/I]/UJRT97)2$(-=T8NQ>YWIZ]L5TYR]%[6XLQSF9KG!1_4V@3W>. +MW(BF*Y>;Y\^%<'7=>GMT%Y(N"XFR7;KJ,S5%B_W2ZO[XE6^>6U_AUK!L[Z7- +MZB*[]-[,+M5J%UE]7N_E6;TXS4O"U]G=_:?_9'?3I^'A_N/C![^^L]O;Q;F\ +M./_+X#(LA=47=^%NN'2M2W&9LF+,"KC;V?7AK_<_3Z?_3@^?[C^\?P.6>W9[ +M6Q99V;KE./_\Z=@9[D7R[`+W&MGU+W^[>^.?W/STL7M@.A>U+&1Y[:4.S7NY +M9.[[]EA7-[U_=!EG_Q56Y_;6-Z=:7[MT%U69U6VV+J=RN<_+[=&7O/9N>)BZ +MQ^F'7S].;U[]\N%]Z)W;6]>R=DW4K(TJLJIPJ7QIKGV5R^@>FW77LNO/]X_O +M[H>W2YF?IE>GUQG375SOE@UL_+JVJI>02W1GEV5?O_W?XU)O-OJ=O6>Z=1%K +M$LJEVN90/7K3AG1>FNEG]:%KQ44L(Y9=0Z=KM;>:_:EMZ!6.ENK#N;W76/7?9-]VDZO;Z[^R;L;.>*+==C6=KDLERVU.[Y7MNY +M-&[;Z6VCUZT8Q_[4C=W'Q^G!;6_8BMZU:/25NFTMG[9Q_SKUNE.S>V*RZYOL +MU?VX[*E+^^_IPR],-VR/\;(.]TBT:V#A+I:G9TT_^5?8GABW32[=]/CPZVGX +M]>?[]^/R1LO>,-VX]6Y9SK:;3YNY;."RPL\N<.G=JW57P_*8;G*K&V\6N.ZG +M;V185'C9[/K+NKQW4SR78O"%\]_EKT4C\N;'ZGU[TRXI;->WR5_]O.L +MT+A2C&J7T/T4RY?O/RW?WSVM[^+6=Q'/6J,:,=I=NG\M*3[>EGMQ[\)./'N- +M&L08CW3OXJ!M$L_Y>??XJP;D.IZ.OPO0L]"H4HQJER[6N\KWCIZU1C5BM+MT +ML=Y=?._HV6O4(,9XJ-C:]XZ>LT:Y$W^50G[@U[)+XWM'ST*C2C&J7;I8[UK? +M.WK6&M6(T>[2Q7K7^=[1L]>H08SQ4+&][QT]9XUR)P($Y#J>;O"]HV>A4:48 +MU2Y=K'>C[QT]:XUJQ&AWZ6*]FWSOZ-EKU"#&>*C8V?>.GK-&N5,IO2M3Z>K< +M]XZ>A4:58E2[=)'>U<0[>M8:U8C1[M)%>E<3[^C9:]0@QGBH6.(=/6>-E- +M+].Z23$>\HV>A4:48U2Y=K'?$.WK6&M6(T>[2Q7I'O*-GKU&#&..A8HEW +M])PURIWX2Q#D.IZ.>$?/0J-*,:I=NECOB'?TK#6J$:/=I8OUCGA'SUZC!C'& +M0\42[^@Y:Y0[D9"!7$?3-;GO'3T+C2K%J';I(KUKB'?TK#6J$:/=I8OTKB'> +MT;/7J$&,\5"QQ#MZSAKE3JWTKDVF(][1L]"H4HQJER[6.^(=/6N-:L1H=^EB +MO2/>T;/7J$&,\5"QQ#MZSAKE3OS_$^0ZGHYX1\]"HTHQJEVZ6.^(=_2L-:H1 +MH]VEB_6.>$?/7J,&,<9#Q1+OZ#EKE#N1?X1 +MM48U8K2[=+'>$>_HV6O4(,9XJ%CB'3UGC7*G07HWI-*UN>\=/0N-*L6H=NDB +MO6N)=_2L-:H1H]VEB_2N)=[1L]>H08SQ4+'$.WK.&N5.H_1N3*8CWM&ST*A2 +MC&J7+M8[XAT]:XUJQ&AWZ6*](][1L]>H08SQ4+'$.WK.&N5.D_1N2J8CWM&S +MT*A2C&J7+M8[XAT]:XUJQ&AWZ6*](][1L]>H08SQ4+'$.WK.&N5.L_1N3J8C +MWM&ST*A2C&J7+M8[XAT]:XUJQ&AWZ6*](][1L]>H08SQ4+'$.WK.&I7+]`QR +M'4W7Y5OO@F>A4:48U2Y=I'>=Q[O@66M4(T:[2Q?I7>?Q+GCV&C6(,1XJUN-= +M\)PURK5,^#LD*:W.XQV$OX/R=Q#^#DG^KO-X!^'OH/P=A+]#DK_K/-Y!^#LH +M?P?A[PX4Z_$.PM]!^3L(?X=QSL(?P?E[R#\W8%B/=Y!^#LH?P?A[Y"DM#J/=Q#^#LK?0?@[)/F[SN,= +MA+^#\G<0_@Y)_J[S>`?A[Z#\'82_.U"LQSL(?P?E[R#\'9*45I_[W@E_!^7O +M(/P=DOQ=3[P3_@[*WT'X.R3YNYYX)_P=E+^#\'<'BB7>"7\'Y>\@_!V2E%9/ +MO!/^#LK?0?@[)/F[GG@G_!V4OX/P=TCR=SWQ3O@[*'\'X>\.%$N\$_X.RM]! +M^#LD*:V>>"?\'92_@_!W2/)W/?%.^#LH?P?A[Y#D[WKBG?!W4/X.PM\=*)9X +M)_P=E+^#\'=(4EH]\4[X.RA_!^'OD.3O>N*=\'=0_@["WR')W_7$.^'OH/P= +MA+\[4"SQ3O@[*'\'X>^0I+2&W/=.^#LH?P?A[Y#D[P;BG?!W4/X.PM\AR=\- +MQ#OA[Z#\'82_.U`L\4[X.RA_!^'OD*2T!N*=\'=0_@["WR')WPW$.^'OH/P= +MA+]#DK\;B'?"WT'Y.PA_=Z!8XIWP=U#^#L+?(4EI#<0[X>^@_!V$OT.2OQN( +M=\+?0?D["'^')'\W$.^$OX/R=Q#^[D"QQ#OA[Z#\'82_0Y+2&HAWPM]!^3L( +M?X:^ +M=\+?0?D["'^')'\W$N^$OX/R=Q#^#DG^;B3>"7\'Y>\@_-V!8HEWPM]!^3L( +M?X"7\'Y>\@_!V2E-9(O!/^#LK?0?@[)/F[D7@G_!V4OX/P=TCR=R/Q +M3O@[*'\'X>\.%$N\$_X.RM\%,1WD6M)EV[=/-^5;[X)GH5%Y_OECZ=V2(L]N +M5C<9ZP.QZ@/#3&&KZO+](L( +M\VT>+](O(LRW3?2+"/-M$_TBPGS;1+^(,-\VT2\BS+=-](L(\VT3_2+"?-M$ +MOX@PWS;1+R+,MTWTBPCS;1/](L)\VT2_B##?-M$O(LRW3?2+"/-M$_TBPGS; +M1+^(,-\VT2\BS+=-](L(\VT3_2+"?-M$OX@PWS;1+R+,MTWTBPCS;1/](L)\ +MVT2_B##?-M$O(LRW3?2+"/-M$_TBPGS;1+^(,-\VT2^"\VT;_2(XW[;1+X+S +M;1O](CC?MM$O@O-M&_TB.-^VT2^"\VT;_2(XW[;1+X+S;1O](CC?MM$O@O-M +M&_TB.-^VT2^"\VT;_2(XW[;1+X+S;1O](CC?MM$O@O-M&_TB.-^VT2^"\VT; +M_2(XW[;1+X+S;1O](CC?MM$O@O-M&_TB.-^VT2^"\VT;_2(XW[;1+X+S;1O] +M(CC?MM$O@O-M&_TB.-^VT2^"\VT;_2(XW[;1+R+,M^GY(OTBPGR;GB_2+R+, +MM^GY(OTBPGR;GB_2+R+,MTWTBPCS;1/](L)\VT2_B##?-M$O(LRW3?2+"/-M +M$_TBPGS;1+^(,-\VT2\BS+=-](L(\VT3_2+"?-M$OX@PWS;1+R+,MTWTBPCS +M;1/](L)\VT2_B##?-M$O(LRW3?2+"/-M$_TBPGS;1+^(,-\VT2\BS+=-](L( +M\VT3_2+"?-M$OX@PWS;1+R+,MTWTBPCS;1/](L)\VT2_B##?-M$O@O-M&_TB +M)E/](B93_2(F4_TB)E/](B93_2(F4_TB)E/](B93_2(F4_TB)E/](B93_2(F +M4_TB)E/](B93_2(F4_TBYCPWU"]B-M4O8C;5+V(VU2]B-M4O8C;5+V(VU2]B +M-M4O8C;5+V(VU2]B-M4O8C;5+V(VU2]B-M4O8C;5+V(VU2^>\SPWU"^>;SY+ +M>!<53W=;[*8/+-'_YH3S'.U>"?>H+`[+T57^8CDV(9GT#?'U?:WI1NMRY]^6 +ML*JRKKM)^$^N;_TTX>VS56__CM^X?G/:_PGK6S\.LZK=Q\16EZPY'RWXIV]_ +M?%;PEL[L<=G2W7ST]/-T8<$'/LFZ+->/GA9/?3+B-ZY/C\EV9KKR2ZO3*<^Q +M8HT_>KHLFV=QNL_KC&!X4C,\0Y:PO]G3^MK;99QWY7YA?3?(4I;N1Y!^^*KN +MX@[K(N5F^W3]%_?VRZO[^G9U@_%F5,_?&0??N2[)_IV[I3O;`L%E199-.G'[ +>=_S&];O3_L^6L/0)S3I8N@].R[_Z/_V4$^TO7P`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,15 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-gpt.raw.gz +M'XL("/#%'50``VEM9RTQ>#$M-#`Y-BUG<'0NU52W;V`262JW42MW2JMW:@3]FC-2=#U\?A@2(C1KIP$)(Q_UR]_#C(F4X +M`*,AJ\@U'>B?Q?+L=W>[@:;JVX#^]ZF$%5!X8,`U/B@U/>,3SAQ.?9BAFO/6=K7-O+Z7US<VLL(>^M^[#3@KEUG%/"MSJ#-T%:HV@7MG&12+VH +M9?I)M7^I;M.KTU +F^C>&>/QE.,8A3KCM(>YN;99QB!..=8@;_W]*RMT?5F[7A(@+```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,22 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-gpt.vhd.gz +M'XL("/'%'50``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD+F]U=`"MF$MOVS`,Q^_Y +M%!QVZS#7DB79N0Q8L1;8K7O==JCER$4/RQ[IH1C\X2?*\D.VY"$M$]5(H/#G +M/RF*8IWG_0M`%:!:4`:4Q,^E`+6'L@*PDWYP=V7^*W3-SZ-I'A^>,O_J=CV, +MY7.KT!SM>0'"WJ0$7N--U`$_0S=@LM?7]QXX<9"@>`@+42L[J/R +M41V2;JZ^?'#(NTE=L58W6=D_+2`7P-CL%\6@[F[4..*$M6I;-THH:[0=1_`E +MF$#LK@U"+H<)[MP/HS>A8*Y/L7PCYNG%2.JK49_=6WD=N:8GNJLL?(]`K<\# +M#A$,<:/#NL'XN3IBS.11GR138(N-!`1+ADT[BP_*#S(H++;I'(0#MQ*M`>[/84U`KOCI^S8 +MP]YFO]]X?8;YC(B-]$0J>L;5Y2KE;CD5[(2[$.*HZ[*I,'J2+'I[GRRQD9Y( +M1J_NHQR#WQQ#9N<9] +M(253*#R03*'P^Y=0(3.;BWGN*BN_*$05!G&$%09QA!4&<:05!H&$%09QA!4& +M<805!G&D%4;1-D+*-T)%!8;A/RXZS)IT2]-5V:D7=AFXZQJA9/NTT0C%%X.R +M$5+_:X1:DW)VY"R<)6R$%'4CI'PA)7J6H89&:*WA.<\RU-`(S6[\@F<9*MX( +>/?=9!N((GV4@CO!9!N*(4X79WF7W#]HOQ!D`$P`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,19 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-gpt.vhdf.gz +M'XL("/'%'50``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD9BYO=70`K9<[;]PP#(#W +M^Q4LNJ6HH_?IE@`-F@#=TD>V#O%#"C+DBJ(=.OC'5Y3LL^23C%XAFS!TH/F9 +MI$G11T@X``0#TF:N9<5XVZ3GN+O:>1KM+@.ZYZ,+*V#C@`'7.R5A>(\Q8.TD +MA'JK8.R$DV7M<=CEWWLW]W])WCX\.4;PKXOX3+JE`,#W4-_`-NMO*/_'F[` +M.8QQ$W;.!R4L:)+:M00Y<$*TEJI6,K;J#C8%MHAP+N9H53 +ME2M/H+I3L.]!&9`4>HN+00&E`-JUB?80!LRY>(`]!=8A<#Q^;HX!]K[Y^6[R +M3]"I(G)25I2R)[!4B"Z%N\?:W@P74AROG3V-V9/5LG>8BB4G944Q>VW(7CY) +MF+UP'*M92.@6RI&0_L?QQ-__OE3YP]Y7=F6#Z25X+VC&-A*MN33XEUFFU)Q]CH!1.`6 +M$P<^>?>4EHKR7T!SL,:"EFA[DN1'HL@6,N)\J<0W_^^[#;C:I>+^&NS^`N3M +&#A:S#0`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,87 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-gpt.vmdk.gz +M'XL("/'%'50``VEM9RTQ>#$M-#`Y-BUG<'0N=FUD:RYO=70`K5Q=C]S&$7SW +MKYC(#S829,%:DLOE@X+8D1T800!%=I*7/(2?\2&VI)P.A@WLCP^'G)HKWNT< +M*5^?]K3;8G?M=,^RN:HN,,N6'^>*UA6%*WI7GEP&-_W3\G!9?F],C^.9!RY_ +M>?77?QSX\_GAS5\Z&YOWM^]"^L[^KV=G(N3 +M]S]U'F%*K#KY%_Z`AZL]Q&EP>>]R^,/N9.\._A+G_ZYM7+\,G-#N^;6\+YJ&DATWM/>2CNZ>3\ +M[^/'O+KA[9U'',-/7)W?VU"<#R]?_/CN;:R=WUM?LGH&.L^%REV9>ZB0FB]?Z1']QV;>-7?YX>;N^YON +MVRG-#\.+PZ>.<"=?NVD#SV%=2]93R"FYL].R+U_]?#?EZ_JPLS>$FQ6QI@V_',ZQ7VQOGW]Q1O"G:>H +MR7-:X!0R);3*J5SR+Q]^+-WEVZ_<"Y_D=]\/\R>0:=&_XEQEY?NQ4T_ +M[:F'_<_P[D?"=%J'_TC4[VET/WRP\W +M;_OI1',O"=_%G8B&>K49T8_9[J +MG7QK&\1S?%@]?M6`O$[#\;L`/7.-*L0H5W"IVI6A=O2L-.HL1KV"2]7N%&I' +MSU:C.C'Z7N8:58A1KN!2M:M#[>A9:=19 +MC'H%EZI=$VI'SU:C.C'Z7JW1!J1\]6HSHQ^EW)CJ%V]!PURC\54KMB"Z[*0NWHF6M4 +M(4:Y@DO4KF*_HV>E46E4:=Q:A7<*G:L=_1L]6H3HQ^5[+L=_0<-N4848Y0HN53OV.WI6&G46HU[!I6K'?D?/5J,Z,?I=R;+? +MT7/4*/]$0@;R.@EWSD+MZ)EK5"%&N8)+U.[,?D?/2J/.8M0KN$3MSNQW]&PU +MJA.CWY4L^QT]1XWR3[74KMZ$8[^C9ZY1A1CE"BY5._8[>E8:=1:C7L&E:L=^ +M1\]6HSHQ^EW)LM_1<]0H_\3_/T%>I^'8[^B9:U0A1KF"2]6._8Z>E4:=Q:A7 +M<*G:L=_1L]6H3HQ^5[+L=_0<-H0HQR!9>J'?L=/2N- +M.HM1K^!2M6._HV>K49T8_:YDV>_H.6J4?^JD=MT67)V%VM$SUZA"C'(%EZA= +MS7Y'STJCSF+4*[A$[6KV.WJV&M6)T>]*EOV.GJ-&^:=>:M=OPK'?T3/7J$*, +M<@67JAW['3TKC3J+4:_@4K5COZ-GJU&=&/VN9-GOZ#EJE'\:I';#)AS['3US +MC2K$*%=PJ=JQW]&STJBS&/4*+E4[]CMZMAK5B='O2I;]CIZC1OFG46HW;L*Q +MW]$SUZA"C'(%EZH=^QT]*XTZBU&OX%*U8[^C9ZM1G1C]KF39[^@Y:E0FTS/( +MZR1^@_!V$O\,F?]>$?@?A[Z#\'82_PR9_UX1^!^'O +MH/P=A+_;D6SH=Q#^#LK?0?@[;%):3>AW$/X.RM]!^#ML\G=-Z'<0_@[*WT'X +M.VSR=TWH=Q#^#LK?0?B['^@_!V$O\,F?]>$?@?A[Z#\'82_VY%LZ'<0_@[*WT'X.VQ26FT6:B?\ +M'92_@_!WV.3O6O8[X>^@_!V$O\,F?]>RWPE_!^7O(/S=CF39[X2_@_)W$/X. +MFY16RWXG_!V4OX/P=]CD[UKV.^'OH/P=A+_#)G_7LM\)?P?E[R#\W8YDV>^$ +MOX/R=Q#^#IN45LM^)_P=E+^#\'?8Y.]:]COA[Z#\'82_PR9_U[+?"7\'Y>\@ +M_-V.9-GOA+^#\G<0_@Z;E%;+?B?\'92_@_!WV.3O6O8[X>^@_!V$O\,F?]>R +MWPE_!^7O(/S=CF39[X2_@_)W$/X.FY16EX7:"7\'Y>\@_!TV^;N._4[X.RA_ +M!^'OL,G?=>QWPM]!^3L(?[^@_!V$O\,FI=6QWPE_!^7O(/P=-OF[ +MCOU.^#LH?P?A[[#)WW7L=\+?0?D["'^W(UGV.^'OH/P=A+_#)J75L=\)?P?E +M[R#\'3;YNX[]3O@[*'\'X>^PR=]U['?"WT'Y.PA_MR-9]COA[Z#\'82_PR:E +MU;'?"7\'Y>\@_!TV^;N._4[X.RA_!^'OL,G?=>QWPM]!^3L(?[^@ +M_!V$O\,FI=5GH7;"WT'Y.PA_ATW^KF>_$_X.RM]!^#ML\G<]^YWP=U#^#L+? +M[4B6_4[X.RA_!^'OL$EI]>QWPM]!^3L(?X=-_JYGOQ/^#LK?0?@[;/)W/?N= +M\'=0_@["W^U(EOU.^#LH?P?A[[!):?7L=\+?0?D["'^'3?ZN9[\3_@[*WT'X +M.VSR=SW[G?!W4/X.PM_M2);]3O@[*'\'X>^P26GU['?"WT'Y.PA_ATW^KF>_ +M$_X.RM]!^#ML\G<]^YWP=U#^#L+?[4B6_4[X.RA_%\5TD-<"YY;?`#=D2^VN +M2LJO_%.LG;NZNL%:'SB.>P'SZ^GZ/8[I(GMR&1^_/LSZQ3CS6*K^ZP`7../Z +M(<[?I4SW<1^KKT2+\W41?B3A_-]%7(L[?3?25 +MB/-W$WTEXOS=1%^).'\WT5+\W41?B3A_-]%7(L[?3?25B/-W$WTEXOS=1%^).'\WT5#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U& +M7PG.WVWTE>#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U&7PG.WVWTE>#\W49? +M"<[?;?25X/S=1E\)SM]M])7@_-U&7PG.WVWTE>#\W49?"<[?;?25X/S=1E\) +MSM]M])7@_-U&7PG.WVWTE>#\W49?"<[?;?25X/S=1E\)SM]M])7@_-U&7PG. +MWVWTE>#\W49?B3A_I^>S])6(\W=Z/DM?B3A_I^>S])6(\W=Z/DM?B3A_-]%7 +M(L[?3?25B/-W$WTEXOS=1%^).'\WT5+\W41?B3A_-]%7(L[?3?25B/-W$WTEXOS=1%^).'\W +MT5+\W41?B3A_ +M-]%7(L[?3?25B/-W$WTEXOS=1%\)SM]M])483/65&$SUE1A,]9483/65&$SU +ME1A,]9483/65&$SUE1A,]9483/65&$SUE1A,]9483/65&$SUE1A,]948L\Q0 +M7XG15%^)T51?B=%47XG15%^)T51?B=%47XG15%^)T51?B=%47XG15%^)T51? +MB=%47XG15%^)T51?B=%47WG,LLQ07WE\=*_CG7"/DUWT@4>8ZBN/QR>7\?'K +M*^;Z+7=7??QW^L#ER\/Z3P1$^W&`7.$:C@D7\.?&HO4:!C>.X;$HY^XSC'>Q +MOI+PYP>!ZXWKMW]_ET=9NJ9Y!/AWKF_>WZ+T]V,NZOGFO+PS;UE$N#GWLM/U +M??7U-^[U%V^^\V#_ND]WOKUSEWNRK:@\RGIU2*?[YS>/SXYBOKWS5/UC=379 +M/`GWV;63K9AO[SSV3\!=>Z3ABJ>B/O9.X,5\>V>-4O6MRP?7YFYL7-,GX/[P +M`.YD_,F;[SS;GES5^?L'EW#=?+/G_N1I:7>>3I/EG#BZ8^^5"!7!X5?O-&JZUK5XY7S46X'9X.-.S +MH_`WC+2[B'LX+-^8JY,;*_\%8K6,Y.7XN; +G,1A>Q#WQ#V#$M-#`Y-BUM8G(N(/I!8JM[0R04F8"W_PA!$1I`(8`W9=QWN'/ +M*NV^VE$WDW^/,DCI&X/^F8&WANV?JR;XXSX!<)0U@ +MW?DH!0[YA5'?*9=!2;@+^B`/UP7<,5VO(QS]"!=2W',QM\OJ=KFZIG`R[+0R +L5E9N@*25*S@J^Q#0YV7A&\BK\G'>X:\J[0(T';#8"1H*P.H-:WH%_)0&```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhd.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhd.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,18 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-mbr.vhd.gz +M'XL("/+%'50``VEM9RTQ>#$M-#`Y-BUM8G(N=FAD+F]U=`"METU3@S`0AN_] +M%>MX\]!)EF2A5T<].^.H5P'!\>#'J` +M`)0!M4`-D-37N0`Z0%X`J$%S8'_FYA:Z^NVUJ;^>O_?FU>T&&&>^56BN[3$# +MH1Z2`Y;Z(?2HKZ&SF/WIY=/9\\N3Q:'!V0<+`H$@%43,GD/,J=.DJ_.;BQ[Y +M,*K+YNI&*_6I!#`!G'LS,JONP6ET.*&LVK8_?GPV$WT8 +M*15R^OAL+(N[BZ94T$XV"H0NYS5WH:=\37$+I?*OZ%%H)\R%"@*3=@![]\/H +MC2CP]1%G*S&/)R.JK]3ZU-IBY<(Y/M"=[\.W`U;5-F#!!H4ASCE +M#44R!A-Y/"$G7ORJQ\3YK=IM0"EUQY@";ZV^.G4Z&@V4N>Z^DJ#`8QV^O[Q; +M6FY-9/7^L5DU^!O.">;'X#+32NU,OS+B`]U8)L.WQ8DU=7H)-YN@:E54@,KO";C`5U^8=1WF,O`P-T5?3!WM]2X/)S//1S^XBZ$N&HUM^OJ +M3N;JZL3):*#$M-#`Y-BUM8G(N=FAD9BYO=70`K96Q;H,P$(;W +M/,5%W3(@^[`/LD9-YTI5VS5`(,J0=NG0@8>OC3'8.)"D,AQ@=/;'?[ZS85J<6%*G$*Q^*%@9 +MN?9$/AGGYAF86B45L+SWH0\<\@NCOFTH`[UP%_1!&&ZA<9G?GSLXO!$N^+AR +M,;?+ZM:ANBIR,N1T9=RYTKXE_&J#H@=%F +MD/I?$:5`#5`-)'4[$T!;R'(7B'XEM=7W5UW]G'_=#&L<'_XGQF.K50AE@ +MH3]"1]UV]#WM3YOSY61Q=JNR'Q:D)UTJB`C")3_#$M-#`Y-BUM8G(N=FUD:RYO=70`K5Q=C]S&$7SW +MKZ"EER`/"]:27)(/`A+G'"`(`AB68[^&G]$AMB2<#D$,[(_/##DU5[P5-;2O +MY3V1H^VNG>[9JSM7%S;/US]95O9966;EF%67+$?F_FE]9'GQM'"/<\,GKG^_ +M^\>/)_[YP^ET_6H%@\^2%.0*)XO-ZUQ/S_X0[OREK,T3[G%.PA4^J[])#'#G +MG2=VX4KWY/ES*=Q=MSP]^AN!RR)0MH&K/E/3;K%?VMT?OPK-\_LK_![<\5[: +MK"ZR2Q^6V:5:UD56GY?G\JQV0;,#?)W=W7_Z3W8W?1H>[C\^?@C[._NS=<'E +MQ<=?!H_@"JLO_L8_X>%:#W&9LF+,"OBGL^O#7^]_GD[_G1X^W7]X_P8L]^S/ +MMBRRLO7;\?'YTV.S\"^29Q?XU\BN?_G;W9OPSLU/'[L'PODLMQ'WVJX.Q;U< +M,O]U^UAV-[U_](AS^!-WY\\V-*=:7KOT-U69U6VV;*?RV&?W]!A*7GHW/$S= +MX_3#KQ^G-Z]^^?`^]LZ?K6]9NP`U2Z.*K"H\5"C-MZ_RB/YMLYQ:=OWY_O'= +M_?#6E?EI>G5ZG1'NXGOG#K`)^UJK=BF7W9-UV[Y^^[]'5V\VAI.])]RRB:4( +M]]K5.:MJC^4.<#F*/6 +MDUX/>CF*<>Q/W=A]?)P>_/'&H^A]B\90J3_6\ND8MZ]3+R/0O\%%YA?G^7_-G/LT+S2EE4 +M&T#_4RQW7W]R7]\][>_B]W>1R%JS&EFT&[A_.8B/M^5>_'=A)Y&]9@VR&(]T +M[^*I;9+(^7GW^*L&Y'X?CK\+,++0K%(6U09NKW=5Z!TC:\UJ9-%NX/9Z=PF] +M8V2O68,LQD/%UJ%WC)PURU_XJQ3R`[^679K0.T86FE7*HMK`[?6N#;UC9*U9 +MC2S:#=Q>[[K0.T;VFC7(8CQ4;!]ZQ\A9L_R%!`&YWX<;0N\866A6*8MJ`[?7 +MNS'TCI&U9C6R:#=P>[V;0N\8V6O6((OQ4+%SZ!TC9\WREU)Z5Z;@ZCSTCI&% +M9I6RJ#9P.[VKR7>,K#6KD46[@=OI74V^8V2O68,LQD/%DN\8.6N6OU32NRH) +M1[YC9*%9I2RJ#=Q>[\AWC*PUJY%%NX';ZQWYCI&]9@VR&`\52[YCY*Q9_G*1 +MWEV2<.0[1A::50[1LZ: +MY2_\)0AROP]'OF-DH5FE+*H-W%[OR'>,K#6KD46[@=OK'?F.D;UF#;(8#Q5+ +MOF/DK%G^0D$&#V>D>^8V2M68TLV@W<7N_( +M=XSL-6N0Q7BH6/(=(V?-\A?^_Q/D?A^.?,?(0K-*650;N+W>D>\866M6(XMV +M`[?7._(=(WO-&F0Q'BJ6?,?(6;/\A?HCY'X?CGS'R$*S2EE4&[B]WI'O&%EK +M5B.+=@.WUSOR'2-[S1ID,1XJEGS'R%FS_&60W@TIN#8/O6-DH5FE+*H-W$[O +M6O(=(VO-:F31;N!V>M>2[QC9:]8@B_%0L>0[1LZ:Y2^C]&Y,PI'O&%EH5BF+ +M:@.WUSOR'2-KS6IDT6[@]GI'OF-DKUF#+,9#Q9+O&#EKEK],TKLI"4>^8V2A +M6:4LJ@W<7N_(=XRL-:N11;N!V^L=^8Z1O68-LA@/%4N^8^2L6?XR2^_F)!SY +MCI&%9I6RJ#9P>[TCWS&RUJQ&%NT&;J]WY#M&]IHUR&(\5"SYCI&S9N4R/8/< +M[\)U^=J[&%EH5BF+:@.WT[LN\%V,K#6KD46[@=OI71?X+D;VFC7(8CQ4;."[ +M&#EKEF^9Z'=(2EI=X#N(?@?5[R#Z'9+Z71?X#J+?0?4[B'Z'I'[7!;Z#Z'=0 +M_0ZBWQTH-O`=1+^#ZG<0_0Y)2:L+?`?1[Z#Z'42_0U*_ZP+?0?0[J'X'T>^0 +MU.^ZP'<0_0ZJWT'TNP/%!KZ#Z'=0_0ZBWR$I:76![R#Z'52_@^AW2.IW7>`[ +MB'X'U>\@^AV2^ET7^`ZBWT'U.XA^=Z#8P'<0_0ZJWT'T.R0EK3X/O1/]#JK? +M0?0[)/6[GGPG^AU4OX/H=TCJ=SWY3O0[J'X'T>\.%$N^$_T.JM]!]#LD):V> +M?"?Z'52_@^AW2.IW/?E.]#NH?@?1[Y#4[WKRG>AW4/T.HM\=*)9\)_H=5+^# +MZ'=(2EH]^4[T.ZA^!]'OD-3O>O*=Z'=0_0ZBWR&IW_7D.]'OH/H=1+\[4"SY +M3O0[J'X'T>^0E+1Z\IWH=U#]#J+?(:G?]>0[T>^@^AU$OT-2O^O)=Z+?0?4[ +MB'YWH%CRG>AW4/T.HM\A*6D->>B=Z'=0_0ZBWR&IWPWD.]'OH/H=1+]#4K\; +MR'>BWT'U.XA^=Z!8\IWH=U#]#J+?(2EI#>0[T>^@^AU$OT-2OQO(=Z+?0?4[ +MB'Z'I'XWD.]$OX/J=Q#][D"QY#O1[Z#Z'42_0U+2&LAWHM]!]3N(?H>D?C>0 +M[T2_@^IW$/T.2?UN(-^)?@?5[R#ZW8%BR7>BWT'U.XA^AZ2D-9#O1+^#ZG<0 +M_0Y)_6X@WXE^!]7O(/H=DOK=0+X3_0ZJWT'TNP/%DN]$OX/J=Q#]#DE):\Q# +M[T2_@^IW$/T.2?UN)-^)?@?5[R#Z'9+ZW4B^$_T.JM]!]+L#Q9+O1+^#ZG<0 +M_0Y)26LDWXE^!]7O(/H=DOK=2+X3_0ZJWT'T.R3UNY%\)_H=5+^#Z'<'BB7? +MB7X'U>\@^AV2DM9(OA/]#JK?0?0[)/6[D7PG^AU4OX/H=TCJ=R/Y3O0[J'X' +MT>\.%$N^$_T.JM]!]#LD):V1?"?Z'52_@^AW2.IW(_E.]#NH?@?1[Y#4[T;R +MG>AW4/T.HM\=*)9\)_H=5+^+9CK(O`F_*U=S&RT*P\__S#]#WOZ]_\3UF]/VOPB(_KYQM`%ES"O_=<@'MT +M5;AQC]69)@>!_8*_/@G<:-P_S+\-L*JRKKL!_"?W=[8^CN7S-:O:?^YL='.MD1P +E69AE]6+<_KW_Q/6[T_:_%;`,@&8=+/TGL>5?_1_0^/1A@%\````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-pc98.raw.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-pc98.raw.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,11 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-pc98.raw.gz +M'XL("//%'50``VEM9RTQ>#$M-#`Y-BUP8SDX+G)A=RYO=70`K91!#H,@$$7W +MGF+<=F%@'*INFW3?3=NU-?44'+X@5`4$-0$,,?GP\C\#,&8:`"&P?F.,"_)6 +MN5T6EV*B\?$<4`CH0^!3`2<<:G\=P4"@_KP/QG'Y'$%67OOCN!)#D%T5%39P +M-BYEWC^<`HL&2("X0HM'';[OKXW`F"^PP>$>;C;,C^!JO6HU4[E%/N-B@L&5 +MEE4N.$JY4PCV/156Y#TLB*VW;EUG8.H,#\!:JZ$+G.L+B[\NM(%.W(0_"./V +M&M>X\_D*ASMQP<5]DK5-NRM#=T/F8M3^S3AX9G4"]1L9 +9C'%!/BJW&R!98+8=)-3`X@?$\J!S108````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhd.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhd.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,18 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-pc98.vhd.gz +M'XL("//%'50``VEM9RTQ>#$M-#`Y-BUP8SDX+G9H9"YO=70`K9=-;X,P#(;O +M_16N=NNA2HP3VNNT[CQIVG8M9;3:81]:>^B!'[\8$DCX6KL%*`H*?O+:<4PJ +M1'T`Z`3T'G0!6G$[)=!K2%<`IM->6-VE?80R__PH\M/;>6F/GK*[!+69V+NI4,8F1FKL)G804N6W2QL6A=YE4.1^_LN]CT=&' +M(ZFB&WVRUY>,NXLV5="];!40I_.4NU!13EW<0*K\*WHZM"/;,$$0RG5@Y7X8 +MO18%OCXMQ43,QR=C5%_&^LS:$MG`?;RCO%V&9P/<[:\#*L5+J`M\<@[GK&]- +MD--0W'TG+UH=^4CV_7E^B\CQP\IAE7*Y5!I6>*G"E\WS@,,8S^$:A[_A&L'R +M$EQB:Y][TZC%YFLSVE'CYI8U;W$TI8[77'&5LRINLF"^ZMCY\PS"Y'`.8N55 +M!0_8S"^T^M9]&1BX.Z$/^NYFC$O#]Z6'PU_'*K7$8MQ!059E-!G*-[-W'.\J'97C60+2E/MJW`VUMCJ:0+#":0K+5 +M.:)"*B:3[=HLU%9AI(TXXR)NQ!D7<2/.N(@;<<9%W(@S+N)&G'%1-^+:_,42 ++8O8#/[LV_KT-```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,14 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-pc98.vhdf.gz +M'XL("//%'50``VEM9RTQ>#$M-#`Y-BUP8SDX+G9H9&8N;W5T`*V5L6Z#,!"& +M]SS%1=TR1/BP#UBCIG.EJNT:0B'*T';IT(&'KVU,\&$@266PD-'AC__WV>,DO#/J*4`8RNPOZ(+1;&ES&OQ<>#J_8!8X[+N9V6=TZ5%=%3D8ZWADW[EP# +MX3NWPV'<0B!M9=8KT-3(X#D?:)^W_.Z`T@&CS2"YLX-2H`:H!E*FGTF@`K+< +M!R)?26WU_557/^=?/\,&)T85W6]F/*9FMU`&6)J?T(?I>_H>]J?-^?/4X_I2 +MU?]8DIETI2$RL$O<[M/NY=$B#X.Z-)PD\F?OJ$\H"4(PXT[=@2]GLOGMS=8- +D')65V3?VP@*3I#$M-#`Y-BUP8SDX+G9M9&LN;W5T`*U<76_#@>0B!PB"`,;Y>7E>+MKIWMV2W)U8=-T_4J2O$OR/,F'I"B3%,G\3^LM2;.'Q7P[UWS@\O>; +M?_QTXM7AP%P*7!*!D`U<\4=-NL<_M[H^O?//<_C*WA_EXRR:I +MLJ3L_#(IBV6=)=5Y>2Q-JCEHF@&_2VYNO_XGN1F_]G>W7^X_^_V=W=G.P7GI +MXLO>(@N6>W=GF +M69(W;CLN/GVX;1;N2=*DA'N.Y/*7O]V\]:_<]/2EO2.?,E+[_J[L;T? +M?_SV97S[YN/G3Z%W[FQ=RYH%J%X:E25%YJ!\::Y]A4-T+YOEU)++K[?WO]SV +M'^8ROXYO3M\EA"M=[^8#K/V^UJKGE'+W9.=M7][][WZN-QG\R=X2;MG$4L3\ +MW,4Y*2J'-1_@>.*_/&7<7D%$JY9WV8N>#T'+,NSN_!= +M6^$=B>7N@>5DDYOVODV^;[^.I^]N;KX/)]NZ8O/E-F]M="CE"NU>WTL[Y\:M +M)[T>]'(4P]"=VJ']N>,-1]&Y%@V^4G>L^<,Q;I^G6DYJ7,[ +MS&?J8/\]?OY(N'Y]&<_[<"^)9DG,W,7\ZEG@1_\,ZRO&'9.#&^_OOIWZ;[_> +M?AKF-UKREG##VKMY.^MI/ASF?(#S#I_YW9V?WH?OU*.GFM&3RT/7%MRO'BY+/05DGLHV +M+0K;69]0"'3L[S_?K1M[(WR99I7BZ+ +M8@/H?HJE\_>?YN_W#_LKW?Y*B:PTJY9%LX'[UPSQY;KZ6CME$BI\?=XZ\:D.M]./XNP,A,LW)9%!NXO=X5OG>,K#2KED6S@=OK7>E[ +MQ\A.LWI9#(>*K7SO&#EIEKOCKU)(#_Q:5M:^=XS,-"N71;&!V^M=XWO'R$JS +M:EDT&[B]WK6^=XSL-*N7Q7"HV,[WCI&39KD[$@3D>A^N][UC9*99N2R*#=Q> +M[P;?.T96FE7+HMG`[?5N]+UC9*=9O2R&0\5.OG>,G#3+W>72NSP&5Z6^=XS, +M-"N71;&!V^E=1;YC9*59M2R:#=Q.[RKR'2,[S>IE,1PJEGS'R$FSW%TAO2NB +M<.0[1F::E0[1DZ:Y>Y* +MZ5T9A2/?,3+3K%P6Q09NKW?D.T96FE7+HMG`[?6.?,?(3K-Z60R'BB7?,7+2 +M+'?'7X(@U_MPY#M&9IJ5RZ+8P.WUCGS'R$JS:EDT&[B]WI'O&-EI5B^+X5"Q +MY#M&3IKE[BC(0*YWX>K4]XZ1F6;ELB@V<#N]J\EWC*PTJY9%LX';Z5U-OF-D +MIUF]+(9#Q9+O&#EIEKMKI'=-%(Y\Q\A,LW)9%!NXO=Z1[QA9:58MBV8#M]<[ +M\ATC.\WJ93$<*I9\Q\A)L]P=__\$N=Z'(]\Q,M.L7!;%!FZO=^0[1E::5*)=\Q^8V2F6;DLB@W<7N_(=XRL +M-*N61;.!V^L=^8Z1G6;ULA@.%4N^8^2D6>ZNE][U,;@F];UC9*99N2R*#=Q. +M[QKR'2,KS:IET6S@=GK7D.\8V6E6+XOA4+'D.T9.FN7N!NG=$(4CWS$RTZQ< +M%L4&;J]WY#M&5II5RZ+9P.WUCGS'R$ZS>ED,AXHEWS%RTBQW-TKOQB@<^8Z1 +MF6;ELB@V<'N](]\QLM*L6A;-!FZO=^0[1G::U,S#0KET6Q@=OK'?F.D95FU;)H-G![O2/?,;+3K%X6PZ%BR7>,G#0KE>D9 +MY'H7KDW7WH7(3+-R610;N)W>M9[O0F2E6;4LF@W<3N]:SW\0U>]:SW<0_0ZJWT'T.T3UN];S'42_ +M@^IW$/WN0+&>[R#Z'52_@^AWB$I:K><[B'X'U>\@^AVB^EWK^0ZBWT'U.XA^ +MAZA^UWJ^@^AW4/T.HM\=*-;S'42_@^IW$/T.44FK]7P'T>^@^AU$OT-4OVL] +MWT'T.ZA^!]'O$-7O6L]W$/T.JM]!]+L#Q7J^@^AW4/T.HM\A*FEUJ>^=Z'=0 +M_0ZBWR&JWW7D.]'OH/H=1+]#5+_KR'>BWT'U.XA^=Z!8\IWH=U#]#J+?(2II +M=>0[T>^@^AU$OT-4O^O(=Z+?0?4[B'Z'J'[7D>]$OX/J=Q#][D"QY#O1[Z#Z +M'42_0U32ZLAWHM]!]3N(?H>H?M>1[T2_@^IW$/T.4?VN(]^)?@?5[R#ZW8%B +MR7>BWT'U.XA^AZBDU9'O1+^#ZG<0_0Y1_:XCWXE^!]7O(/H=HOI=1[X3_0ZJ +MWT'TNP/%DN]$OX/J=Q#]#E%)JT]][T2_@^IW$/T.4?VN)]^)?@?5[R#Z':+Z +M74^^$_T.JM]!]+L#Q9+O1+^#ZG<0_0Y12:LGWXE^!]7O(/H=HOI=3[X3_0ZJ +MWT'T.T3UNYY\)_H=5+^#Z'<'BB7?B7X'U>\@^AVBDE9/OA/]#JK?0?0[1/6[ +MGGPG^AU4OX/H=XCJ=SWY3O0[J'X'T>\.%$N^$_T.JM]!]#M$):V>?"?Z'52_ +M@^AWB.IW/?E.]#NH?@?1[Q#5[WKRG>AW4/T.HM\=*)9\)_H=5+^#Z'>(2EI# +MZGLG^AU4OX/H=XCJ=P/Y3O0[J'X'T>\0U>\&\IWH=U#]#J+?'2B6?"?Z'52_ +M@^AWB$I:`_E.]#NH?@?1[Q#5[P;RG>AW4/T.HM\AJM\-Y#O1[Z#Z'42_.U`L +M^4[T.ZA^!]'O$)6T!O*=Z'=0_0ZBWR&JWPWD.]'OH/H=1+]#5+\;R'>BWT'U +M.XA^=Z!8\IWH=U#]#J+?(2II#>0[T>^@^AU$OT-4OQO(=Z+?0?4[B'Z'J'XW +MD.]$OX/J=Q#][D"QY#O1[Z#Z73#30:X%+EF_/=R8KKT+D9EFI>G3M[EW,T2: +M7.UN-/8'8O$'AIG"6M7O`USAK/<7YMO2OX>\W^I?1)AO\_8B_R+"?)NW%_D7 +M$>;;O+W(OX@PWS;Q+R+,MTW\BPCS;1/_(L)\V\2_B##?-O$O(LRW3?R+"/-M +M$_\BPGS;Q+^(,-\V\2\BS+=-_(L(\VT3_R+"?-O$OX@PWS;Q+R+,MTW\BPCS +M;1/_(L)\V\2_B##?-O$O(LRW3?R+"/-M$_\BPGS;Q+^(,-\V\2\BS+=-_(L( +M\VT3_R+"?-O$OX@PWS;Q+R+,MTW\BPCS;1/_(L)\V\2_",ZW;?R+X'S;QK\( +MSK=M_(O@?-O&OPC.MVW\B^!\V\:_",ZW;?R+X'S;QK\(SK=M_(O@?-O&OPC. +MMVW\B^!\V\:_",ZW;?R+X'S;QK\(SK=M_(O@?-O&OPC.MVW\B^!\V\:_",ZW +M;?R+X'S;QK\(SK=M_(O@?-O&OPC.MVW\B^!\V\:_",ZW;?R+X'S;QK\(SK=M +M_(O@?-O&OPC.MVW\B^!\V\:_",ZW;?R+X'S;QK^(,-]FY(O\BPCS;4:^R+^( +M,-]FY(O\BPCS;4:^R+^(,-\V\2\BS+=-_(L(\VT3_R+"?-O$OX@PWS;Q+R+, +MMTW\BPCS;1/_(L)\V\2_B##?-O$O(LRW3?R+"/-M$_\BPGS;Q+^(,-\V\2\B +MS+=-_(L(\VT3_R+"?-O$OX@PWS;Q+R+,MTW\BPCS;1/_(L)\V\2_B##?-O$O +M(LRW3?R+"/-M$_\BPGS;Q+^(,-\V\2\BS+=-_(L(\VT3_R+"?-O$OPC.MVW\ +MBQA-_8L83?V+&$W]BQA-_8L83?V+&$W]BQA-_8L83?V+&$W]BQA-_8L83?V+ +M&$W]BQA-_8L83?V+&$W]BYC2U-"_B,G4OXC)U+^(R=2_B,G4OXC)U+^(R=2_ +MB,G4OXC)U+^(R=2_B,G4OXC)U+^(R=2_B,G4OXC)U+^(R=2_>$[3U-"_>+[Z +M+.%-UC[<=;&K/S!?]K=^.NCUW_L/7+X_;?\$0$R_#;`HDO8:\)^^X'SYO-XF +M3_K\J;JFZ>$6*WB%L^Y?;MR_>;/.RON=[&>5/N,_N[XI9R^1!@_?A5/<4-V^V4FVSA +MNF?/]OG=O;[>76]\&%M`MN_<%>YL2P3UPLRK>>+Z[_T'+N]/VS\K +.8+X`OOH_SBV/UN!>```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.raw.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.raw.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,10 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-vtoc8.raw.gz +M'XL("/3%'50``VEM9RTQ>#$M-#`Y-BUV=&]C."YR87@#7/;QMA@0*Y<>$H73S>%_F,2,$%Z`T3@1= +MA:,(50FE4"HO&'A]>N!N7VLOSZNZ%UPN8YCT8M(BE@17C,IEQPYXCGQR&7B& +MJ"$H"61;CN#+$9?-XPK,X+[A\TA_C^K@TL%"$DZGN4/`;XTR/DW^M2I[LSNZZ*O*S +M%6<:M!9$*/4$=]`=CH*K\M\WB7M><(\B?GA55`?<;?<4!6#V`]&)2;VR!``` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhd.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhd.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,17 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-vtoc8.vhd.gz +M'XL("/3%'50``VEM9RTQ>#$M-#`Y-BUV=&]C."YV:&0N;W5T`*V6R6[",!"& +M[SS%2+UQ0-[BP+5JN56JU!?`21S40Q.0"AICVC1Q,E?/QUQR.=J!/ +M!%)%M_KX:$Z&W14N543SLE.@*)WGW(6*AIWTZY`0:!)AH*]/4;H&D.V=2XT01C6"::+V716F\K@\\F9D +M(W\ZN=PDA5'^$B5GV$BUCU$2YBU4>XB%4?X2)6 +2?82+6O7I*O<6?^^O%OLJ#``` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,14 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-vtoc8.vhdf.gz +M'XL("/7%'50``VEM9RTQ>#$M-#`Y-BUV=&]C."YV:&1F+F]U=`"ME,MN@S`0 +M1??YBBMUEP7RJC"#!1KF>*X] +M#&-A`(I0"Y#VI@2TA%*0Y!P]G']NL-MO8Q[?GNBE"L.N`HP[9S&$77/8*AMV +MM8[`31+'KP,W8`V8*`(#KCE'-3=QU_(+N'8IN0'7W8LC-_?H#8S)<+L);K_P +M8?"97`-WX/(^(,OE +MXPVQK)B=6;14^'`OKF_1&4@)J6K]\R2_A^?#^OWC,.)$5#4N[%KJJ9/F*BF5NW5]=/QU1YR<;Q)-=Z]38`J< +M)\)C=KNT6#Q.G<2:`9T^ICE:\I(XBK7G<9IE4?\O98^CA4O%U=[J#P!,R,C= +#!@`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vmdk.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vmdk.gz.uu Sat Sep 20 21:02:54 2014 (r271911) @@ -0,0 +1,81 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-vtoc8.vmdk.gz +M'XL("/7%'50``VEM9RTQ>#$M-#`Y-BUV=&]C."YV;61K+F]U=`"M7%UOY,81 +M?/>O&)Q?#@D@L);?#PQ>YWKSY(MPER]E[9Y8'I)`>YR +M\,0A7+$\>7DIA;OKUJ='?R-P+@*Y'5SY0DV'Q7YI=W_Z*C3/[R_W>UB.MVI= +MG;NJ#TM7E>LZ=_5E?2YS]1(T+X!?N]N[S_]QM]/GX?[NT\/'L+^+/]LEN*A\ +M?#5XA*6PNO(W_@D/UWJ(:G+YZ'+XI]WU_KN[7Z>;_T[WG^\^?G@'EGOQ9UOD +MKFC]=GQ\]OC8+?R+9*Z"?PUW_=O?;]^%=VYV\ZF[)YS/6C:RO/92A^)6E?/? +MSQ_K[J8/#QYQ#E]Q=_YL0W/*];4+?U,6KF[=NIW28U^6I\=0\MJ[X7[J'J:? +M?O\TO7OSV\7%E[;&6`UR/XN+RPM\M_[1L>*FD@`]RUX\?;G[\U_(C[IOU_H>__DBX9LE: +M(I<-+BE+0;N:RJW^\NG;TEW??^O>^")_^F5:WX&$:[K+NMGOHW#?=Y^GFZ]O;;^+)=K[88GTL6YL\2K5!^_?WVLZE<=M) +M;P>]'L4X]C?=V'UZF.[]\<:CZ'V+QE"I/];B\1CWKU.O)S7[=XR[OG-O[L;E +M3#WLOZ>/OQ%NV-[&RS[\6Z)=$W-_L[Q[5O@IO,+VCO''Y.&FA_O?;X;??[W[ +M,"X_:.X=X<:M=\MVMM-\/,SE`)<=OKC!I7=OUE.-VR/IZAD7%3 +M\67=];=U>[],W;AL;<$FW.QW=WEY'Z%33UYJ07?7QZZMN)\#7)X%"L@#E>U: +M%+>SO:`0Z#0\?+S?-O9&^#A_^KOLM7QG]5]N3W6:YYA2S* +M':#_+98MWW]9OG]XW%_E]U=)9*U9C2S:'=S/"\2GY^56_J>PD\A>LP99C&>Z +M5WEJFR1R?MH]_JD!N3^&X]\"C,PUJY!%N8,[ZET9>L?(6K,:6;0[N*/>5:%W +MC.PU:Y#%>*K8.O2.D;-F^0O_E$)VXL^RJ@F]8V2N684LRAW<4>_:T#M&UIK5 +MR*+=P1WUK@N]8V2O68,LQE/%]J%WC)PURU]($)#[8[@A](Z1N685LBAW<$>] +M&T/O&%EK5B.+=@=WU+LI](Z1O68-LAA/%3N'WC%RUBQ_*:1W10JNSD+O&)EK +M5B&+<@=WT+N:?,?(6K,:6;0[N(/>U>0[1O::-\8F6M6(8MR!W?4._(=(VO-:F31[N".>D>^8V2O68,LQE/%DN\8.6N6 +MO_"/(,C],1SYCI&Y9A6R*'=P1[TCWS&RUJQ&%NT.[JAWY#M&]IHUR&(\52SY +MCI&S9OD+!1G(_2%,3+7K$(6Y0[NH'<-^8Z1M68ULFAW<`>]:\AWC.PU +M:Y#%>*I8\ATC9\WREU9ZUR;AR'>,S#6KD$6Y@SOJ'?F.D;5F-;)H=W!'O2/? +M,;+7K$$6XZEBR7>,G#7+7_C_GR#WQW#D.T;FFE7(HMS!'?6.?,?(6K,:6;0[ +MN*/>D>\8V6O6((OQ5+'D.T;.FN4OU!\A]\=PY#M&YII5R*+[@#GK7 +MDN\866M6(XMV!W?0NY9\Q\A>LP99C*>*)=\QD>^8V2M68TLVAW<4>_(=XSL-6N0Q7BJ6/(=(V?-\I=9>C3^ +M$*[+MM[%R%RS"EF4.[B#WG6![V)DK5F-+-H=W$'ONL!W,;+7K$$6XZEB`]_% +MR%FS?,M$OT-2TNH"WT'T.ZA^!]'OD-3ONL!W$/T.JM]!]#LD];LN\!U$OX/J +M=Q#][D2Q@>\@^AU4OX/H=TA*6EW@.XA^!]7O(/H=DOI=%_@.HM]!]3N(?H>D +M?M<%OH/H=U#]#J+?G2@V\!U$OX/J=Q#]#DE)JPM\!]'OH/H=1+]#4K_K`M]! +M]#NH?@?1[Y#4[[K`=Q#]#JK?0?2[$\4&OH/H=U#]#J+?(2EI]5GHG>AW4/T. +MHM\AJ=_UY#O1[Z#Z'42_0U*_Z\EWHM]!]3N(?G>B6/*=Z'=0_0ZBWR$I:?7D +M.]'OH/H=1+]#4K_KR7>BWT'U.XA^AZ1^UY/O1+^#ZG<0_>Y$L>0[T>^@^AU$ +MOT-2TNK)=Z+?0?4[B'Z'I'[7D^]$OX/J=Q#]#DG]KB??B7X'U>\@^MV)8LEW +MHM]!]3N(?H>DI-63[T2_@^IW$/T.2?VN)]^)?@?5[R#Z'9+Z74^^$_T.JM]! +M]+L3Q9+O1+^#ZG<0_0Y)26O(0N]$OX/J=Q#]#DG];B#?B7X'U>\@^AV2^MU` +MOA/]#JK?0?2[$\62[T2_@^IW$/T.24EK(-^)?@?5[R#Z'9+ZW4"^$_T.JM]! +M]#LD];N!?"?Z'52_@^AW)XHEWXE^!]7O(/H=DI+60+X3_0ZJWT'T.R3UNX%\ +M)_H=5+^#Z'=(ZG<#^4[T.ZA^!]'O3A1+OA/]#JK?0?0[)"6M@7PG^AU4OX/H +M=TCJ=P/Y3O0[J'X'T>^0U.\&\IWH=U#]#J+?G2B6?"?Z'52_@^AW2$I:8Q9Z +M)_H=5+^#Z'=(ZG^0U.]&\IWH=U#]#J+?(:G?C>0[T>^@^AU$OSM1+/E. +M]#NH?@?1[Y"4M$;RG>AW4/T.HM\AJ=^-Y#O1[Z#Z'42_0U*_&\EWHM]!]3N( +M?G>B6/*=Z'=0_0ZBWR$I:8WD.]'OH/H=1+]#4K\;R7>BWT'U.XA^AZ1^-Y+O +M1+^#ZG<0_>Y$L>0[T>^@^ETTTT'N!O6@I?^&?8N_